aboutsummaryrefslogtreecommitdiffstats
path: root/lib/egg/egg-action.c
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-08-12 03:26:24 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-08-12 03:26:24 +0800
commit1ae9e642b53c3668c4b74e0b043ee6cf861a2b11 (patch)
treee1b69cae65c218df1894dd800430f7769fb8fcdc /lib/egg/egg-action.c
parentf36ca5abdf24b9562532e8743e6069dcb85866f5 (diff)
downloadgsoc2013-epiphany-1ae9e642b53c3668c4b74e0b043ee6cf861a2b11.tar
gsoc2013-epiphany-1ae9e642b53c3668c4b74e0b043ee6cf861a2b11.tar.gz
gsoc2013-epiphany-1ae9e642b53c3668c4b74e0b043ee6cf861a2b11.tar.bz2
gsoc2013-epiphany-1ae9e642b53c3668c4b74e0b043ee6cf861a2b11.tar.lz
gsoc2013-epiphany-1ae9e642b53c3668c4b74e0b043ee6cf861a2b11.tar.xz
gsoc2013-epiphany-1ae9e642b53c3668c4b74e0b043ee6cf861a2b11.tar.zst
gsoc2013-epiphany-1ae9e642b53c3668c4b74e0b043ee6cf861a2b11.zip
Respect priority text preference. Ported from gtk.
2003-08-11 Marco Pesenti Gritti <marco@it.gnome.org> * lib/egg/egg-action.c: (egg_action_class_init), (egg_action_init), (egg_action_set_property), (egg_action_get_property), (egg_action_sync_important), (connect_proxy): * lib/egg/egg-action.h: * lib/egg/eggtoolbar.c: (toolbar_item_is_homogeneous), (egg_toolbar_size_request), (get_item_size): * lib/egg/eggtoolbutton.c: (egg_tool_button_property_notify), (egg_tool_button_class_init), (egg_tool_button_construct_contents): * lib/egg/eggtoolitem.c: (egg_tool_item_class_init), (egg_tool_item_get_is_important), (egg_tool_item_set_is_important), (egg_tool_item_set_property), (egg_tool_item_get_property): * lib/egg/eggtoolitem.h: * src/ephy-window.c: (setup_window): * src/toolbar.c: (toolbar_setup_actions): Respect priority text preference. Ported from gtk.
Diffstat (limited to 'lib/egg/egg-action.c')
-rw-r--r--lib/egg/egg-action.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/egg/egg-action.c b/lib/egg/egg-action.c
index 054159f45..1fbf44b5b 100644
--- a/lib/egg/egg-action.c
+++ b/lib/egg/egg-action.c
@@ -26,6 +26,7 @@ enum {
PROP_STOCK_ID,
PROP_SENSITIVE,
PROP_VISIBLE,
+ PROP_IMPORTANT
};
static void egg_action_init (EggAction *action);
@@ -152,6 +153,14 @@ egg_action_class_init (EggActionClass *class)
G_PARAM_READWRITE));
g_object_class_install_property (object_class,
+ PROP_IMPORTANT,
+ g_param_spec_boolean ("important",
+ _("Important"),
+ _("Important."),
+ FALSE,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class,
PROP_VISIBLE,
g_param_spec_boolean ("visible",
_("Visible"),
@@ -182,6 +191,7 @@ egg_action_init (EggAction *action)
action->sensitive = TRUE;
action->visible = TRUE;
+ action->important = FALSE;
action->label_set = FALSE;
action->short_label_set = FALSE;
@@ -296,6 +306,10 @@ egg_action_set_property (GObject *object,
case PROP_VISIBLE:
action->visible = g_value_get_boolean (value);
break;
+ case PROP_IMPORTANT:
+ action->important = g_value_get_boolean (value);
+ g_object_notify(object, "important");
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -335,6 +349,9 @@ egg_action_get_property (GObject *object,
case PROP_VISIBLE:
g_value_set_boolean (value, action->visible);
break;
+ case PROP_IMPORTANT:
+ g_value_set_boolean (value, action->important);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -384,6 +401,12 @@ egg_action_sync_property (EggAction *action, GParamSpec *pspec,
}
static void
+egg_action_sync_important (EggAction *action, GParamSpec *pspec, GtkWidget *proxy)
+{
+ egg_tool_item_set_is_important (EGG_TOOL_ITEM (proxy), action->important);
+}
+
+static void
egg_action_sync_tooltip (EggAction *action, GParamSpec *pspec, GtkWidget *proxy)
{
if (action->tooltip != NULL)
@@ -550,6 +573,10 @@ connect_proxy (EggAction *action, GtkWidget *proxy)
G_CALLBACK (egg_action_sync_short_label),
proxy, 0);
+ egg_action_sync_important (action, NULL, proxy);
+ g_signal_connect_object (action, "notify::important",
+ G_CALLBACK (egg_action_sync_important), proxy, 0);
+
g_object_set (G_OBJECT (proxy), "stock_id", action->stock_id, NULL);
g_signal_connect_object (action, "notify::stock_id",
G_CALLBACK (egg_action_sync_property), proxy, 0);