aboutsummaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
Diffstat (limited to 'shell')
-rw-r--r--shell/ChangeLog18
-rw-r--r--shell/e-shell-view-menu.c19
-rw-r--r--shell/e-shell-view.c56
-rw-r--r--shell/e-shell-view.h7
4 files changed, 82 insertions, 18 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index de2478e268..1e8158085e 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,3 +1,21 @@
+2000-04-24 Matt Loper <matt@helixcode.com>
+
+ * e-shell-view.h: Added hpaned and treeview widgets to
+ EShellView. Added e_shell_view_toggle_shortcut_bar() and
+ e_shell_view_toggle_treeview().
+
+ * e-shell-view.c (e_shell_view_setup_shortcut_display): Use EPaned
+ widget to house our shortcut bar.
+ (e_shell_view_toggle_shortcut_bar): New function; toggles whether
+ the shortcut bar is showing.
+ (e_shell_view_toggle_treeview): Same, for the treeview (NYI).
+ (e_shell_view_new): Put the notebook view in our EPaned widget.
+
+ * e-shell-view-menu.c (esv_cmd_toggle_shortcut_bar): New function;
+ toggles whether the shortcut bar is viewed.
+ (esv_cmd_toggle_treeview): Same, but with the treeview. Added
+ menuitems in the "view" menu to allow access to the above.
+
2000-04-19 Seth Alves <alves@hungry.com>
* e-shell-view.c (get_view): set calendar's uri with a property bag
diff --git a/shell/e-shell-view-menu.c b/shell/e-shell-view-menu.c
index 8e8231d774..29f3db1376 100644
--- a/shell/e-shell-view-menu.c
+++ b/shell/e-shell-view-menu.c
@@ -92,6 +92,19 @@ esv_cmd_close_open_items (GtkWidget *widget, EShellView *esv)
printf ("Unimplemented function");
}
+static void
+esv_cmd_toggle_shortcut_bar (GtkWidget *widget, EShellView *esv)
+{
+ e_shell_view_toggle_shortcut_bar (esv);
+}
+
+static void
+esv_cmd_toggle_treeview (GtkWidget *widget, EShellView *esv)
+{
+ e_shell_view_toggle_treeview (esv);
+}
+
+
/*
* Fixme
*
@@ -182,6 +195,12 @@ static GnomeUIInfo esv_menu_edit [] = {
};
static GnomeUIInfo esv_menu_view [] = {
+ { GNOME_APP_UI_ITEM, N_("_Toggle Shortcut Bar"),
+ N_("Toggles the shortcut bar"), esv_cmd_toggle_shortcut_bar, NULL,
+ NULL, 0, 0, 'n', GDK_CONTROL_MASK | GDK_SHIFT_MASK },
+ { GNOME_APP_UI_ITEM, N_("_Toggle Treeview"),
+ N_("Toggles the tree view"), esv_cmd_toggle_treeview, NULL,
+ NULL, 0, 0, 'n', GDK_CONTROL_MASK | GDK_SHIFT_MASK },
GNOMEUIINFO_END
};
diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c
index e18af8550d..d6f4eeed2b 100644
--- a/shell/e-shell-view.c
+++ b/shell/e-shell-view.c
@@ -96,20 +96,25 @@ e_shell_view_setup (EShellView *eshell_view)
gtk_window_set_default_size (GTK_WINDOW (eshell_view), 600, 600);
}
+
+
+
static void
e_shell_view_setup_shortcut_display (EShellView *eshell_view)
{
- eshell_view->shortcut_bar = e_shortcut_bar_view_new (eshell_view->eshell->shortcut_bar);
+ eshell_view->shortcut_bar =
+ e_shortcut_bar_view_new (eshell_view->eshell->shortcut_bar);
- eshell_view->shortcut_hpaned = gtk_hpaned_new ();
- gtk_widget_show (eshell_view->shortcut_hpaned);
- gtk_paned_set_position (GTK_PANED (eshell_view->shortcut_hpaned), 100);
+ eshell_view->hpaned = e_paned_new (TRUE);
- gtk_paned_pack1 (GTK_PANED (eshell_view->shortcut_hpaned),
- eshell_view->shortcut_bar, FALSE, FALSE);
- gtk_widget_show (eshell_view->shortcut_bar);
+ e_paned_insert (eshell_view->hpaned, 0,
+ eshell_view->shortcut_bar,
+ 100);
- gnome_app_set_contents (GNOME_APP (eshell_view), eshell_view->shortcut_hpaned);
+ gtk_widget_show_all (eshell_view->hpaned);
+
+ gnome_app_set_contents (GNOME_APP (eshell_view),
+ eshell_view->hpaned);
gtk_signal_connect (
GTK_OBJECT (eshell_view->shortcut_bar), "item_selected",
@@ -221,6 +226,25 @@ get_view (EShellView *eshell_view, EFolder *efolder, Bonobo_UIHandler uih)
return w;
}
+void e_shell_view_toggle_shortcut_bar (EShellView *eshell_view)
+{
+ GtkWidget *shortcut_bar = eshell_view->shortcut_bar;
+ GtkWidget *hpaned = eshell_view->hpaned;
+
+ if (shortcut_bar->parent) {
+ gtk_widget_ref (shortcut_bar);
+ e_paned_remove (hpaned, shortcut_bar);
+ }
+ else
+ e_paned_insert (hpaned, 0, shortcut_bar,
+ 100);
+ gtk_widget_show_all (GTK_WIDGET (hpaned));
+}
+
+void e_shell_view_toggle_treeview (EShellView *eshell_view)
+{
+
+}
void
@@ -322,15 +346,13 @@ e_shell_view_new (EShell *eshell, EFolder *efolder, gboolean show_shortcut_bar)
gtk_widget_show (eshell_view->priv->notebook);
- if (eshell_view->shortcut_displayed){
- gtk_paned_pack2 (
- GTK_PANED (eshell_view->shortcut_hpaned),
- eshell_view->priv->notebook, TRUE, TRUE);
- }
- else {
- gnome_app_set_contents (GNOME_APP (eshell_view),
- eshell_view->priv->notebook);
- }
+ e_paned_insert (E_PANED (eshell_view->hpaned),
+ 1,
+ eshell_view->priv->notebook,
+// gtk_button_new_with_label ("foobar"),
+ 500);
+
+ gtk_widget_show_all (GTK_WIDGET (eshell_view->hpaned));
}
e_shell_view_set_view (eshell_view, efolder);
diff --git a/shell/e-shell-view.h b/shell/e-shell-view.h
index 3045b7adb7..97e5f41742 100644
--- a/shell/e-shell-view.h
+++ b/shell/e-shell-view.h
@@ -4,6 +4,7 @@
#include <bonobo/bonobo-object.h>
#include <bonobo/bonobo-ui-handler.h>
#include "e-shell.h"
+#include "e-util/e-paned.h"
#define E_SHELL_VIEW_TYPE (e_shell_view_get_type ())
#define E_SHELL_VIEW(o) (GTK_CHECK_CAST ((o), E_SHELL_VIEW_TYPE, EShellView))
@@ -26,8 +27,9 @@ struct _EShellView {
EFolder *efolder;
gboolean shortcut_displayed;
- GtkWidget *shortcut_hpaned;
+ GtkWidget *hpaned;
GtkWidget *shortcut_bar;
+ GtkWidget *treeview;
GtkWidget *contents;
EShellViewPrivate *priv;
@@ -47,6 +49,9 @@ void e_shell_view_new_shortcut (EShellView *esv);
void e_shell_view_set_view (EShellView *eshell_view,
EFolder *efolder);
+void e_shell_view_toggle_shortcut_bar (EShellView *eshell_view);
+void e_shell_view_toggle_treeview (EShellView *eshell_view);
+
void e_shell_view_display_shortcut_bar (EShellView *eshell_view, gboolean display);
#endif /* E_SHELL_VIEW_H */