aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell-view.c
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2001-06-23 15:03:46 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2001-06-23 15:03:46 +0800
commit1373f7ac7325e82b6de0b83c31c1ab4eea48879a (patch)
tree415409d963f023c320d8c951b6d16154af427bf2 /shell/e-shell-view.c
parent0d018e19d34b839af0b5b47fb2231053036fff2d (diff)
downloadgsoc2013-evolution-1373f7ac7325e82b6de0b83c31c1ab4eea48879a.tar
gsoc2013-evolution-1373f7ac7325e82b6de0b83c31c1ab4eea48879a.tar.gz
gsoc2013-evolution-1373f7ac7325e82b6de0b83c31c1ab4eea48879a.tar.bz2
gsoc2013-evolution-1373f7ac7325e82b6de0b83c31c1ab4eea48879a.tar.lz
gsoc2013-evolution-1373f7ac7325e82b6de0b83c31c1ab4eea48879a.tar.xz
gsoc2013-evolution-1373f7ac7325e82b6de0b83c31c1ab4eea48879a.tar.zst
gsoc2013-evolution-1373f7ac7325e82b6de0b83c31c1ab4eea48879a.zip
Get the menu hints to work with the new status bar.
svn path=/trunk/; revision=10437
Diffstat (limited to 'shell/e-shell-view.c')
-rw-r--r--shell/e-shell-view.c47
1 files changed, 41 insertions, 6 deletions
diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c
index d2d29c26dc..f52d7eb7c7 100644
--- a/shell/e-shell-view.c
+++ b/shell/e-shell-view.c
@@ -104,6 +104,7 @@ struct _EShellViewPrivate {
GtkWidget *status_bar;
GtkWidget *offline_toggle;
GtkWidget *offline_toggle_pixmap;
+ GtkWidget *menu_hint_label;
GtkWidget *task_bar;
/* The view we have already open. */
@@ -643,11 +644,24 @@ setup_offline_toggle (EShellView *shell_view)
}
static void
-setup_task_bar (EShellView *task_bar)
+setup_menu_hint_label (EShellView *shell_view)
{
EShellViewPrivate *priv;
- priv = task_bar->priv;
+ priv = shell_view->priv;
+
+ priv->menu_hint_label = gtk_label_new ("");
+ gtk_misc_set_alignment (GTK_MISC (priv->menu_hint_label), 0.0, 0.5);
+
+ gtk_box_pack_start (GTK_BOX (priv->status_bar), priv->menu_hint_label, TRUE, TRUE, 0);
+}
+
+static void
+setup_task_bar (EShellView *shell_view)
+{
+ EShellViewPrivate *priv;
+
+ priv = shell_view->priv;
priv->task_bar = e_task_bar_new ();
@@ -668,6 +682,7 @@ create_status_bar (EShellView *shell_view)
gtk_widget_show (priv->status_bar);
setup_offline_toggle (shell_view);
+ setup_menu_hint_label (shell_view);
setup_task_bar (shell_view);
}
@@ -676,7 +691,7 @@ create_status_bar (EShellView *shell_view)
static void
ui_engine_add_hint_callback (BonoboUIEngine *engine,
- const char *str,
+ const char *hint,
void *data)
{
EShellView *shell_view;
@@ -685,22 +700,41 @@ ui_engine_add_hint_callback (BonoboUIEngine *engine,
shell_view = E_SHELL_VIEW (data);
priv = shell_view->priv;
- g_print ("Hint -- %s\n", str);
+ gtk_label_set (GTK_LABEL (priv->menu_hint_label), hint);
+ gtk_widget_show (priv->menu_hint_label);
+ gtk_widget_hide (priv->task_bar);
+}
+
+static void
+ui_engine_remove_hint_callback (BonoboUIEngine *engine,
+ void *data)
+{
+ EShellView *shell_view;
+ EShellViewPrivate *priv;
- /* FIXME: Implement me. */
+ shell_view = E_SHELL_VIEW (data);
+ priv = shell_view->priv;
+
+ gtk_widget_hide (priv->menu_hint_label);
+ gtk_widget_show (priv->task_bar);
}
static void
setup_statusbar_hints (EShellView *shell_view)
{
EShellViewPrivate *priv;
+ BonoboUIEngine *ui_engine;
priv = shell_view->priv;
g_assert (priv->status_bar != NULL);
- gtk_signal_connect (GTK_OBJECT (bonobo_window_get_ui_engine (BONOBO_WINDOW (shell_view))), "add_hint",
+ ui_engine = bonobo_window_get_ui_engine (BONOBO_WINDOW (shell_view));
+
+ gtk_signal_connect (GTK_OBJECT (ui_engine), "add_hint",
GTK_SIGNAL_FUNC (ui_engine_add_hint_callback), shell_view);
+ gtk_signal_connect (GTK_OBJECT (ui_engine), "remove_hint",
+ GTK_SIGNAL_FUNC (ui_engine_remove_hint_callback), shell_view);
}
@@ -959,6 +993,7 @@ init (EShellView *shell_view)
priv->status_bar = NULL;
priv->offline_toggle = NULL;
priv->offline_toggle_pixmap = NULL;
+ priv->menu_hint_label = NULL;
priv->task_bar = NULL;
priv->shortcut_bar_mode = E_SHELL_VIEW_SUBWINDOW_HIDDEN;