[Xfce4-commits] [xfce/xfce4-settings] 37/37: color: Add enable button and fix inline-toolbar

noreply at xfce.org noreply at xfce.org
Fri Feb 15 00:28:06 CET 2019


This is an automated email from the git hooks/post-receive script.

o   c   h   o   s   i       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       o   c   h   o   s   i   /   c   o   l   o   r   d   
   in repository xfce/xfce4-settings.

commit 36c172f39f402f5e71eaaf2919433e450f265da4
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date:   Fri Feb 15 00:27:23 2019 +0100

    color: Add enable button and fix inline-toolbar
---
 dialogs/color-settings/color-dialog.glade | 215 ++++++++++++++----------------
 dialogs/color-settings/main.c             |  21 ++-
 2 files changed, 118 insertions(+), 118 deletions(-)

diff --git a/dialogs/color-settings/color-dialog.glade b/dialogs/color-settings/color-dialog.glade
index 8ff34d9..e9ff32e 100644
--- a/dialogs/color-settings/color-dialog.glade
+++ b/dialogs/color-settings/color-dialog.glade
@@ -3,13 +3,6 @@
 <interface>
   <requires lib="gtk+" version="3.20"/>
   <requires lib="libxfce4ui-2" version="4.13"/>
-  <object class="GtkAdjustment" id="bounce-keys-delay">
-    <property name="lower">50</property>
-    <property name="upper">1000</property>
-    <property name="value">500</property>
-    <property name="step_increment">1</property>
-    <property name="page_increment">10</property>
-  </object>
   <object class="GtkListStore" id="devices"/>
   <object class="GtkImage" id="image1">
     <property name="visible">True</property>
@@ -44,8 +37,8 @@
             <property name="can_focus">False</property>
             <property name="layout_style">end</property>
             <child>
-              <object class="GtkButton" id="button2">
-                <property name="label">gtk-close</property>
+              <object class="GtkButton" id="button1">
+                <property name="label">gtk-help</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="receives_default">True</property>
@@ -55,11 +48,12 @@
                 <property name="expand">False</property>
                 <property name="fill">False</property>
                 <property name="position">0</property>
+                <property name="secondary">True</property>
               </packing>
             </child>
             <child>
-              <object class="GtkButton" id="button1">
-                <property name="label">gtk-help</property>
+              <object class="GtkButton" id="button2">
+                <property name="label">gtk-close</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="receives_default">True</property>
@@ -69,7 +63,6 @@
                 <property name="expand">False</property>
                 <property name="fill">False</property>
                 <property name="position">0</property>
-                <property name="secondary">True</property>
               </packing>
             </child>
           </object>
@@ -84,6 +77,7 @@
           <object class="GtkBox" id="plug-child">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
+            <property name="vexpand">True</property>
             <property name="orientation">vertical</property>
             <child>
               <object class="GtkGrid" id="grid">
@@ -198,44 +192,12 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkBox">
+                  <object class="GtkBox" id="profile">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="vexpand">True</property>
                     <property name="orientation">vertical</property>
                     <child>
-                      <object class="GtkBox" id="box-profiles">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="orientation">vertical</property>
-                        <child>
-                          <object class="GtkFrame" id="frame-profiles">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="hexpand">True</property>
-                            <property name="label_xalign">0.5</property>
-                            <property name="shadow_type">in</property>
-                            <child>
-                              <placeholder/>
-                            </child>
-                            <child type="label_item">
-                              <placeholder/>
-                            </child>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">True</property>
-                            <property name="position">0</property>
-                          </packing>
-                        </child>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">True</property>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                    <child>
                       <object class="GtkBox" id="label-no-profiles">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
@@ -269,39 +231,107 @@
                       <packing>
                         <property name="expand">False</property>
                         <property name="fill">True</property>
-                        <property name="position">1</property>
+                        <property name="position">0</property>
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkBox" id="profiles-toolbar">
+                      <object class="GtkFrame" id="box-profiles">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
+                        <property name="label_xalign">0</property>
+                        <property name="shadow_type">in</property>
                         <child>
-                          <object class="GtkButton" id="profiles-add">
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">True</property>
-                            <property name="image">image1</property>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">True</property>
-                            <property name="position">0</property>
-                          </packing>
+                          <placeholder/>
+                        </child>
+                        <child type="label_item">
+                          <placeholder/>
                         </child>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkFrame">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="label_xalign">0</property>
+                        <property name="shadow_type">none</property>
                         <child>
-                          <object class="GtkButton" id="profiles-remove">
+                          <object class="GtkBox" id="profiles-toolbar">
                             <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">True</property>
