[Xfce4-commits] [panel-plugins/xfce4-systemload-plugin] 01/02: Readd callback for GtkToggleButton, and rename the original one taking a GtkSwitch to switch_cb
noreply at xfce.org
noreply at xfce.org
Sun Jun 5 16:05:56 CEST 2016
This is an automated email from the git hooks/post-receive script.
landry pushed a commit to branch master
in repository panel-plugins/xfce4-systemload-plugin.
commit 9ecd697394aa38a1ace013f11d954871d8277133
Author: Landry Breuil <landry at xfce.org>
Date: Sun Jun 5 16:03:39 2016 +0200
Readd callback for GtkToggleButton, and rename the original one taking a GtkSwitch to switch_cb
---
panel-plugin/systemload.c | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/panel-plugin/systemload.c b/panel-plugin/systemload.c
index c852482..9f6462f 100644
--- a/panel-plugin/systemload.c
+++ b/panel-plugin/systemload.c
@@ -685,7 +685,25 @@ entry_changed_cb(GtkEntry *entry, t_global_monitor *global)
}
static void
-check_button_cb(GtkSwitch *check_button, gboolean state, t_global_monitor *global)
+check_button_cb(GtkToggleButton *check_button, t_global_monitor *global)
+{
+ gboolean oldstate;
+ gboolean* boolvar;
+ gpointer sensitive_widget;
+ boolvar = (gboolean*)g_object_get_data(G_OBJECT(check_button), "boolvar");
+ sensitive_widget = g_object_get_data(G_OBJECT(check_button), "sensitive_widget");
+ oldstate = *boolvar;
+ *boolvar = gtk_toggle_button_get_active(check_button);
+ if (sensitive_widget)
+ gtk_widget_set_sensitive(GTK_WIDGET(sensitive_widget), *boolvar);
+ if (boolvar == &(global->command.enabled)) {
+ gtk_widget_set_visible(global->menu_item, *boolvar);
+ } else if (oldstate != *boolvar)
+ setup_monitor(global);
+}
+
+static void
+switch_cb(GtkSwitch *check_button, gboolean state, t_global_monitor *global)
{
gboolean oldstate;
gboolean* boolvar;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list