diff options
author | Matthew Barnes <mbarnes@src.gnome.org> | 2008-09-18 10:32:04 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@src.gnome.org> | 2008-09-18 10:32:04 +0800 |
commit | 8d21ab98d99ca43ee7873adba8172b699d8a007f (patch) | |
tree | d6a85918167907daf7c4dcf87b8b7feee89f12af /shell | |
parent | bb7cb1d677117a938ae18d9cae7acc7a56678b6f (diff) | |
download | gsoc2013-evolution-8d21ab98d99ca43ee7873adba8172b699d8a007f.tar gsoc2013-evolution-8d21ab98d99ca43ee7873adba8172b699d8a007f.tar.gz gsoc2013-evolution-8d21ab98d99ca43ee7873adba8172b699d8a007f.tar.bz2 gsoc2013-evolution-8d21ab98d99ca43ee7873adba8172b699d8a007f.tar.lz gsoc2013-evolution-8d21ab98d99ca43ee7873adba8172b699d8a007f.tar.xz gsoc2013-evolution-8d21ab98d99ca43ee7873adba8172b699d8a007f.tar.zst gsoc2013-evolution-8d21ab98d99ca43ee7873adba8172b699d8a007f.zip |
Progress update:
- Get context menus working in the contact preview pane.
- Kill EABPopup.
- Yet more code refactoring.
- Add a handy utility function: e_shell_window_show_popup_menu()
Takes a widget path in the shell window's UI definition.
svn path=/branches/kill-bonobo/; revision=36366
Diffstat (limited to 'shell')
-rw-r--r-- | shell/e-shell-sidebar.c | 1 | ||||
-rw-r--r-- | shell/e-shell-window.c | 32 | ||||
-rw-r--r-- | shell/e-shell-window.h | 3 |
3 files changed, 35 insertions, 1 deletions
diff --git a/shell/e-shell-sidebar.c b/shell/e-shell-sidebar.c index b67dc5b5e1..9d33024702 100644 --- a/shell/e-shell-sidebar.c +++ b/shell/e-shell-sidebar.c @@ -364,7 +364,6 @@ shell_sidebar_init (EShellSidebar *shell_sidebar) widget = gtk_event_box_new (); style = gtk_widget_get_style (widget); color = &style->bg[GTK_STATE_ACTIVE]; - gtk_container_set_border_width (GTK_CONTAINER (widget), 1); gtk_widget_modify_bg (widget, GTK_STATE_NORMAL, color); gtk_widget_set_parent (widget, GTK_WIDGET (shell_sidebar)); shell_sidebar->priv->event_box = g_object_ref (widget); diff --git a/shell/e-shell-window.c b/shell/e-shell-window.c index 96895908d8..7cb7defa33 100644 --- a/shell/e-shell-window.c +++ b/shell/e-shell-window.c @@ -648,6 +648,38 @@ e_shell_window_set_safe_mode (EShellWindow *shell_window, } /** + * e_shell_window_show_popup_menu: + * @shell_window: an #EShellWindow + * @widget_path: path in the UI definition + * @event: a #GdkEventButton + * + * Displays a context-sensitive (or "popup") menu that is described in + * the UI definition loaded into @shell_window<!-- -->'s user interface + * manager. The menu will be shown at the current mouse cursor position. + **/ +void +e_shell_window_show_popup_menu (EShellWindow *shell_window, + const gchar *widget_path, + GdkEventButton *event) +{ + GtkWidget *menu; + + g_return_if_fail (E_IS_SHELL_WINDOW (shell_window)); + + menu = e_shell_window_get_managed_widget (shell_window, widget_path); + g_return_if_fail (GTK_IS_MENU (menu)); + + if (event != NULL) + gtk_menu_popup ( + GTK_MENU (menu), NULL, NULL, NULL, NULL, + event->button, event->time); + else + gtk_menu_popup ( + GTK_MENU (menu), NULL, NULL, NULL, NULL, + 0, gtk_get_current_event_time ()); +} + +/** * e_shell_window_register_new_item_actions: * @shell_window: an #EShellWindow * @module_name: name of an #EShellModule diff --git a/shell/e-shell-window.h b/shell/e-shell-window.h index 002c37914e..bbc137dd07 100644 --- a/shell/e-shell-window.h +++ b/shell/e-shell-window.h @@ -80,6 +80,9 @@ void e_shell_window_set_active_view (EShellWindow *shell_window, gboolean e_shell_window_get_safe_mode (EShellWindow *shell_window); void e_shell_window_set_safe_mode (EShellWindow *shell_window, gboolean safe_mode); +void e_shell_window_show_popup_menu (EShellWindow *shell_window, + const gchar *widget_path, + GdkEventButton *event); /* These should be called from the shell module's window_created() handler. */ |