Change sensitive of custom font label.
authorHuang Peng <shawn.p.huang@gmail.com>
Wed, 11 Mar 2009 06:18:11 +0000 (14:18 +0800)
committerHuang Peng <shawn.p.huang@gmail.com>
Wed, 11 Mar 2009 06:18:11 +0000 (14:18 +0800)
setup/main.py
setup/setup.glade

index c67cbd9..42c3233 100644 (file)
@@ -141,10 +141,13 @@ class Setup(object):
             self.__config.get_value("panel", "use_custom_font", False))
         self.__checkbutton_custom_font.connect("toggled", self.__checkbutton_custom_font_toggled_cb)
 
+        self.__label_custom_font = self.__xml.get_widget("label_custom_font")
         self.__fontbutton_custom_font = self.__xml.get_widget("fontbutton_custom_font")
         if self.__config.get_value("panel", "use_custom_font", False):
+            self.__label_custom_font.set_sensitive(True)
             self.__fontbutton_custom_font.set_sensitive(True)
         else:
+            self.__label_custom_font.set_sensitive(False)
             self.__fontbutton_custom_font.set_sensitive(False)
         font_name = gtk.settings_get_default().get_property("gtk-font-name")
         font_name = unicode(font_name, "utf-8")
@@ -339,9 +342,11 @@ class Setup(object):
 
     def __checkbutton_custom_font_toggled_cb(self, button):
         if self.__checkbutton_custom_font.get_active():
+            self.__label_custom_font.set_sensitive(True)
             self.__fontbutton_custom_font.set_sensitive(True)
             self.__config.set_value("panel", "use_custom_font", True)
         else:
+            self.__label_custom_font.set_sensitive(False)
             self.__fontbutton_custom_font.set_sensitive(False)
             self.__config.set_value("panel", "use_custom_font", False)
 
index 694240b..a50efd1 100644 (file)
                                 <property name="column_spacing">12</property>
                                 <property name="row_spacing">6</property>
                                 <child>
-                                  <widget class="GtkHBox" id="hbox6">
+                                  <widget class="GtkLabel" id="label7">
+                                    <property name="visible">True</property>
+                                    <property name="xalign">0</property>
+                                    <property name="label" translatable="yes">Enable or disable:</property>
+                                  </widget>
+                                  <packing>
+                                    <property name="x_options">GTK_FILL</property>
+                                    <property name="y_options">GTK_FILL</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <widget class="GtkLabel" id="label8">
+                                    <property name="visible">True</property>
+                                    <property name="xalign">0</property>
+                                    <property name="label" translatable="yes">Next input method:</property>
+                                  </widget>
+                                  <packing>
+                                    <property name="top_attach">1</property>
+                                    <property name="bottom_attach">2</property>
+                                    <property name="x_options">GTK_FILL</property>
+                                    <property name="y_options">GTK_FILL</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <widget class="GtkLabel" id="label9">
+                                    <property name="visible">True</property>
+                                    <property name="sensitive">False</property>
+                                    <property name="xalign">0</property>
+                                    <property name="label" translatable="yes">previous input method:</property>
+                                  </widget>
+                                  <packing>
+                                    <property name="top_attach">2</property>
+                                    <property name="bottom_attach">3</property>
+                                    <property name="x_options">GTK_FILL</property>
+                                    <property name="y_options">GTK_FILL</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <widget class="GtkHBox" id="hbox4">
                                     <property name="visible">True</property>
                                     <property name="spacing">6</property>
                                     <child>
-                                      <widget class="GtkEntry" id="entry_prev_engine">
+                                      <widget class="GtkEntry" id="entry_trigger">
                                         <property name="visible">True</property>
-                                        <property name="sensitive">False</property>
                                         <property name="can_focus">True</property>
                                         <property name="editable">False</property>
                                       </widget>
                                     </child>
                                     <child>
-                                      <widget class="GtkButton" id="button_prev_engine">
+                                      <widget class="GtkButton" id="button_trigger">
                                         <property name="visible">True</property>
-                                        <property name="sensitive">False</property>
                                         <property name="can_focus">True</property>
                                         <property name="label" translatable="yes">...</property>
                                         <property name="use_underline">True</property>
                                   <packing>
                                     <property name="left_attach">1</property>
                                     <property name="right_attach">2</property>
-                                    <property name="top_attach">2</property>
-                                    <property name="bottom_attach">3</property>
                                   </packing>
                                 </child>
                                 <child>
                                   </packing>
                                 </child>
                                 <child>
-                                  <widget class="GtkHBox" id="hbox4">
+                                  <widget class="GtkHBox" id="hbox6">
                                     <property name="visible">True</property>
                                     <property name="spacing">6</property>
                                     <child>
-                                      <widget class="GtkEntry" id="entry_trigger">
+                                      <widget class="GtkEntry" id="entry_prev_engine">
                                         <property name="visible">True</property>
+                                        <property name="sensitive">False</property>
                                         <property name="can_focus">True</property>
                                         <property name="editable">False</property>
                                       </widget>
                                     </child>
                                     <child>
-                                      <widget class="GtkButton" id="button_trigger">
+                                      <widget class="GtkButton" id="button_prev_engine">
                                         <property name="visible">True</property>
+                                        <property name="sensitive">False</property>
                                         <property name="can_focus">True</property>
                                         <property name="label" translatable="yes">...</property>
                                         <property name="use_underline">True</property>
                                   <packing>
                                     <property name="left_attach">1</property>
                                     <property name="right_attach">2</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <widget class="GtkLabel" id="label9">
-                                    <property name="visible">True</property>
-                                    <property name="sensitive">False</property>
-                                    <property name="xalign">0</property>
-                                    <property name="label" translatable="yes">previous input method:</property>
-                                  </widget>
-                                  <packing>
                                     <property name="top_attach">2</property>
                                     <property name="bottom_attach">3</property>
-                                    <property name="x_options">GTK_FILL</property>
-                                    <property name="y_options">GTK_FILL</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <widget class="GtkLabel" id="label8">
-                                    <property name="visible">True</property>
-                                    <property name="xalign">0</property>
-                                    <property name="label" translatable="yes">Next input method:</property>
-                                  </widget>
-                                  <packing>
-                                    <property name="top_attach">1</property>
-                                    <property name="bottom_attach">2</property>
-                                    <property name="x_options">GTK_FILL</property>
-                                    <property name="y_options">GTK_FILL</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <widget class="GtkLabel" id="label7">
-                                    <property name="visible">True</property>
-                                    <property name="xalign">0</property>
-                                    <property name="label" translatable="yes">Enable or disable:</property>
-                                  </widget>
-                                  <packing>
-                                    <property name="x_options">GTK_FILL</property>
-                                    <property name="y_options">GTK_FILL</property>
                                   </packing>
                                 </child>
                               </widget>
@@ -286,7 +286,7 @@ Always</property>
                                   <widget class="GtkHBox" id="hbox7">
                                     <property name="visible">True</property>
                                     <child>
-                                      <widget class="GtkLabel" id="label11">
+                                      <widget class="GtkLabel" id="label_custom_font">
                                         <property name="visible">True</property>
                                         <property name="xalign">0</property>
                                         <property name="label" translatable="yes">Custom font:</property>