-                            <property name="tooltip_text" translatable="yes">Delete the currently selected profile</property>
-                            <property name="image">image2</property>
+                            <property name="can_focus">False</property>
+                            <child>
+                              <object class="GtkBox">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <child>
+                                  <object class="GtkButton" id="profiles-add">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="receives_default">True</property>
+                                    <property name="image">image1</property>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">True</property>
+                                    <property name="position">0</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkButton" id="profiles-remove">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="receives_default">True</property>
+                                    <property name="tooltip_text" translatable="yes">Delete the currently selected profile</property>
+                                    <property name="image">image2</property>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">True</property>
+                                    <property name="position">1</property>
+                                  </packing>
+                                </child>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">True</property>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkBox">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="orientation">vertical</property>
+                                <child>
+                                  <object class="GtkButton" id="profiles-enable">
+                                    <property name="label" translatable="yes">Enable</property>
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="receives_default">True</property>
+                                    <property name="tooltip_text" translatable="yes">Enable the selected profile</property>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">True</property>
+                                    <property name="position">0</property>
+                                  </packing>
+                                </child>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">True</property>
+                                <property name="pack_type">end</property>
+                                <property name="position">2</property>
+                              </packing>
+                            </child>
                           </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">True</property>
-                            <property name="position">2</property>
-                          </packing>
+                        </child>
+                        <child type="label_item">
+                          <placeholder/>
                         </child>
                         <style>
                           <class name="inline-toolbar"/>
@@ -336,8 +366,8 @@
       </object>
     </child>
     <action-widgets>
-      <action-widget response="0">button2</action-widget>
       <action-widget response="-11">button1</action-widget>
+      <action-widget response="0">button2</action-widget>
     </action-widgets>
   </object>
   <object class="GtkImage" id="image3">
@@ -380,10 +410,11 @@
             <property name="layout_style">end</property>
             <child>
               <object class="GtkButton" id="assign-cancel">
-                <property name="label" translatable="yes">Cancel</property>
+                <property name="label" translatable="yes">_Cancel</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="receives_default">True</property>
+                <property name="use_underline">True</property>
               </object>
               <packing>
                 <property name="expand">True</property>
@@ -393,10 +424,11 @@
             </child>
             <child>
               <object class="GtkButton" id="assign-ok">
-                <property name="label" translatable="yes">OK</property>
+                <property name="label" translatable="yes">_OK</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="receives_default">True</property>
+                <property name="use_underline">True</property>
               </object>
               <packing>
                 <property name="expand">True</property>
@@ -501,46 +533,5 @@
       </object>
     </child>
   </object>
-  <object class="GtkAdjustment" id="mouse-emulation-curve">
-    <property name="lower">-1000</property>
-    <property name="upper">1000</property>
-    <property name="step_increment">10</property>
-    <property name="page_increment">100</property>
-  </object>
-  <object class="GtkAdjustment" id="mouse-emulation-delay">
-    <property name="lower">1</property>
-    <property name="upper">1000</property>
-    <property name="value">150</property>
-    <property name="step_increment">10</property>
-    <property name="page_increment">100</property>
-  </object>
-  <object class="GtkAdjustment" id="mouse-emulation-interval">
-    <property name="lower">10</property>
-    <property name="upper">1000</property>
-    <property name="value">20</property>
-    <property name="step_increment">1</property>
-    <property name="page_increment">10</property>
-  </object>
-  <object class="GtkAdjustment" id="mouse-emulation-max-speed">
-    <property name="lower">1</property>
-    <property name="upper">2000</property>
-    <property name="value">1000</property>
-    <property name="step_increment">10</property>
-    <property name="page_increment">100</property>
-  </object>
-  <object class="GtkAdjustment" id="mouse-emulation-time-to-max">
-    <property name="lower">100</property>
-    <property name="upper">10000</property>
-    <property name="value">3000</property>
-    <property name="step_increment">10</property>
-    <property name="page_increment">100</property>
-  </object>
   <object class="GtkListStore" id="profiles"/>
-  <object class="GtkAdjustment" id="slow-keys-delay">
-    <property name="lower">50</property>
-    <property name="upper">1000</property>
-    <property name="value">500</property>
-    <property name="step_increment">10</property>
-    <property name="page_increment">100</property>
-  </object>
 </interface>
diff --git a/dialogs/color-settings/main.c b/dialogs/color-settings/main.c
index 5006055..941ceba 100644
--- a/dialogs/color-settings/main.c
+++ b/dialogs/color-settings/main.c
@@ -76,9 +76,9 @@ struct _ColorSettings
     GObject       *dialog_assign;
     GObject       *label_no_profiles;
     GObject       *box_profiles;
+    GObject       *profiles_enable;
     GObject       *profiles_add;
     GObject       *profiles_remove;
-    GObject       *frame_profiles;
     GtkListBox    *profiles_list_box;
     gchar         *profiles_list_box_filter;
     guint          profiles_list_box_selected_id;
