[Xfce4-commits] [panel-plugins/xfce4-genmon-plugin] 01/01: Preferences: Simplify and standardize spacing. Rearrange UI code to logical order. Add dialog icon.

noreply at xfce.org noreply at xfce.org
Wed Sep 5 03:39:50 CEST 2018


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

T   o   Z       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-genmon-plugin.

commit 251c4101691ab5b888527617ad865336f3aba0d9
Author: ToZ <tony.paulic at gmail.com>
Date:   Tue Sep 4 21:34:25 2018 -0400

    Preferences: Simplify and standardize spacing. Rearrange
     UI code to logical order. Add dialog icon.
---
 panel-plugin/config_gui.c | 61 ++++++++++++++++++++++-------------------------
 panel-plugin/main.c       | 11 +++++----
 2 files changed, 35 insertions(+), 37 deletions(-)

diff --git a/panel-plugin/config_gui.c b/panel-plugin/config_gui.c
index a256f27..a9f5bf8 100644
--- a/panel-plugin/config_gui.c
+++ b/panel-plugin/config_gui.c
@@ -68,17 +68,16 @@ int genmon_CreateConfigGUI (GtkWidget *vbox1,
     GtkWidget      *hbox4;
 
     table1 = gtk_grid_new ();
-    gtk_grid_set_column_spacing(GTK_GRID (table1), 2);
-    gtk_grid_set_row_spacing(GTK_GRID (table1), 2);
+    gtk_grid_set_column_spacing(GTK_GRID (table1), 12);
+    gtk_grid_set_row_spacing(GTK_GRID (table1), 6);
     gtk_widget_show (table1);
     gtk_box_pack_start (GTK_BOX (vbox1), table1, FALSE, TRUE, 0);
 
     label1 = gtk_label_new (_("Command"));
     gtk_widget_show (label1);
     gtk_grid_attach (GTK_GRID (table1), label1, 0, 0, 1, 1);
-        //(GtkAttachOptions) (GTK_FILL),
-        //(GtkAttachOptions) (0), 0, 0);
     gtk_label_set_justify (GTK_LABEL (label1), GTK_JUSTIFY_LEFT);
+    gtk_label_set_xalign (GTK_LABEL (label1), 0.0f);
     gtk_widget_set_valign (label1, GTK_ALIGN_CENTER);
 
     wTF_Cmd = gtk_entry_new ();
@@ -87,29 +86,6 @@ int genmon_CreateConfigGUI (GtkWidget *vbox1,
     gtk_widget_set_tooltip_text (wTF_Cmd, "Input the shell command to spawn, then press <Enter>");
     gtk_entry_set_max_length (GTK_ENTRY (wTF_Cmd), 128);
 
-    eventbox1 = gtk_event_box_new ();
-    gtk_widget_show (eventbox1);
-    gtk_grid_attach (GTK_GRID (table1), eventbox1, 1, 2, 1, 1);
-    gtk_widget_set_valign(GTK_WIDGET(eventbox1), GTK_ALIGN_CENTER);
-    gtk_widget_set_halign(GTK_WIDGET(eventbox1), GTK_ALIGN_CENTER);
-    gtk_widget_set_vexpand(GTK_WIDGET(eventbox1), TRUE);
-    gtk_widget_set_hexpand(GTK_WIDGET(eventbox1), TRUE);
-
-    wSc_Period_adj = gtk_adjustment_new (15, .25, 60*60*24, .25, 1, 0);
-    wSc_Period = gtk_spin_button_new (GTK_ADJUSTMENT (wSc_Period_adj), .25, 2);
-    gtk_widget_show (wSc_Period);
-    gtk_container_add (GTK_CONTAINER (eventbox1), wSc_Period);
-    gtk_widget_set_tooltip_text (wSc_Period, "Interval between 2 consecutive spawns");
-    gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (wSc_Period), TRUE);
-
-    label2 = gtk_label_new (_("Period (s) "));
-    gtk_widget_show (label2);
-    gtk_grid_attach (GTK_GRID (table1), label2, 0, 2, 1, 1);
-        //(GtkAttachOptions) (GTK_FILL),
-        //(GtkAttachOptions) (0), 0, 0);
-    gtk_label_set_justify (GTK_LABEL (label2), GTK_JUSTIFY_LEFT);
-    gtk_widget_set_valign (label2, GTK_ALIGN_CENTER);
-
     wTB_Title = gtk_check_button_new_with_mnemonic (_("Label"));
     gtk_widget_show (wTB_Title);
     gtk_grid_attach (GTK_GRID (table1), wTB_Title, 0, 1, 1, 1);
@@ -123,19 +99,38 @@ int genmon_CreateConfigGUI (GtkWidget *vbox1,
     gtk_entry_set_max_length (GTK_ENTRY (wTF_Title), 16);
     gtk_entry_set_text (GTK_ENTRY (wTF_Title), _("(genmon)"));
 
+    label2 = gtk_label_new (_("Period (s) "));
+    gtk_widget_show (label2);
+    gtk_grid_attach (GTK_GRID (table1), label2, 0, 2, 1, 1);
+    gtk_label_set_justify (GTK_LABEL (label2), GTK_JUSTIFY_LEFT);
+    gtk_label_set_xalign (GTK_LABEL (label2), 0.0f);
+    gtk_widget_set_valign (label2, GTK_ALIGN_CENTER);
+
+    eventbox1 = gtk_event_box_new ();
+    gtk_widget_show (eventbox1);
+    gtk_grid_attach (GTK_GRID (table1), eventbox1, 1, 2, 1, 1);
+    gtk_widget_set_valign(GTK_WIDGET(eventbox1), GTK_ALIGN_CENTER);
+    gtk_widget_set_halign(GTK_WIDGET(eventbox1), GTK_ALIGN_START);
+    gtk_widget_set_hexpand(GTK_WIDGET(eventbox1), TRUE);
+
+    wSc_Period_adj = gtk_adjustment_new (15, .25, 60*60*24, .25, 1, 0);
+    wSc_Period = gtk_spin_button_new (GTK_ADJUSTMENT (wSc_Period_adj), .25, 2);
+    gtk_widget_show (wSc_Period);
+    gtk_container_add (GTK_CONTAINER (eventbox1), wSc_Period);
+    gtk_widget_set_tooltip_text (wSc_Period, "Interval between 2 consecutive spawns");
+    gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (wSc_Period), TRUE);
+
     hseparator10 = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
+    gtk_widget_set_margin_top (GTK_WIDGET (hseparator10), 6);
+    gtk_widget_set_margin_bottom (GTK_WIDGET (hseparator10), 6);
     gtk_widget_show (hseparator10);
-    gtk_box_pack_start (GTK_BOX (vbox1), hseparator10, FALSE, FALSE, 0);
+    gtk_grid_attach (GTK_GRID (table1), hseparator10, 0, 3, 2, 1);
 
     wPB_Font = gtk_button_new_with_label (_("Select the display font..."));
     gtk_widget_show (wPB_Font);
-    gtk_box_pack_start (GTK_BOX (vbox1), wPB_Font, TRUE, TRUE, 0);
+    gtk_grid_attach (GTK_GRID (table1), wPB_Font, 0, 4, 2, 1);
     gtk_widget_set_tooltip_text (wPB_Font, "Press to change font...");
             
-    hbox4 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
-    gtk_widget_show (hbox4);
-    gtk_container_add (GTK_CONTAINER (vbox1), hbox4);
-    
     if (p_poGUI) {
         COPYVAL (p_poGUI, wTF_Cmd);
         COPYVAL (p_poGUI, wTB_Title);
diff --git a/panel-plugin/main.c b/panel-plugin/main.c
index 8af795e..c70b206 100644
--- a/panel-plugin/main.c
+++ b/panel-plugin/main.c
@@ -852,19 +852,22 @@ static void genmon_create_options (XfcePanelPlugin *plugin,
 
     xfce_panel_plugin_block_menu (plugin);
 
-    dlg = xfce_titled_dialog_new_with_buttons (_("Configuration"),
+    dlg = xfce_titled_dialog_new_with_buttons (_("Generic Monitor"),
         GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (plugin))),
         GTK_DIALOG_DESTROY_WITH_PARENT,
         "gtk-close", GTK_RESPONSE_OK,
         NULL);
 
+    gtk_window_set_resizable (GTK_WINDOW (dlg), FALSE);
+    gtk_window_set_icon_name (GTK_WINDOW (dlg), "utilities-system-monitor");
+
     g_signal_connect (dlg, "response", G_CALLBACK (genmon_dialog_response),
         poPlugin);
 
-    xfce_titled_dialog_set_subtitle (XFCE_TITLED_DIALOG (dlg), _("Generic Monitor"));
+    xfce_titled_dialog_set_subtitle (XFCE_TITLED_DIALOG (dlg), _("Configuration"));
 
-    vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, BORDER + 6);
-    gtk_container_set_border_width (GTK_CONTAINER (vbox), BORDER + 4);
+    vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 6);
+    gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
     gtk_widget_show(vbox);
     gtk_box_pack_start(GTK_BOX (gtk_dialog_get_content_area(GTK_DIALOG(dlg))), vbox, 
         TRUE, TRUE, 0);

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


More information about the Xfce4-commits mailing list