diff options
author | Marco Pesenti Gritti <marco@it.gnome.org> | 2003-04-26 02:46:54 +0800 |
---|---|---|
committer | Marco Pesenti Gritti <mpeseng@src.gnome.org> | 2003-04-26 02:46:54 +0800 |
commit | 95c5dbcfc4214c63c93318344f5b6de091677d5e (patch) | |
tree | 56ef3ecaf51b0dc473fd880c6debac7f1b752098 /lib | |
parent | e22d66b927f60c384f96c47aa5d4519ceb4f9c47 (diff) | |
download | gsoc2013-epiphany-95c5dbcfc4214c63c93318344f5b6de091677d5e.tar.gz gsoc2013-epiphany-95c5dbcfc4214c63c93318344f5b6de091677d5e.tar.zst gsoc2013-epiphany-95c5dbcfc4214c63c93318344f5b6de091677d5e.zip |
Update.
2003-04-25 Marco Pesenti Gritti <marco@it.gnome.org>
* lib/egg/egg-toolbars-model.c:
* lib/egg/eggtoolbar.c:
Update.
* src/bookmarks/ephy-bookmark-properties.c:
(toolbar_checkbox_changed_cb), (build_ui),
(ephy_bookmark_properties_init):
* src/bookmarks/ephy-bookmarks-editor.c: (cmd_show_in_the_toolbar),
(cmd_delete), (ephy_bookmarks_editor_update_menu),
(ephy_bookmarks_editor_init):
* src/bookmarks/ephy-bookmarks.h:
* src/ephy-toolbars-model.c: (ephy_toolbars_model_new),
(get_item_pos), (get_action_name), (get_toolbar_pos),
(ephy_toolbars_model_remove_bookmark),
(ephy_toolbars_model_add_bookmark),
(ephy_toolbars_model_has_bookmark):
* src/ephy-toolbars-model.h:
Implement the checkbox to add bookmarks to the toolbar.
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/egg/egg-toolbars-model.c | 5 | ||||
-rw-r--r-- | lib/egg/eggtoolbar.c | 48 |
2 files changed, 46 insertions, 7 deletions
diff --git a/lib/egg/egg-toolbars-model.c b/lib/egg/egg-toolbars-model.c index cc54e6fb1..8d92da83a 100755 --- a/lib/egg/egg-toolbars-model.c +++ b/lib/egg/egg-toolbars-model.c @@ -223,6 +223,7 @@ impl_add_item (EggToolbarsModel *t, GNode *parent_node; GNode *node; EggToolbarsItem *item; + int real_position; g_return_val_if_fail (IS_EGG_TOOLBARS_MODEL (t), NULL); g_return_val_if_fail (name != NULL, NULL); @@ -232,8 +233,10 @@ impl_add_item (EggToolbarsModel *t, node = g_node_new (item); g_node_insert (parent_node, position, node); + real_position = g_node_child_position (parent_node, node); + g_signal_emit (G_OBJECT (t), egg_toolbars_model_signals[ITEM_ADDED], 0, - toolbar_position, position); + toolbar_position, real_position); return item->action_name; } diff --git a/lib/egg/eggtoolbar.c b/lib/egg/eggtoolbar.c index 154e432fd..cccf43ac0 100644 --- a/lib/egg/eggtoolbar.c +++ b/lib/egg/eggtoolbar.c @@ -109,6 +109,8 @@ static gboolean egg_toolbar_focus (GtkWidget *widget, GtkDirectionType dir); static void egg_toolbar_screen_changed (GtkWidget *widget, GdkScreen *previous_screen); +static void egg_toolbar_map (GtkWidget *widget); +static void egg_toolbar_unmap (GtkWidget *widget); static void egg_toolbar_drag_leave (GtkWidget *widget, GdkDragContext *context, @@ -269,7 +271,9 @@ egg_toolbar_class_init (EggToolbarClass *klass) widget_class->screen_changed = egg_toolbar_screen_changed; widget_class->realize = egg_toolbar_realize; widget_class->unrealize = egg_toolbar_unrealize; - + widget_class->map = egg_toolbar_map; + widget_class->unmap = egg_toolbar_unmap; + widget_class->drag_leave = egg_toolbar_drag_leave; widget_class->drag_motion = egg_toolbar_drag_motion; @@ -561,6 +565,28 @@ egg_toolbar_get_property (GObject *object, } static void +egg_toolbar_map (GtkWidget *widget) +{ + EggToolbarPrivate *priv = EGG_TOOLBAR_GET_PRIVATE (widget); + + GTK_WIDGET_CLASS (parent_class)->map (widget); + + if (priv->event_window) + gdk_window_show_unraised (priv->event_window); +} + +static void +egg_toolbar_unmap (GtkWidget *widget) +{ + EggToolbarPrivate *priv = EGG_TOOLBAR_GET_PRIVATE (widget); + + if (priv->event_window) + gdk_window_hide (priv->event_window); + + GTK_WIDGET_CLASS (parent_class)->unmap (widget); +} + +static void egg_toolbar_paint_space_line (GtkWidget *widget, GdkRectangle *area, EggToolItem *item) @@ -910,6 +936,15 @@ egg_toolbar_size_allocate (GtkWidget *widget, GtkAllocation *allocation) gtk_widget_style_get (widget, "internal_padding", &border_width, NULL); border_width += GTK_CONTAINER (toolbar)->border_width; + if (GTK_WIDGET_REALIZED (widget)) + { + gdk_window_move_resize (priv->event_window, + allocation->x + border_width, + allocation->y + border_width, + allocation->width - border_width * 2, + allocation->height - border_width * 2); + } + gtk_widget_get_child_requisition (GTK_WIDGET (priv->arrow_button), &arrow_requisition); @@ -1326,7 +1361,7 @@ style_change_notify (EggToolbar *toolbar) static void icon_size_change_notify (EggToolbar *toolbar) -{ +{ if (!toolbar->icon_size_set) { /* pretend it was set, then unset, thus reverting to new default */ @@ -1549,7 +1584,6 @@ egg_toolbar_drag_motion (GtkWidget *widget, } gdk_window_show (priv->drag_highlight); - gdk_window_raise (priv->drag_highlight); gdk_drag_status (context, context->suggested_action, time_); @@ -2176,9 +2210,11 @@ egg_toolbar_unset_icon_size (EggToolbar *toolbar) GtkSettings *settings = toolbar_get_settings (toolbar); if (settings) - g_object_get (settings, - "gtk-toolbar-icon-size", &size, - NULL); + { + g_object_get (settings, + "gtk-toolbar-icon-size", &size, + NULL); + } else size = DEFAULT_ICON_SIZE; |