[Xfce4-commits] [panel-plugins/xfce4-clipman-plugin] 01/01: settings: Replace GtkStock icons and tweak actions dialog

noreply at xfce.org noreply at xfce.org
Sun Mar 29 13:16:24 CEST 2020


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       m   a   s   t   e   r   
   in repository panel-plugins/xfce4-clipman-plugin.

commit 85e5693ce706e261bb577148085862bd6154d619
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date:   Sun Mar 29 13:15:20 2020 +0200

    settings: Replace GtkStock icons and tweak actions dialog
---
 panel-plugin/settings-dialog.ui       | 115 +++++++++++++++-------------------
 panel-plugin/xfce4-clipman-settings.c |  36 +++++++++++
 2 files changed, 86 insertions(+), 65 deletions(-)

diff --git a/panel-plugin/settings-dialog.ui b/panel-plugin/settings-dialog.ui
index 1525e48..c1d3b49 100644
--- a/panel-plugin/settings-dialog.ui
+++ b/panel-plugin/settings-dialog.ui
@@ -450,7 +450,7 @@ Otherwise the menu will only appear when calling "xfce4-popup-clipman-actions" (
                               <object class="GtkImage" id="image1">
                                 <property name="visible">True</property>
                                 <property name="can_focus">False</property>
-                                <property name="stock">gtk-add</property>
+                                <property name="icon_name">list-add-symbolic</property>
                                 <property name="icon_size">1</property>
                               </object>
                             </child>
@@ -472,7 +472,7 @@ Otherwise the menu will only appear when calling "xfce4-popup-clipman-actions" (
                               <object class="GtkImage" id="image2">
                                 <property name="visible">True</property>
                                 <property name="can_focus">False</property>
-                                <property name="stock">gtk-edit</property>
+                                <property name="icon_name">document-edit-symbolic</property>
                                 <property name="icon_size">1</property>
                               </object>
                             </child>
@@ -494,7 +494,7 @@ Otherwise the menu will only appear when calling "xfce4-popup-clipman-actions" (
                               <object class="GtkImage" id="image3">
                                 <property name="visible">True</property>
                                 <property name="can_focus">False</property>
-                                <property name="stock">gtk-delete</property>
+                                <property name="icon_name">edit-delete-symbolic</property>
                                 <property name="icon_size">1</property>
                               </object>
                             </child>
@@ -515,7 +515,7 @@ Otherwise the menu will only appear when calling "xfce4-popup-clipman-actions" (
                               <object class="GtkImage" id="image4">
                                 <property name="visible">True</property>
                                 <property name="can_focus">False</property>
-                                <property name="stock">gtk-clear</property>
+                                <property name="icon_name">edit-clear-symbolic</property>
                                 <property name="icon_size">1</property>
                               </object>
                             </child>
@@ -824,46 +824,6 @@ Otherwise the menu will only appear when calling "xfce4-popup-clipman-actions" (
             <property name="orientation">vertical</property>
             <property name="spacing">18</property>
             <child>
-              <object class="GtkBox" id="hbox-regex-info">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="border_width">0</property>
-                <property name="spacing">6</property>
-                <child>
-                  <object class="GtkImage" id="image-regex-info">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="stock">gtk-dialog-info</property>
-                    <property name="icon_size">6</property>
-                  </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="position">0</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkLabel" id="label-regex-info">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="label" translatable="yes">You can use the substitution parameters "\1", "\2" and so on in the commands. The parameter "\0" represents the complete text. If you don't know regular expressions, have a look at the documentation of Clipman that has an introdution for them.</property>
-                    <property name="wrap">True</property>
-                    <property name="xalign">0</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="GtkFrame" id="frame-action">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
@@ -947,7 +907,7 @@ Otherwise the menu will only appear when calling "xfce4-popup-clipman-actions" (
                                   <object class="GtkImage" id="image-action-pattern">
                                     <property name="visible">True</property>
                                     <property name="can_focus">False</property>
-                                    <property name="stock">gtk-edit</property>
+                                    <property name="icon_name">document-edit-symbolic</property>
                                     <property name="icon_size">1</property>
                                   </object>
                                 </child>
@@ -965,17 +925,17 @@ Otherwise the menu will only appear when calling "xfce4-popup-clipman-actions" (
                           </packing>
                         </child>
                         <child>
-                          <object class="GtkBox" id="hbox-pattern-info">
-                            <property name="visible">True</property>
+                          <object class="GtkInfoBar" id="regex-infobar">
                             <property name="can_focus">False</property>
-                            <property name="margin_left">12</property>
-                            <property name="spacing">6</property>
-                            <child>
-                              <object class="GtkImage" id="image-pattern-info">
-                                <property name="visible">True</property>
+                            <property name="revealed">False</property>
+                            <child internal-child="action_area">
+                              <object class="GtkButtonBox">
                                 <property name="can_focus">False</property>
-                                <property name="stock">gtk-dialog-info</property>
-                                <property name="icon_size">1</property>
+                                <property name="spacing">6</property>
+                                <property name="layout_style">end</property>
+                                <child>
+                                  <placeholder/>
+                                </child>
                               </object>
                               <packing>
                                 <property name="expand">False</property>
@@ -983,22 +943,47 @@ Otherwise the menu will only appear when calling "xfce4-popup-clipman-actions" (
                                 <property name="position">0</property>
                               </packing>
                             </child>
-                            <child>
-                              <object class="GtkLabel" id="label-pattern-info">
-                                <property name="visible">True</property>
+                            <child internal-child="content_area">
+                              <object class="GtkBox">
                                 <property name="can_focus">False</property>
-                                <property name="label" translatable="yes">The pattern is always anchored within the special characters ^$</property>
-                                <property name="xalign">0</property>
+                                <property name="spacing">16</property>
+                                <child>
+                                  <object class="GtkImage">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="icon_name">dialog-information-symbolic</property>
+                                    <property name="icon_size">3</property>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">True</property>
+                                    <property name="position">0</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkLabel" id="label-regex-info">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="label" translatable="yes">You can use the substitution parameters "\1", "\2" and so on in the commands. The parameter "\0" represents the complete text. The pattern is always anchored within the special characters ^$</property>
+                                    <property name="wrap">True</property>
+                                    <property name="xalign">0</property>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">True</property>
+                                    <property name="fill">True</property>
+                                    <property name="position">2</property>
+                                  </packing>
+                                </child>
                               </object>
                               <packing>
                                 <property name="expand">False</property>
-                                <property name="fill">True</property>
-                                <property name="position">1</property>
+                                <property name="fill">False</property>
+                                <property name="position">0</property>
                               </packing>
                             </child>
                           </object>
                           <packing>
-                            <property name="expand">False</property>
+                            <property name="expand">True</property>
                             <property name="fill">True</property>
                             <property name="position">1</property>
                           </packing>
@@ -1169,7 +1154,7 @@ Otherwise the menu will only appear when calling "xfce4-popup-clipman-actions" (
                                   <object class="GtkImage" id="image-add-command">
                                     <property name="visible">True</property>
                                     <property name="can_focus">False</property>
-                                    <property name="stock">gtk-add</property>
+                                    <property name="icon_name">list-add-symbolic</property>
                                     <property name="icon_size">1</property>
                                   </object>
                                 </child>
@@ -1190,7 +1175,7 @@ Otherwise the menu will only appear when calling "xfce4-popup-clipman-actions" (
                                   <object class="GtkImage" id="image-refresh-command">
                                     <property name="visible">True</property>
                                     <property name="can_focus">False</property>
-                                    <property name="stock">gtk-refresh</property>
+                                    <property name="icon_name">document-save-symbolic</property>
                                     <property name="icon_size">1</property>
                                   </object>
                                 </child>
@@ -1211,7 +1196,7 @@ Otherwise the menu will only appear when calling "xfce4-popup-clipman-actions" (
                                   <object class="GtkImage" id="image-delete-command">
                                     <property name="visible">True</property>
                                     <property name="can_focus">False</property>
-                                    <property name="stock">gtk-delete</property>
+                                    <property name="icon_name">edit-delete-symbolic</property>
                                     <property name="icon_size">1</property>
                                   </object>
                                 </child>
diff --git a/panel-plugin/xfce4-clipman-settings.c b/panel-plugin/xfce4-clipman-settings.c
index 135f7ca..cdaebfc 100644
--- a/panel-plugin/xfce4-clipman-settings.c
+++ b/panel-plugin/xfce4-clipman-settings.c
@@ -56,6 +56,12 @@ static void             setup_test_regex_dialog         ();
 static void             cb_test_regex                   (GtkButton *button);
 static void             cb_test_regex_changed           (GtkWidget *widget);
 static gboolean         cb_test_regex_changed_timeout   ();
+static gboolean         cb_regex_focus_in_event         (GtkWidget *widget,
+                                                         GdkEvent  *event,
+                                                         gpointer   user_data);
+static gboolean         cb_regex_focus_out_event        (GtkWidget *widget,
+                                                         GdkEvent  *event,
+                                                         gpointer   user_data);
 static void             update_test_regex_textview_tags ();
 static void             cb_set_action_dialog_button_ok  (GtkWidget *widget);
 
@@ -157,6 +163,10 @@ prop_dialog_run (void)
                           G_CALLBACK (cb_set_action_dialog_button_ok), NULL);
   g_signal_connect_after (gtk_builder_get_object (builder, "regex"), "changed",
                           G_CALLBACK (cb_set_action_dialog_button_ok), NULL);
+  g_signal_connect_after (gtk_builder_get_object (builder, "regex"), "focus-in-event",
+                          G_CALLBACK (cb_regex_focus_in_event), gtk_builder_get_object (builder, "regex-infobar"));
+  g_signal_connect_after (gtk_builder_get_object (builder, "regex"), "focus-out-event",
+                          G_CALLBACK (cb_regex_focus_out_event), gtk_builder_get_object (builder, "regex-infobar"));
   g_signal_connect_after (gtk_builder_get_object (builder, "button-add-command"), "clicked",
                           G_CALLBACK (cb_set_action_dialog_button_ok), NULL);
   g_signal_connect_after (gtk_builder_get_object (builder, "button-delete-command"), "clicked",
@@ -765,6 +775,32 @@ cb_test_regex_changed_timeout (void)
   return FALSE;
 }
 
+static gboolean
+cb_regex_focus_in_event (GtkWidget *widget,
+                         GdkEvent  *event,
+                         gpointer   user_data)
+{
+  GtkWidget *infobar = GTK_WIDGET (user_data);
+
+  gtk_widget_show (infobar);
+  gtk_info_bar_set_revealed (GTK_INFO_BAR (infobar), TRUE);
+
+  return FALSE;
+}
+
+static gboolean
+cb_regex_focus_out_event (GtkWidget *widget,
+                          GdkEvent  *event,
+                          gpointer   user_data)
+{
+  GtkWidget *infobar = GTK_WIDGET (user_data);
+
+  gtk_info_bar_set_revealed (GTK_INFO_BAR (infobar), FALSE);
+  gtk_widget_hide (infobar);
+
+  return FALSE;
+}
+
 static void
 update_test_regex_textview_tags (void)
 {

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


More information about the Xfce4-commits mailing list