@@ -594,8 +594,8 @@ color_settings_device_profile_enable_cb (GtkWidget *widget, ColorSettings *setti
         return;
     profile = color_profile_get_profile (SETTINGS_COLOR_PROFILE (row));
     if (profile == NULL) {
-          g_warning ("failed to get the active profile");
-          return;
+        g_warning ("failed to get the active profile");
+        return;
     }
 
     /* just set it default */
@@ -691,12 +691,15 @@ color_settings_list_box_row_activated_cb (GtkListBox *list_box,
     {
         color_settings_device_changed_cb (settings->current_device, settings);
         gtk_widget_set_sensitive (GTK_WIDGET (settings->profiles_add), TRUE);
+        gtk_widget_set_sensitive (GTK_WIDGET (settings->profiles_remove), FALSE);
+        gtk_widget_set_sensitive (GTK_WIDGET (settings->profiles_enable), FALSE);
     }
     else
     {
         gtk_widget_show (GTK_WIDGET (settings->label_no_profiles));
         gtk_widget_set_sensitive (GTK_WIDGET (settings->profiles_add), FALSE);
         gtk_widget_set_sensitive (GTK_WIDGET (settings->profiles_remove), FALSE);
+        gtk_widget_set_sensitive (GTK_WIDGET (settings->profiles_enable), FALSE);
         gtk_widget_hide (GTK_WIDGET (settings->box_profiles));
     }
 }
@@ -714,6 +717,7 @@ color_settings_device_enabled_changed_cb (ColorDevice *widget,
     gtk_widget_set_visible (GTK_WIDGET (settings->box_profiles), is_enabled);
     gtk_widget_set_sensitive (GTK_WIDGET (settings->profiles_add), is_enabled);
     gtk_widget_set_sensitive (GTK_WIDGET (settings->profiles_remove), is_enabled);
+    gtk_widget_set_sensitive (GTK_WIDGET (settings->profiles_enable), is_enabled);
 }
 
 
@@ -724,6 +728,7 @@ color_settings_profiles_list_box_row_selected_cb (GtkListBox *list_box,
                                                   ColorSettings *settings)
 {
     gtk_widget_set_sensitive (GTK_WIDGET (settings->profiles_remove), TRUE);
+    gtk_widget_set_sensitive (GTK_WIDGET (settings->profiles_enable), TRUE);
 }
 
 
@@ -959,7 +964,7 @@ color_settings_device_removed_cb (CdClient *client,
     /* remove from the UI */
     color_settings_remove_device (settings, device);
 
-    /* ensure we showing the 'No devices detected' entry if required */
+    /* ensure we're showing the 'No devices detected' entry if required */
     color_settings_update_device_list_extra_entry (settings);
 }
 
@@ -1043,6 +1048,7 @@ color_settings_dialog_init (GtkBuilder *builder)
 {
     ColorSettings *settings;
     GtkTreeSelection *selection;
+    GtkStyleContext *context;
 
     settings = g_new0 (ColorSettings, 1);
     settings->cancellable = g_cancellable_new ();
@@ -1090,9 +1096,12 @@ color_settings_dialog_init (GtkBuilder *builder)
     gtk_widget_set_sensitive (GTK_WIDGET (settings->profiles_remove), FALSE);
     g_signal_connect (settings->profiles_remove, "clicked", G_CALLBACK (color_settings_profile_remove_cb), settings);
 
+    settings->profiles_enable = gtk_builder_get_object (builder, "profiles-enable");
+    gtk_widget_set_sensitive (GTK_WIDGET (settings->profiles_enable), FALSE);
+    g_signal_connect (settings->profiles_enable, "clicked", G_CALLBACK (color_settings_device_profile_enable_cb), settings);
+
     settings->label_no_profiles = gtk_builder_get_object (builder, "label-no-profiles");
     settings->box_profiles = gtk_builder_get_object (builder, "box-profiles");
-    settings->frame_profiles = gtk_builder_get_object (builder, "frame-profiles");
     settings->profiles_list_box = GTK_LIST_BOX (gtk_list_box_new ());
     gtk_list_box_set_header_func (settings->profiles_list_box,
                                   list_box_update_header_func,
@@ -1110,7 +1119,7 @@ color_settings_dialog_init (GtkBuilder *builder)
                       settings);
     settings->profiles_list_box_size = gtk_size_group_new (GTK_SIZE_GROUP_VERTICAL);
 
-    gtk_container_add (GTK_CONTAINER (settings->frame_profiles), GTK_WIDGET (settings->profiles_list_box));
+    gtk_container_add (GTK_CONTAINER (settings->box_profiles), GTK_WIDGET (settings->profiles_list_box));
     gtk_widget_show (GTK_WIDGET (settings->profiles_list_box));
 
     /* Treeview of all colord profiles */

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list