aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2001-08-12 23:34:53 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2001-08-12 23:34:53 +0800
commit1285912f049822720b8643d2417bfd6b7ad58fc6 (patch)
tree207a8628079b566c1e9a6fe89a0377b6f617465b
parent51f77f649b27e6013038c642c532d0547c7fdddd (diff)
downloadgsoc2013-evolution-1285912f049822720b8643d2417bfd6b7ad58fc6.tar.gz
gsoc2013-evolution-1285912f049822720b8643d2417bfd6b7ad58fc6.tar.zst
gsoc2013-evolution-1285912f049822720b8643d2417bfd6b7ad58fc6.zip
Put the folder title bar into an EGrayBar.
* e-shell-view.c (setup_widgets): Put the folder title bar into an EGrayBar. * e-gray-bar.c: New. * e-gray-bar.h: New. svn path=/trunk/; revision=11932
-rw-r--r--shell/ChangeLog8
-rw-r--r--shell/Makefile.am2
-rw-r--r--shell/e-gray-bar.c120
-rw-r--r--shell/e-gray-bar.h61
-rw-r--r--shell/e-shell-view.c14
5 files changed, 201 insertions, 4 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index c99e2c0207..ba96655f0e 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,5 +1,13 @@
2001-08-12 Ettore Perazzoli <ettore@ximian.com>
+ * e-shell-view.c (setup_widgets): Put the folder title bar into an
+ EGrayBar.
+
+ * e-gray-bar.c: New.
+ * e-gray-bar.h: New.
+
+2001-08-12 Ettore Perazzoli <ettore@ximian.com>
+
[Finally! Fix #413, "Support for stock folders", and #786, "i18n:
default folder names are not translated".]
diff --git a/shell/Makefile.am b/shell/Makefile.am
index a85307efae..9bd2eaac79 100644
--- a/shell/Makefile.am
+++ b/shell/Makefile.am
@@ -105,6 +105,8 @@ evolution_SOURCES = \
e-folder-type-registry.h \
e-folder.c \
e-folder.h \
+ e-gray-bar.c \
+ e-gray-bar.h \
e-local-folder.c \
e-local-folder.h \
e-local-storage.c \
diff --git a/shell/e-gray-bar.c b/shell/e-gray-bar.c
new file mode 100644
index 0000000000..b15c2a0fc6
--- /dev/null
+++ b/shell/e-gray-bar.c
@@ -0,0 +1,120 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+/* e-gray-bar.c
+ *
+ * Copyright (C) 2001 Ximian, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: Ettore Perazzoli <ettore@ximian.com>
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "e-gray-bar.h"
+
+#include <gtk/gtkrc.h>
+#include <gtk/gtktypeutils.h>
+#include <gtk/gtkwidget.h>
+
+#include <gal/util/e-util.h>
+
+
+#define PARENT_TYPE gtk_event_box_get_type ()
+static GtkEventBoxClass *parent_class = NULL;
+
+
+static void
+endarken_style (GtkWidget *widget)
+{
+ GtkStyle *style;
+ GtkRcStyle *new_rc_style;
+ int i;
+
+ style = widget->style;
+
+ new_rc_style = gtk_rc_style_new ();
+
+ for (i = 0; i < 5; i++) {
+ new_rc_style->bg[i].red = 0xffff;
+ new_rc_style->bg[i].green = 0x0000;
+ new_rc_style->bg[i].blue = 0xffff;
+ new_rc_style->base[i].red = style->base[i].red * .8;
+ new_rc_style->base[i].green = style->base[i].green * .8;
+ new_rc_style->base[i].blue = style->base[i].blue * .8;
+ new_rc_style->fg[i].red = 0xffff;
+ new_rc_style->fg[i].green = 0xffff;
+ new_rc_style->fg[i].blue = 0xffff;
+ new_rc_style->text[i].red = 0xffff;
+ new_rc_style->text[i].green = 0xffff;
+ new_rc_style->text[i].blue = 0xffff;
+
+ new_rc_style->color_flags[i] = GTK_RC_BG | GTK_RC_FG | GTK_RC_BASE | GTK_RC_TEXT;
+ }
+
+ gtk_widget_modify_style (widget, new_rc_style);
+
+ gtk_rc_style_unref (new_rc_style);
+}
+
+
+static void
+impl_style_set (GtkWidget *widget,
+ GtkStyle *previous_style)
+{
+ static int in_style_set = 0;
+
+ if (in_style_set > 0)
+ return;
+
+ in_style_set ++;
+
+ endarken_style (widget);
+
+ in_style_set --;
+}
+
+
+static void
+class_init (GtkObjectClass *object_class)
+{
+ GtkWidgetClass *widget_class;
+
+ parent_class = gtk_type_class (PARENT_TYPE);
+
+ widget_class = GTK_WIDGET_CLASS (object_class);
+ widget_class->style_set = impl_style_set;
+}
+
+static void
+init (EGrayBar *gray_bar)
+{
+}
+
+
+GtkWidget *
+e_gray_bar_new (void)
+{
+ GtkWidget *new;
+
+ new = gtk_type_new (e_gray_bar_get_type ());
+
+ return new;
+}
+
+
+E_MAKE_TYPE (e_gray_bar, "EGrayBar", EGrayBar, class_init, init, PARENT_TYPE)
diff --git a/shell/e-gray-bar.h b/shell/e-gray-bar.h
new file mode 100644
index 0000000000..72a699ce0f
--- /dev/null
+++ b/shell/e-gray-bar.h
@@ -0,0 +1,61 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+/* e-gray-bar.h
+ *
+ * Copyright (C) 2001 Ximian, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: Ettore Perazzoli <ettore@ximian.com>
+ */
+
+#ifndef _E_GRAY_BAR_H_
+#define _E_GRAY_BAR_H_
+
+#include <gtk/gtkeventbox.h>
+
+#ifdef __cplusplus
+extern "C" {
+#pragma }
+#endif /* __cplusplus */
+
+#define E_TYPE_GRAY_BAR (e_gray_bar_get_type ())
+#define E_GRAY_BAR(obj) (GTK_CHECK_CAST ((obj), E_TYPE_GRAY_BAR, EGrayBar))
+#define E_GRAY_BAR_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_TYPE_GRAY_BAR, EGrayBarClass))
+#define E_IS_GRAY_BAR(obj) (GTK_CHECK_TYPE ((obj), E_TYPE_GRAY_BAR))
+#define E_IS_GRAY_BAR_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), E_TYPE_GRAY_BAR))
+
+
+typedef struct _EGrayBar EGrayBar;
+typedef struct _EGrayBarPrivate EGrayBarPrivate;
+typedef struct _EGrayBarClass EGrayBarClass;
+
+struct _EGrayBar {
+ GtkEventBox parent;
+};
+
+struct _EGrayBarClass {
+ GtkEventBoxClass parent_class;
+};
+
+
+GtkType e_gray_bar_get_type (void);
+GtkWidget *e_gray_bar_new (void);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* _E_GRAY_BAR_H_ */
diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c
index 00087db30d..4180c3939e 100644
--- a/shell/e-shell-view.c
+++ b/shell/e-shell-view.c
@@ -54,6 +54,7 @@
#include "evolution-shell-view.h"
+#include "e-gray-bar.h"
#include "e-shell-constants.h"
#include "e-shell-folder-title-bar.h"
#include "e-shell-utils.h"
@@ -650,6 +651,7 @@ setup_storage_set_subwindow (EShellView *shell_view)
gtk_container_add (GTK_CONTAINER (scroll_frame), storage_set_view);
vbox = gtk_vbox_new (FALSE, 0);
+
priv->storage_set_title_bar = e_title_bar_new (_("Folders"));
gtk_box_pack_start (GTK_BOX (vbox), priv->storage_set_title_bar, FALSE, FALSE, 0);
@@ -800,6 +802,7 @@ setup_widgets (EShellView *shell_view)
{
EShellViewPrivate *priv;
GtkWidget *contents_vbox;
+ GtkWidget *gray_bar;
priv = shell_view->priv;
@@ -842,10 +845,11 @@ setup_widgets (EShellView *shell_view)
e_paned_pack2 (E_PANED (priv->view_hpaned), priv->notebook, TRUE, FALSE);
e_paned_set_position (E_PANED (priv->view_hpaned), DEFAULT_TREE_WIDTH);
- gtk_box_pack_start (GTK_BOX (priv->view_vbox), priv->folder_title_bar,
- FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX (priv->view_vbox), priv->view_hpaned,
- TRUE, TRUE, 0);
+ gray_bar = e_gray_bar_new ();
+ gtk_container_add (GTK_CONTAINER (gray_bar), priv->folder_title_bar);
+ gtk_box_pack_start (GTK_BOX (priv->view_vbox), gray_bar, FALSE, FALSE, 0);
+
+ gtk_box_pack_start (GTK_BOX (priv->view_vbox), priv->view_hpaned, TRUE, TRUE, 0);
priv->hpaned = e_hpaned_new ();
gtk_container_add (GTK_CONTAINER (priv->shortcut_frame), priv->shortcut_bar);
@@ -880,6 +884,8 @@ setup_widgets (EShellView *shell_view)
gtk_widget_show (priv->folder_title_bar);
gtk_widget_show (priv->status_bar);
+ gtk_widget_show (gray_bar);
+
/* By default, both the folder bar and shortcut bar are visible. */
priv->shortcut_bar_mode = E_SHELL_VIEW_SUBWINDOW_STICKY;
priv->folder_bar_mode = E_SHELL_VIEW_SUBWINDOW_STICKY;