diff options
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ChangeLog | 13 | ||||
-rw-r--r-- | shell/e-shell-view-menu.c | 1 | ||||
-rw-r--r-- | shell/e-shell-view.c | 16 | ||||
-rw-r--r-- | shell/e-shortcuts-view.c | 30 | ||||
-rw-r--r-- | shell/e-shortcuts-view.h | 8 |
5 files changed, 64 insertions, 4 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog index e14b426b19..485e657deb 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,16 @@ +2001-01-13 Jason Leach <jasonleach@usa.net> + + (Fix bug #934: Add Right-click item to hide the shortcut bar) + + * e-shortcuts-view.c (class_init): Create a new hide_requested + signal. + (hide_shortcut_bar_cb): New function that gets called from the + right click menu items, it emits the hide_requested signal. + + * e-shell-view.c (setup_widgets): Connect the hide_requested from + the shortcut bar. + (hide_requested_cb): New function. + 2001-01-13 Ettore Perazzoli <ettore@ximian.com> * e-storage-set-view.h: New signal `dnd_action'. diff --git a/shell/e-shell-view-menu.c b/shell/e-shell-view-menu.c index 3b080f443e..f396bf9f6d 100644 --- a/shell/e-shell-view-menu.c +++ b/shell/e-shell-view-menu.c @@ -224,7 +224,6 @@ command_toggle_shortcut_bar (BonoboUIComponent *component, Bonobo_UIComponent_EventType type, const char *state, gpointer user_data) - { EShellView *shell_view; EShellViewSubwindowMode mode; diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c index 3a0c7a436d..d8a3ff5055 100644 --- a/shell/e-shell-view.c +++ b/shell/e-shell-view.c @@ -365,6 +365,19 @@ activate_shortcut_cb (EShortcutsView *shortcut_view, e_shell_view_display_uri (shell_view, uri); } +/* Callback when user chooses "Hide shortcut bar" via a right click */ +static void +hide_requested_cb (EShortcutsView *shortcut_view, + void *data) +{ + EShellView *shell_view; + + shell_view = E_SHELL_VIEW (data); + + e_shell_view_set_shortcut_bar_mode (shell_view, + E_SHELL_VIEW_SUBWINDOW_HIDDEN); +} + /* Callback called when a folder on the tree view gets clicked. */ static void folder_selected_cb (EStorageSetView *storage_set_view, @@ -508,6 +521,9 @@ setup_widgets (EShellView *shell_view) gtk_signal_connect (GTK_OBJECT (priv->shortcut_bar), "activate_shortcut", GTK_SIGNAL_FUNC (activate_shortcut_cb), shell_view); + gtk_signal_connect (GTK_OBJECT (priv->shortcut_bar), "hide_requested", + GTK_SIGNAL_FUNC (hide_requested_cb), shell_view); + /* The storage set view. */ setup_storage_set_subwindow (shell_view); diff --git a/shell/e-shortcuts-view.c b/shell/e-shortcuts-view.c index 30ced8d61f..855c0279a5 100644 --- a/shell/e-shortcuts-view.c +++ b/shell/e-shortcuts-view.c @@ -43,6 +43,7 @@ struct _EShortcutsViewPrivate { enum { ACTIVATE_SHORTCUT, + HIDE_REQUESTED, LAST_SIGNAL }; @@ -205,6 +206,20 @@ toggle_small_icons_cb (GtkWidget *widget, } static void +hide_shortcut_bar_cb (GtkWidget *widget, + void *data) +{ + RightClickMenuData *menu_data; + EShortcutsView *shortcut_view; + + menu_data = (RightClickMenuData *) data; + + shortcut_view = E_SHORTCUTS_VIEW (menu_data->shortcuts_view); + + gtk_signal_emit (GTK_OBJECT (shortcut_view), signals[HIDE_REQUESTED]); +} + +static void create_new_group_cb (GtkWidget *widget, void *data) { @@ -269,6 +284,12 @@ static GnomeUIInfo right_click_menu_uiinfo[] = { N_("Remove this shortcut group"), destroy_group_cb, NULL, NULL, 0, 0, 0, 0 }, + GNOMEUIINFO_SEPARATOR, + + { GNOME_APP_UI_ITEM, N_("_Hide the Shortcut Bar"), + N_("Hide the shortcut bar"), hide_shortcut_bar_cb, NULL, + NULL, 0, 0, 0, 0 }, + GNOMEUIINFO_END }; @@ -496,6 +517,15 @@ class_init (EShortcutsViewClass *klass) GTK_TYPE_POINTER, GTK_TYPE_STRING); + signals[HIDE_REQUESTED] = + gtk_signal_new ("hide_requested", + GTK_RUN_LAST, + object_class->type, + GTK_SIGNAL_OFFSET (EShortcutsViewClass, + hide_requested), + gtk_marshal_NONE__NONE, + GTK_TYPE_NONE, 0); + gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL); } diff --git a/shell/e-shortcuts-view.h b/shell/e-shortcuts-view.h index 8f6f8cb0af..0acb7efdce 100644 --- a/shell/e-shortcuts-view.h +++ b/shell/e-shortcuts-view.h @@ -58,9 +58,11 @@ struct _EShortcutsView { struct _EShortcutsViewClass { EShortcutBarClass parent_class; - void (* activate_shortcut) (EShortcutsView *view, - EShortcuts *shortcuts, - const char *uri); + void (* activate_shortcut) (EShortcutsView *view, + EShortcuts *shortcuts, + const char *uri); + + void (* hide_requested) (EShortcutsView *view); }; |