Changeset 8fd387306e4b1be05ca3f43e95e8cb5238d8f0d9
- Timestamp:
- 03/24/09 14:43:11 (3 years ago)
- Author:
- Lincoln de Sousa <lincoln@…>
- Children:
- 417c2fc26dedefcc7290adcd925c6b3ef656345f
- Parents:
- a9c19174a0f3c1230e8b29eaaebfda077b0efbef
- git-author:
- Aleksandar Krsteski <alekrsteski@…> (03/24/09 13:27:32)
- git-committer:
- Lincoln de Sousa <lincoln@…> (03/24/09 14:43:11)
- Message:
-
Change opacity to transparency
Change the opacity option in preferences dialog to transparency to make
it more logical and intuitive.
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r23ad51b
|
r8fd3873
|
|
| 219 | 219 | |
| 220 | 220 | <schema> |
| 221 | | <key>/schemas/apps/guake/style/background/opacity</key> |
| 222 | | <applyto>/apps/guake/style/background/opacity</applyto> |
| | 221 | <key>/schemas/apps/guake/style/background/transparency</key> |
| | 222 | <applyto>/apps/guake/style/background/transparency</applyto> |
| 223 | 223 | <owner>guake</owner> |
| 224 | 224 | <type>int</type> |
| 225 | 225 | <default>80</default> |
| 226 | 226 | <locale name="C"> |
| 227 | | <short>Background opacity.</short> |
| | 227 | <short>Background transparency.</short> |
| 228 | 228 | <long>Alpha that will be applied to the terminal |
| 229 | 229 | background.</long> |
-
|
rc95bf63
|
r8fd3873
|
|
| 737 | 737 | <property name="expand">False</property> |
| 738 | 738 | <property name="fill">False</property> |
| 739 | | <property name="position">1</property> |
| | 739 | <property name="position">2</property> |
| 740 | 740 | </packing> |
| 741 | 741 | </child> |
| … |
… |
|
| 748 | 748 | <property name="visible">True</property> |
| 749 | 749 | <property name="xalign">0</property> |
| 750 | | <property name="label" translatable="yes">Opacity:</property> |
| | 750 | <property name="label" translatable="yes">Transparency:</property> |
| 751 | 751 | <property name="use_markup">True</property> |
| 752 | 752 | </widget> |
| … |
… |
|
| 757 | 757 | </child> |
| 758 | 758 | <child> |
| 759 | | <widget class="GtkHScale" id="background_opacity"> |
| | 759 | <widget class="GtkHScale" id="background_transparency"> |
| 760 | 760 | <property name="visible">True</property> |
| 761 | 761 | <property name="can_focus">True</property> |
| … |
… |
|
| 763 | 763 | <property name="draw_value">False</property> |
| 764 | 764 | <property name="value_pos">GTK_POS_RIGHT</property> |
| 765 | | <signal name="value_changed" handler="on_opacity_value_changed"/> |
| | 765 | <signal name="value_changed" handler="on_transparency_value_changed"/> |
| 766 | 766 | </widget> |
| 767 | 767 | <packing> |
| … |
… |
|
| 772 | 772 | <packing> |
| 773 | 773 | <property name="expand">False</property> |
| 774 | | <property name="position">2</property> |
| | 774 | <property name="position">1</property> |
| 775 | 775 | </packing> |
| 776 | 776 | </child> |
-
|
ra9c1917
|
r8fd3873
|
|
| 106 | 106 | notify_add(KEY('/style/background/color'), self.bgcolor_changed) |
| 107 | 107 | notify_add(KEY('/style/background/image'), self.bgimage_changed) |
| 108 | | notify_add(KEY('/style/background/opacity'), self.bgopacity_changed) |
| | 108 | notify_add(KEY('/style/background/transparency'), self.bgtransparency_changed) |
| 109 | 109 | |
| 110 | 110 | notify_add(KEY('/general/compat_backspace'), self.backspace_changed) |
| … |
… |
|
| 257 | 257 | i.set_background_transparent(True) |
| 258 | 258 | |
| 259 | | def bgopacity_changed(self, client, connection_id, entry, data): |
| 260 | | """If the gconf var style/background/opacity be changed, this |
| 261 | | method will be called and will set the saturation and opacity |
| | 259 | def bgtransparency_changed(self, client, connection_id, entry, data): |
| | 260 | """If the gconf var style/background/transparency be changed, this |
| | 261 | method will be called and will set the saturation and transparency |
| 262 | 262 | properties in all terminals open. |
| 263 | 263 | """ |
| 264 | | opacity = entry.value.get_int() |
| 265 | | for i in self.guake.term_list: |
| 266 | | i.set_background_saturation(opacity / 100.0) |
| | 264 | transparency = entry.value.get_int() |
| | 265 | for i in self.guake.term_list: |
| | 266 | i.set_background_saturation(transparency / 100.0) |
| 267 | 267 | if self.guake.has_argb: |
| 268 | | i.set_opacity(65535 / 100 * abs(opacity - 100)) |
| | 268 | i.set_opacity(int((100 - transparency) / 100.0 * 65535)) |
| 269 | 269 | |
| 270 | 270 | def backspace_changed(self, client, connection_id, entry, data): |
| … |
… |
|
| 748 | 748 | self.client.notify(KEY('/style/background/color')) |
| 749 | 749 | self.client.notify(KEY('/style/background/image')) |
| 750 | | self.client.notify(KEY('/style/background/opacity')) |
| | 750 | self.client.notify(KEY('/style/background/transparency')) |
| 751 | 751 | self.client.notify(KEY('/general/use_default_font')) |
| 752 | 752 | |
-
|
r23ad51b
|
r8fd3873
|
|
| 199 | 199 | self.client.set_string(KEY('/style/background/image'), filename) |
| 200 | 200 | |
| 201 | | def on_opacity_value_changed(self, hscale): |
| 202 | | """Changes the value of background_opacity in gconf |
| | 201 | def on_transparency_value_changed(self, hscale): |
| | 202 | """Changes the value of background_transparency in gconf |
| 203 | 203 | """ |
| 204 | 204 | value = hscale.get_value() |
| 205 | | self.client.set_int(KEY('/style/background/opacity'), int(value)) |
| | 205 | self.client.set_int(KEY('/style/background/transparency'), int(value)) |
| 206 | 206 | |
| 207 | 207 | # compatibility tab |
| … |
… |
|
| 448 | 448 | self.get_widget('background_image').set_filename(value) |
| 449 | 449 | |
| 450 | | value = self.client.get_int(KEY('/style/background/opacity')) |
| 451 | | self.get_widget('background_opacity').set_value(value) |
| | 450 | value = self.client.get_int(KEY('/style/background/transparency')) |
| | 451 | self.get_widget('background_transparency').set_value(value) |
| 452 | 452 | |
| 453 | 453 | # it's a separated method, to be reused. |