diff options
author | Marco Pesenti Gritti <marco@it.gnome.org> | 2003-08-12 03:26:24 +0800 |
---|---|---|
committer | Marco Pesenti Gritti <mpeseng@src.gnome.org> | 2003-08-12 03:26:24 +0800 |
commit | 1ae9e642b53c3668c4b74e0b043ee6cf861a2b11 (patch) | |
tree | e1b69cae65c218df1894dd800430f7769fb8fcdc /lib/egg/eggtoolitem.c | |
parent | f36ca5abdf24b9562532e8743e6069dcb85866f5 (diff) | |
download | gsoc2013-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/eggtoolitem.c')
-rw-r--r-- | lib/egg/eggtoolitem.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/lib/egg/eggtoolitem.c b/lib/egg/eggtoolitem.c index b66376d36..85b32e7c6 100644 --- a/lib/egg/eggtoolitem.c +++ b/lib/egg/eggtoolitem.c @@ -42,6 +42,7 @@ enum { PROP_0, PROP_VISIBLE_HORIZONTAL, PROP_VISIBLE_VERTICAL, + PROP_IS_IMPORTANT }; static void egg_tool_item_init (EggToolItem *toolitem); @@ -159,6 +160,15 @@ egg_tool_item_class_init (EggToolItemClass *klass) _("Whether the toolbar item is visible when the toolbar is in a vertical orientation."), TRUE, G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, + PROP_IS_IMPORTANT, + g_param_spec_boolean ("is_important", + _("Is important"), + _("Whether the toolbar item is considered important. When TRUE, toolbar buttons show text in GTK_TOOLBAR_BOTH_HORIZ mode"), + FALSE, + G_PARAM_READWRITE)); + toolitem_signals[CREATE_MENU_PROXY] = g_signal_new ("create_menu_proxy", G_OBJECT_CLASS_TYPE (klass), @@ -222,6 +232,31 @@ egg_tool_item_parent_set (GtkWidget *toolitem, egg_tool_item_toolbar_reconfigured (EGG_TOOL_ITEM (toolitem)); } +gboolean +egg_tool_item_get_is_important (EggToolItem *tool_item) +{ + g_return_val_if_fail (EGG_IS_TOOL_ITEM (tool_item), FALSE); + + return tool_item->is_important; +} + +void +egg_tool_item_set_is_important (EggToolItem *tool_item, gboolean is_important) +{ + g_return_if_fail (EGG_IS_TOOL_ITEM (tool_item)); + + is_important = is_important != FALSE; + + if (is_important != tool_item->is_important) + { + tool_item->is_important = is_important; + + gtk_widget_queue_resize (GTK_WIDGET (tool_item)); + + g_object_notify (G_OBJECT (tool_item), "is_important"); + } +} + static void egg_tool_item_set_property (GObject *object, guint prop_id, @@ -238,6 +273,9 @@ egg_tool_item_set_property (GObject *object, case PROP_VISIBLE_VERTICAL: egg_tool_item_set_visible_horizontal (toolitem, g_value_get_boolean (value)); break; + case PROP_IS_IMPORTANT: + egg_tool_item_set_is_important (toolitem, g_value_get_boolean (value)); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); } @@ -259,6 +297,9 @@ egg_tool_item_get_property (GObject *object, case PROP_VISIBLE_VERTICAL: g_value_set_boolean (value, toolitem->visible_vertical); break; + case PROP_IS_IMPORTANT: + g_value_set_boolean (value, toolitem->is_important); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); } |