Changeset 8fd387306e4b1be05ca3f43e95e8cb5238d8f0d9

Show
Ignore:
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:
4 modified

Legend:

Unmodified
Added
Removed
  • data/guake.schemas

    r23ad51b r8fd3873  
    219219 
    220220        <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> 
    223223            <owner>guake</owner> 
    224224            <type>int</type> 
    225225            <default>80</default> 
    226226            <locale name="C"> 
    227                 <short>Background opacity.</short> 
     227                <short>Background transparency.</short> 
    228228                <long>Alpha that will be applied to the terminal 
    229229                background.</long> 
  • data/prefs.glade

    rc95bf63 r8fd3873  
    737737                                    <property name="expand">False</property> 
    738738                                    <property name="fill">False</property> 
    739                                     <property name="position">1</property> 
     739                                    <property name="position">2</property> 
    740740                                  </packing> 
    741741                                </child> 
     
    748748                                        <property name="visible">True</property> 
    749749                                        <property name="xalign">0</property> 
    750                                         <property name="label" translatable="yes">Opacity:</property> 
     750                                        <property name="label" translatable="yes">Transparency:</property> 
    751751                                        <property name="use_markup">True</property> 
    752752                                      </widget> 
     
    757757                                    </child> 
    758758                                    <child> 
    759                                       <widget class="GtkHScale" id="background_opacity"> 
     759                                      <widget class="GtkHScale" id="background_transparency"> 
    760760                                        <property name="visible">True</property> 
    761761                                        <property name="can_focus">True</property> 
     
    763763                                        <property name="draw_value">False</property> 
    764764                                        <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"/> 
    766766                                      </widget> 
    767767                                      <packing> 
     
    772772                                  <packing> 
    773773                                    <property name="expand">False</property> 
    774                                     <property name="position">2</property> 
     774                                    <property name="position">1</property> 
    775775                                  </packing> 
    776776                                </child> 
  • src/guake.py

    ra9c1917 r8fd3873  
    106106        notify_add(KEY('/style/background/color'), self.bgcolor_changed) 
    107107        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) 
    109109 
    110110        notify_add(KEY('/general/compat_backspace'), self.backspace_changed) 
     
    257257                    i.set_background_transparent(True) 
    258258 
    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 
    262262        properties in all terminals open. 
    263263        """ 
    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) 
    267267            if self.guake.has_argb: 
    268                 i.set_opacity(65535 / 100 * abs(opacity - 100)) 
     268                i.set_opacity(int((100 - transparency) / 100.0 * 65535)) 
    269269 
    270270    def backspace_changed(self, client, connection_id, entry, data): 
     
    748748        self.client.notify(KEY('/style/background/color')) 
    749749        self.client.notify(KEY('/style/background/image')) 
    750         self.client.notify(KEY('/style/background/opacity')) 
     750        self.client.notify(KEY('/style/background/transparency')) 
    751751        self.client.notify(KEY('/general/use_default_font')) 
    752752 
  • src/prefs.py

    r23ad51b r8fd3873  
    199199            self.client.set_string(KEY('/style/background/image'), filename) 
    200200 
    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 
    203203        """ 
    204204        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)) 
    206206 
    207207    # compatibility tab 
     
    448448            self.get_widget('background_image').set_filename(value) 
    449449 
    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) 
    452452 
    453453        # it's a separated method, to be reused.