aboutsummaryrefslogtreecommitdiffstats
path: root/lib/egg/eggtoolbutton.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/eggtoolbutton.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/eggtoolbutton.c')
-rw-r--r--lib/egg/eggtoolbutton.c28
1 files changed, 25 insertions, 3 deletions
diff --git a/lib/egg/eggtoolbutton.c b/lib/egg/eggtoolbutton.c
index 4b786db3c..293e65ee9 100644
--- a/lib/egg/eggtoolbutton.c
+++ b/lib/egg/eggtoolbutton.c
@@ -107,6 +107,14 @@ egg_tool_button_get_type (void)
}
static void
+egg_tool_button_property_notify (GObject *object,
+ GParamSpec *pspec)
+{
+ if (strcmp (pspec->name, "is_important"))
+ egg_tool_button_construct_contents (EGG_TOOL_ITEM (object));
+}
+
+static void
egg_tool_button_class_init (EggToolButtonClass *klass)
{
GObjectClass *object_class;
@@ -122,6 +130,7 @@ egg_tool_button_class_init (EggToolButtonClass *klass)
object_class->set_property = egg_tool_button_set_property;
object_class->get_property = egg_tool_button_get_property;
object_class->finalize = egg_tool_button_finalize;
+ object_class->notify = egg_tool_button_property_notify;
widget_class->size_request = egg_tool_button_size_request;
widget_class->size_allocate = egg_tool_button_size_allocate;
@@ -324,7 +333,19 @@ egg_tool_button_construct_contents (EggToolItem *tool_item)
if (style != GTK_TOOLBAR_TEXT)
need_icon = TRUE;
- if (style != GTK_TOOLBAR_ICONS)
+ if (style != GTK_TOOLBAR_ICONS && style != GTK_TOOLBAR_BOTH_HORIZ)
+ need_label = TRUE;
+
+ if (style == GTK_TOOLBAR_BOTH_HORIZ &&
+ (EGG_TOOL_ITEM (button)->is_important ||
+ egg_tool_item_get_orientation (EGG_TOOL_ITEM (button)) == GTK_ORIENTATION_VERTICAL))
+ {
+ need_label = TRUE;
+ }
+
+ if (style != GTK_TOOLBAR_ICONS &&
+ ((style != GTK_TOOLBAR_BOTH_HORIZ ||
+ EGG_TOOL_ITEM (button)->is_important)))
need_label = TRUE;
if (need_label)
@@ -420,8 +441,9 @@ egg_tool_button_construct_contents (EggToolItem *tool_item)
case GTK_TOOLBAR_BOTH_HORIZ:
box = gtk_hbox_new (FALSE, 0);
- gtk_box_pack_start (GTK_BOX (box), icon, FALSE, TRUE, 0);
- gtk_box_pack_start (GTK_BOX (box), label, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (box), icon, label? FALSE : TRUE, TRUE, 0);
+ if (label)
+ gtk_box_pack_start (GTK_BOX (box), label, TRUE, TRUE, 0);
gtk_container_add (GTK_CONTAINER (button->button), box);
break;