diff options
author | Marco Pesenti Gritti <marco@it.gnome.org> | 2003-04-07 04:07:14 +0800 |
---|---|---|
committer | Marco Pesenti Gritti <mpeseng@src.gnome.org> | 2003-04-07 04:07:14 +0800 |
commit | 30177ef207092d95ebbc2c835d52262618436c90 (patch) | |
tree | 0ec29d272a9850cdae573a9220eef6077af9facb /lib/egg/eggtoolitem.c | |
parent | 856bc05445cae1c838b1e1cd7a30f3ebdbe52e01 (diff) | |
download | gsoc2013-epiphany-30177ef207092d95ebbc2c835d52262618436c90.tar gsoc2013-epiphany-30177ef207092d95ebbc2c835d52262618436c90.tar.gz gsoc2013-epiphany-30177ef207092d95ebbc2c835d52262618436c90.tar.bz2 gsoc2013-epiphany-30177ef207092d95ebbc2c835d52262618436c90.tar.lz gsoc2013-epiphany-30177ef207092d95ebbc2c835d52262618436c90.tar.xz gsoc2013-epiphany-30177ef207092d95ebbc2c835d52262618436c90.tar.zst gsoc2013-epiphany-30177ef207092d95ebbc2c835d52262618436c90.zip |
Add a separator item to the editor.
2003-04-06 Marco Pesenti Gritti <marco@it.gnome.org>
* libegg/toolbareditor/egg-editable-toolbar.c: (get_dest_targets),
(editor_create_item), (update_editor_sheet):
Add a separator item to the editor.
Diffstat (limited to 'lib/egg/eggtoolitem.c')
-rw-r--r-- | lib/egg/eggtoolitem.c | 80 |
1 files changed, 46 insertions, 34 deletions
diff --git a/lib/egg/eggtoolitem.c b/lib/egg/eggtoolitem.c index 8f93ac369..1921c062d 100644 --- a/lib/egg/eggtoolitem.c +++ b/lib/egg/eggtoolitem.c @@ -225,12 +225,13 @@ egg_tool_item_class_init (EggToolItemClass *klass) GTK_TYPE_TOOLTIPS, G_TYPE_STRING, G_TYPE_STRING); - } static void egg_tool_item_init (EggToolItem *toolitem) { + GTK_WIDGET_UNSET_FLAGS (toolitem, GTK_CAN_FOCUS); + toolitem->visible_horizontal = TRUE; toolitem->visible_vertical = TRUE; toolitem->homogeneous = FALSE; @@ -357,10 +358,7 @@ egg_tool_item_map (GtkWidget *widget) toolitem = EGG_TOOL_ITEM (widget); GTK_WIDGET_CLASS (parent_class)->map (widget); if (toolitem->drag_window) - { - gdk_window_raise (toolitem->drag_window); - gdk_window_show (toolitem->drag_window); - } + gdk_window_show (toolitem->drag_window); } static void @@ -477,36 +475,45 @@ void egg_tool_item_set_expandable (EggToolItem *tool_item, gboolean expandable) { - if ((expandable && tool_item->expandable) || - (!expandable && !tool_item->expandable)) - return; + g_return_if_fail (EGG_IS_TOOL_ITEM (tool_item)); + + expandable = expandable != FALSE; - tool_item->expandable = expandable; - gtk_widget_queue_resize (GTK_WIDGET (tool_item)); + if (tool_item->expandable != expandable) + { + tool_item->expandable = expandable; + gtk_widget_queue_resize (GTK_WIDGET (tool_item)); + } } void egg_tool_item_set_pack_end (EggToolItem *tool_item, gboolean pack_end) { - if ((pack_end && tool_item->pack_end) || - (!pack_end && !tool_item->pack_end)) - return; + g_return_if_fail (EGG_IS_TOOL_ITEM (tool_item)); + + pack_end = pack_end != FALSE; - tool_item->pack_end = pack_end; - gtk_widget_queue_resize (GTK_WIDGET (tool_item)); + if (tool_item->pack_end != pack_end) + { + tool_item->pack_end = pack_end; + gtk_widget_queue_resize (GTK_WIDGET (tool_item)); + } } void egg_tool_item_set_homogeneous (EggToolItem *tool_item, gboolean homogeneous) { - if ((homogeneous && tool_item->homogeneous) || - (!homogeneous && !tool_item->homogeneous)) - return; + g_return_if_fail (EGG_IS_TOOL_ITEM (tool_item)); + + homogeneous = homogeneous != FALSE; - tool_item->homogeneous = homogeneous; - gtk_widget_queue_resize (GTK_WIDGET (tool_item)); + if (tool_item->homogeneous != homogeneous) + { + tool_item->homogeneous = homogeneous; + gtk_widget_queue_resize (GTK_WIDGET (tool_item)); + } } void @@ -527,24 +534,29 @@ egg_tool_item_set_use_drag_window (EggToolItem *toolitem, { g_return_if_fail (EGG_IS_TOOL_ITEM (toolitem)); - toolitem->use_drag_window = use_drag_window; + use_drag_window = use_drag_window != FALSE; - if (use_drag_window) + if (toolitem->use_drag_window != use_drag_window) { - if (!toolitem->drag_window && GTK_WIDGET_REALIZED (toolitem)) + toolitem->use_drag_window = use_drag_window; + + if (use_drag_window) { - create_drag_window(toolitem); - if (GTK_WIDGET_MAPPED (toolitem)) - gdk_window_show (toolitem->drag_window); + if (!toolitem->drag_window && GTK_WIDGET_REALIZED (toolitem)) + { + create_drag_window(toolitem); + if (GTK_WIDGET_MAPPED (toolitem)) + gdk_window_show (toolitem->drag_window); + } } - } - else - { - if (toolitem->drag_window) + else { - gdk_window_set_user_data (toolitem->drag_window, NULL); - gdk_window_destroy (toolitem->drag_window); - toolitem->drag_window = NULL; + if (toolitem->drag_window) + { + gdk_window_set_user_data (toolitem->drag_window, NULL); + gdk_window_destroy (toolitem->drag_window); + toolitem->drag_window = NULL; + } } - } + } } |