[glade/glade-3-14] Revert "Fixed bug in GtkButton custom editor properties sensitivity"
- From: Juan Pablo Ugarte <jpu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade/glade-3-14] Revert "Fixed bug in GtkButton custom editor properties sensitivity"
- Date: Fri, 2 Nov 2012 00:29:11 +0000 (UTC)
commit 556c6a76c22be0ff4588c4d4873777351448168e
Author: Juan Pablo Ugarte <juanpablougarte gmail com>
Date: Thu Nov 1 21:10:46 2012 -0300
Revert "Fixed bug in GtkButton custom editor properties sensitivity"
This reverts commit 1cf2c6beb2ba328d5a006ee7a6ddd1c800e324ec.
plugins/gtk+/glade-gtk-activatable.c | 87 +++++++++++++++------------------
1 files changed, 40 insertions(+), 47 deletions(-)
---
diff --git a/plugins/gtk+/glade-gtk-activatable.c b/plugins/gtk+/glade-gtk-activatable.c
index 7cf9bf5..31d538f 100644
--- a/plugins/gtk+/glade-gtk-activatable.c
+++ b/plugins/gtk+/glade-gtk-activatable.c
@@ -26,65 +26,58 @@
#include "glade-gtk-activatable.h"
/* ----------------------------- GtkActivatable ------------------------------ */
-static void
-update_use_action_appearance (GladeWidget *gwidget,
- gboolean related_action,
- gboolean use_appearance)
-{
- gboolean sensitivity;
- gchar *msg;
-
- if (use_appearance)
- {
- sensitivity = FALSE;
- msg = ACTION_APPEARANCE_MSG;
- }
- else
- {
- sensitivity = TRUE;
- msg = NULL;
- }
-
- glade_widget_property_set_sensitive (gwidget, "label", sensitivity, msg);
- glade_widget_property_set_sensitive (gwidget, "use-underline", sensitivity, msg);
- glade_widget_property_set_sensitive (gwidget, "stock", sensitivity, msg);
- //glade_widget_property_set_sensitive (gwidget, "use-stock", sensitivity, msg);
- glade_widget_property_set_sensitive (gwidget, "image", sensitivity, msg);
- glade_widget_property_set_sensitive (gwidget, "image-position", sensitivity, msg);
- glade_widget_property_set_sensitive (gwidget, "custom-child", sensitivity, msg);
- glade_widget_property_set_sensitive (gwidget, "stock-id", sensitivity, msg);
- glade_widget_property_set_sensitive (gwidget, "label-widget", sensitivity, msg);
- glade_widget_property_set_sensitive (gwidget, "icon-name", sensitivity, msg);
- glade_widget_property_set_sensitive (gwidget, "icon-widget", sensitivity, msg);
- glade_widget_property_set_sensitive (gwidget, "icon", sensitivity, msg);
-
- if (related_action)
- {
- glade_widget_property_set_sensitive (gwidget, "visible", sensitivity, msg);
- glade_widget_property_set_sensitive (gwidget, "sensitive", sensitivity, msg);
- glade_widget_property_set_sensitive (gwidget, "accel-group", sensitivity, msg);
- glade_widget_property_set_sensitive (gwidget, "use-action-appearance",
- !sensitivity, sensitivity ? msg : NULL);
- }
-}
-
void
glade_gtk_activatable_evaluate_property_sensitivity (GObject *object,
const gchar *id,
const GValue *value)
{
GladeWidget *gwidget = glade_widget_get_from_gobject (object);
+ gboolean sensitivity;
+ gchar *msg;
if (!strcmp (id, "related-action"))
{
- update_use_action_appearance (gwidget, TRUE,
- g_value_get_object (value) != NULL);
+ GtkAction *action = g_value_get_object (value);
+
+ if (action)
+ {
+ sensitivity = FALSE;
+ msg = ACTION_APPEARANCE_MSG;
+ }
+ else
+ {
+ sensitivity = TRUE;
+ msg = NULL;
+ }
+
+ glade_widget_property_set_sensitive (gwidget, "visible", sensitivity, msg);
+ glade_widget_property_set_sensitive (gwidget, "sensitive", sensitivity, msg);
+ glade_widget_property_set_sensitive (gwidget, "accel-group", sensitivity, msg);
+ glade_widget_property_set_sensitive (gwidget, "use-action-appearance", !sensitivity, sensitivity ? msg : NULL);
}
else if (!strcmp (id, "use-action-appearance"))
{
- GtkAction *action = gtk_activatable_get_related_action (GTK_ACTIVATABLE (object));
- gboolean use_appearance = g_value_get_boolean (value);
+ if (g_value_get_boolean (value))
+ {
+ sensitivity = FALSE;
+ msg = ACTION_APPEARANCE_MSG;
+ }
+ else
+ {
+ sensitivity = TRUE;
+ msg = NULL;
+ }
- update_use_action_appearance (gwidget, FALSE, action && use_appearance);
+ glade_widget_property_set_sensitive (gwidget, "label", sensitivity, msg);
+ glade_widget_property_set_sensitive (gwidget, "use-underline", sensitivity, msg);
+ glade_widget_property_set_sensitive (gwidget, "stock", sensitivity, msg);
+ //glade_widget_property_set_sensitive (gwidget, "use-stock", sensitivity, msg);
+ glade_widget_property_set_sensitive (gwidget, "image", sensitivity, msg);
+ glade_widget_property_set_sensitive (gwidget, "custom-child", sensitivity, msg);
+ glade_widget_property_set_sensitive (gwidget, "stock-id", sensitivity, msg);
+ glade_widget_property_set_sensitive (gwidget, "label-widget", sensitivity, msg);
+ glade_widget_property_set_sensitive (gwidget, "icon-name", sensitivity, msg);
+ glade_widget_property_set_sensitive (gwidget, "icon-widget", sensitivity, msg);
+ glade_widget_property_set_sensitive (gwidget, "icon", sensitivity, msg);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]