[gnome-terminal] profile: editor: Make bold colourpicker insensitive when same-colour chosen



commit 71611a40e7bb762e3d24dbf3947f0ad33f5cfe14
Author: Christian Persch <chpe gnome org>
Date:   Tue Jan 22 14:56:59 2013 +0100

    profile: editor: Make bold colourpicker insensitive when same-colour chosen
    
    When the 'same colour as text' checkbox is active, make the colourpicker
    insensitive.

 src/profile-editor.c       |    7 ++++
 src/profile-preferences.ui |   78 ++++++++++++++++++++++++++++---------------
 2 files changed, 58 insertions(+), 27 deletions(-)
---
diff --git a/src/profile-editor.c b/src/profile-editor.c
index 2e3b3e7..ba251d0 100644
--- a/src/profile-editor.c
+++ b/src/profile-editor.c
@@ -849,6 +849,13 @@ terminal_profile_edit (GSettings  *profile,
                    gtk_builder_get_object (builder,
                                            "bold-color-same-as-fg-checkbox"),
                    "active", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
+  g_settings_bind (profile, TERMINAL_PROFILE_BOLD_COLOR_SAME_AS_FG_KEY,
+                   gtk_builder_get_object (builder,
+                                           "bold-colorpicker-box"),
+                   "sensitive", 
+                   G_SETTINGS_BIND_GET |
+                   G_SETTINGS_BIND_INVERT_BOOLEAN |
+                   G_SETTINGS_BIND_NO_SENSITIVITY);
   g_settings_bind_with_mapping (profile, TERMINAL_PROFILE_BOLD_COLOR_KEY,
                                 gtk_builder_get_object (builder,
                                                         "bold-colorpicker"),
diff --git a/src/profile-preferences.ui b/src/profile-preferences.ui
index aec880a..8b2c8e9 100644
--- a/src/profile-preferences.ui
+++ b/src/profile-preferences.ui
@@ -1101,19 +1101,6 @@
                                     <property name="column_spacing">12</property>
                                     <property name="row_spacing">6</property>
                                     <child>
-                                      <object class="GtkColorButton" id="bold-colorpicker">
-                                        <property name="visible">True</property>
-                                        <property name="can_focus">True</property>
-                                        <property name="receives_default">False</property>
-                                      </object>
-                                      <packing>
-                                        <property name="left_attach">1</property>
-                                        <property name="right_attach">2</property>
-                                        <property name="x_options">GTK_FILL</property>
-                                        <property name="y_options"></property>
-                                      </packing>
-                                    </child>
-                                    <child>
                                       <object class="GtkLabel" id="label481">
                                         <property name="can_focus">False</property>
                                         <property name="xalign">0</property>
@@ -1129,20 +1116,6 @@
                                       </packing>
                                     </child>
                                     <child>
-                                      <object class="GtkColorButton" id="underline-colorpicker">
-                                        <property name="can_focus">True</property>
-                                        <property name="receives_default">False</property>
-                                      </object>
-                                      <packing>
-                                        <property name="left_attach">1</property>
-                                        <property name="right_attach">2</property>
-                                        <property name="top_attach">1</property>
-                                        <property name="bottom_attach">2</property>
-                                        <property name="x_options">GTK_FILL</property>
-                                        <property name="y_options"></property>
-                                      </packing>
-                                    </child>
-                                    <child>
                                       <object class="GtkCheckButton" id="underline-color-same-as-fg-checkbox">
                                         <property name="label" translatable="yes">_Same as text color</property>
                                         <property name="can_focus">True</property>
@@ -1193,6 +1166,57 @@
                                         <property name="y_options"></property>
                                       </packing>
                                     </child>
+                                    <child>
+                                      <object class="GtkBox" id="bold-colorpicker-box">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="orientation">vertical</property>
+                                        <child>
+                                          <object class="GtkColorButton" id="bold-colorpicker">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">True</property>
+                                            <property name="receives_default">False</property>
+                                          </object>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="fill">True</property>
+                                            <property name="position">0</property>
+                                          </packing>
+                                        </child>
+                                      </object>
+                                      <packing>
+                                        <property name="left_attach">1</property>
+                                        <property name="right_attach">2</property>
+                                        <property name="x_options">GTK_FILL</property>
+                                        <property name="y_options"></property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkBox" id="underline-colorpicker-box">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="orientation">vertical</property>
+                                        <child>
+                                          <object class="GtkColorButton" id="underline-colorpicker">
+                                            <property name="can_focus">True</property>
+                                            <property name="receives_default">False</property>
+                                          </object>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="fill">True</property>
+                                            <property name="position">0</property>
+                                          </packing>
+                                        </child>
+                                      </object>
+                                      <packing>
+                                        <property name="left_attach">1</property>
+                                        <property name="right_attach">2</property>
+                                        <property name="top_attach">1</property>
+                                        <property name="bottom_attach">2</property>
+                                        <property name="x_options">GTK_FILL</property>
+                                        <property name="y_options"></property>
+                                      </packing>
+                                    </child>
                                   </object>
                                   <packing>
                                     <property name="expand">False</property>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]