[Xfce4-commits] [panel-plugins/xfce4-systemload-plugin] 01/01: Pack options in a single line and revealer
noreply at xfce.org
noreply at xfce.org
Sat Dec 23 23:54:25 CET 2017
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-systemload-plugin.
commit dd5397b3b544e391164e80e5559c65437e9114e2
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date: Sat Dec 23 23:40:43 2017 +0100
Pack options in a single line and revealer
---
panel-plugin/systemload.c | 49 ++++++++++++++++++++++-------------------------
1 file changed, 23 insertions(+), 26 deletions(-)
diff --git a/panel-plugin/systemload.c b/panel-plugin/systemload.c
index 6376250..81dde2e 100644
--- a/panel-plugin/systemload.c
+++ b/panel-plugin/systemload.c
@@ -700,7 +700,7 @@ switch_cb(GtkSwitch *check_button, gboolean state, t_global_monitor *global)
*boolvar = state;
gtk_switch_set_state (check_button, state);
if (sensitive_widget)
- gtk_widget_set_sensitive(GTK_WIDGET(sensitive_widget), *boolvar);
+ gtk_revealer_set_reveal_child (GTK_REVEALER (sensitive_widget), *boolvar);
if (oldstate != *boolvar)
setup_monitor(global);
}
@@ -768,7 +768,7 @@ static void new_monitor_setting(t_global_monitor *global, GtkGrid *grid, int pos
const gchar *title, gboolean *boolvar, GdkRGBA* colorvar,
gboolean * use_label, gchar **labeltext)
{
- GtkWidget *subgrid, *sw, *label, *button, *entry;
+ GtkWidget *revealer, *subgrid, *sw, *label, *button, *entry;
gchar *markup;
sw = gtk_switch_new();
@@ -793,43 +793,40 @@ static void new_monitor_setting(t_global_monitor *global, GtkGrid *grid, int pos
if (colorvar == NULL)
return;
+ revealer = gtk_revealer_new ();
subgrid = gtk_grid_new ();
- g_object_set_data (G_OBJECT(sw), "sensitive_widget", subgrid);
- gtk_grid_attach(GTK_GRID(grid), subgrid, 0, position + 1, 2, 1);
+ gtk_container_add (GTK_CONTAINER (revealer), subgrid);
+ gtk_revealer_set_reveal_child (GTK_REVEALER (revealer), TRUE);
+ g_object_set_data (G_OBJECT(sw), "sensitive_widget", revealer);
+ gtk_grid_attach(GTK_GRID(grid), revealer, 0, position + 1, 2, 1);
gtk_grid_set_column_spacing (GTK_GRID(subgrid), 12);
gtk_grid_set_row_spacing (GTK_GRID(subgrid), 6);
- button = gtk_color_button_new_with_rgba(colorvar);
- gtk_widget_set_halign(button, GTK_ALIGN_START);
- g_object_set_data(G_OBJECT(button), "colorvar", colorvar);
- g_signal_connect(G_OBJECT(button), "color-set",
- G_CALLBACK (color_set_cb), global);
-
- label = gtk_label_new_with_mnemonic (_("Color:"));
- gtk_widget_set_halign(label, GTK_ALIGN_START);
- gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
+ label = gtk_label_new_with_mnemonic (_("Options:"));
+ gtk_widget_set_halign (label, GTK_ALIGN_START);
+ gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
gtk_widget_set_margin_start (label, 18);
- gtk_label_set_mnemonic_widget(GTK_LABEL(label), button);
-
- gtk_grid_attach(GTK_GRID(subgrid), label, 0, 1, 1, 1);
- gtk_grid_attach(GTK_GRID(subgrid), button, 1, 1, 1, 1);
+ gtk_label_set_mnemonic_widget (GTK_LABEL (label), button);
+ gtk_grid_attach (GTK_GRID(subgrid), label, 0, 0, 1, 1);
+ /* Entry for the optional monitor label */
entry = gtk_entry_new ();
gtk_widget_set_hexpand (entry, TRUE);
+ gtk_widget_set_margin_start (entry, 12);
g_object_set_data (G_OBJECT(entry), "charvar", labeltext);
g_object_set_data (G_OBJECT(entry), "boolvar", use_label);
gtk_entry_set_text (GTK_ENTRY(entry), *labeltext);
g_signal_connect (G_OBJECT(entry), "changed",
- G_CALLBACK(entry_changed_cb), global);
-
- label = gtk_label_new_with_mnemonic (_("Text:"));
- gtk_widget_set_halign (label, GTK_ALIGN_START);
- gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
- gtk_widget_set_margin_start (label, 18);
- gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry);
-
- gtk_grid_attach(GTK_GRID(subgrid), label, 0, 0, 1, 1);
+ G_CALLBACK(entry_changed_cb), global);
gtk_grid_attach(GTK_GRID(subgrid), entry, 1, 0, 1, 1);
+
+ /* Colorbutton to set the progressbar color */
+ button = gtk_color_button_new_with_rgba(colorvar);
+ gtk_widget_set_halign(button, GTK_ALIGN_START);
+ g_object_set_data(G_OBJECT(button), "colorvar", colorvar);
+ g_signal_connect(G_OBJECT(button), "color-set",
+ G_CALLBACK (color_set_cb), global);
+ gtk_grid_attach(GTK_GRID(subgrid), button, 2, 0, 1, 1);
}
static void
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list