aboutsummaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorRodney Dawes <dobey@ximian.com>2003-02-25 00:53:22 +0800
committerRodney Dawes <dobey@src.gnome.org>2003-02-25 00:53:22 +0800
commit32f0a2a91111805b1373d8a0f4ba8de99eee5d3d (patch)
tree277a2353f4c980fc4e123bb100d0405a4558afcf /shell
parentacf12a49d6be18001469b2ae7dcb0c136844a6d3 (diff)
downloadgsoc2013-evolution-32f0a2a91111805b1373d8a0f4ba8de99eee5d3d.tar
gsoc2013-evolution-32f0a2a91111805b1373d8a0f4ba8de99eee5d3d.tar.gz
gsoc2013-evolution-32f0a2a91111805b1373d8a0f4ba8de99eee5d3d.tar.bz2
gsoc2013-evolution-32f0a2a91111805b1373d8a0f4ba8de99eee5d3d.tar.lz
gsoc2013-evolution-32f0a2a91111805b1373d8a0f4ba8de99eee5d3d.tar.xz
gsoc2013-evolution-32f0a2a91111805b1373d8a0f4ba8de99eee5d3d.tar.zst
gsoc2013-evolution-32f0a2a91111805b1373d8a0f4ba8de99eee5d3d.zip
We don't need e-gray-bar.[ch] anymore Remove these unused files now We are
2003-02-24 Rodney Dawes <dobey@ximian.com> * Makefile.am: We don't need e-gray-bar.[ch] anymore * e-gray-bar.[ch]: Remove these unused files now * e-shell-folder-title-bar.c: We are themeable now!!!! Use GtkArrows now instead of pixmaps Get rid of the hardcoded colors Add an expose_event to paint a flat box for the background * e-shell-view.c: Don't need e-gray-bar anymore svn path=/trunk/; revision=20036
Diffstat (limited to 'shell')
-rw-r--r--shell/ChangeLog11
-rw-r--r--shell/Makefile.am2
-rw-r--r--shell/e-gray-bar.c107
-rw-r--r--shell/e-gray-bar.h60
-rw-r--r--shell/e-shell-folder-title-bar.c102
-rw-r--r--shell/e-shell-view.c2
6 files changed, 35 insertions, 249 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index 05e159bddd..c9f3e6c8b0 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,3 +1,13 @@
+2003-02-24 Rodney Dawes <dobey@ximian.com>
+
+ * Makefile.am: We don't need e-gray-bar.[ch] anymore
+ * e-gray-bar.[ch]: Remove these unused files now
+ * e-shell-folder-title-bar.c: We are themeable now!!!!
+ Use GtkArrows now instead of pixmaps
+ Get rid of the hardcoded colors
+ Add an expose_event to paint a flat box for the background
+ * e-shell-view.c: Don't need e-gray-bar anymore
+
2003-02-24 Ettore Perazzoli <ettore@ximian.com>
* evolution-shell-component.c (impl_populateFolderContextMenu):
@@ -16,6 +26,7 @@
* e-shell.c (save_settings_for_component): lower-case the config prefix.
+>>>>>>> 1.1176
2003-02-20 Dan Winship <danw@ximian.com>
* Makefile.am (evolution_LDADD):
diff --git a/shell/Makefile.am b/shell/Makefile.am
index 8c4a544108..16bec4d851 100644
--- a/shell/Makefile.am
+++ b/shell/Makefile.am
@@ -155,8 +155,6 @@ evolution_SOURCES = \
e-folder-dnd-bridge.h \
e-folder-type-registry.c \
e-folder-type-registry.h \
- e-gray-bar.c \
- e-gray-bar.h \
e-history.c \
e-history.h \
e-icon-factory.c \
diff --git a/shell/e-gray-bar.c b/shell/e-gray-bar.c
deleted file mode 100644
index d105791f2d..0000000000
--- a/shell/e-gray-bar.c
+++ /dev/null
@@ -1,107 +0,0 @@
-/* -*- 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 version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * 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)
-{
- GtkRcStyle *rc_style = gtk_rc_style_new();
-
- rc_style->color_flags[GTK_STATE_NORMAL] |= GTK_RC_BG;
- rc_style->bg[GTK_STATE_NORMAL].red = 0x8000;
- rc_style->bg[GTK_STATE_NORMAL].green = 0x8000;
- rc_style->bg[GTK_STATE_NORMAL].blue = 0x8000;
-
- rc_style->color_flags[GTK_STATE_INSENSITIVE] |= GTK_RC_BG;
- rc_style->bg[GTK_STATE_INSENSITIVE].red = 0x8000;
- rc_style->bg[GTK_STATE_INSENSITIVE].green = 0x8000;
- rc_style->bg[GTK_STATE_INSENSITIVE].blue = 0x8000;
-
- gtk_widget_modify_style (widget, rc_style);
- gtk_rc_style_unref (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 --;
-
- (* GTK_WIDGET_CLASS (parent_class)->style_set) (widget, previous_style);
-}
-
-
-static void
-class_init (GtkObjectClass *object_class)
-{
- GtkWidgetClass *widget_class;
-
- parent_class = g_type_class_ref(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 = g_object_new (e_gray_bar_get_type (), NULL);
-
- 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
deleted file mode 100644
index 29b1ee2869..0000000000
--- a/shell/e-gray-bar.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -*- 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 version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * 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-folder-title-bar.c b/shell/e-shell-folder-title-bar.c
index 00886095bb..5c995f32d8 100644
--- a/shell/e-shell-folder-title-bar.c
+++ b/shell/e-shell-folder-title-bar.c
@@ -25,6 +25,7 @@
#endif
#include <string.h>
+#include <gtk/gtkarrow.h>
#include <gtk/gtklabel.h>
#include <gtk/gtkimage.h>
#include <gtk/gtkrc.h>
@@ -84,64 +85,8 @@ enum {
static guint signals[LAST_SIGNAL] = { 0 };
-static const char *down_arrow_xpm[] = {
- "11 5 2 1",
- " c none",
- ". c #ffffffffffff",
- " ......... ",
- " ....... ",
- " ..... ",
- " ... ",
- " . ",
-};
-
-static const char *left_arrow_xpm[] = {
- "11 7 2 1",
- " c none",
- ". c #ffffffffffff",
- " . ",
- " .. ",
- " ........ ",
- " ......... ",
- " ........ ",
- " .. ",
- " . ",
-};
-
-static const char *right_arrow_xpm[] = {
- "11 7 2 1",
- " c none",
- ". c #ffffffffffff",
- " . ",
- " .. ",
- " ........ ",
- " ......... ",
- " ........ ",
- " .. ",
- " . ",
-};
-
-
/* Utility functions for managing icons and icon widgets. */
-static GtkWidget *
-create_image_widget_from_xpm (const char **xpm)
-{
- GdkPixbuf *pixbuf;
- GdkPixmap *pixmap;
- GdkBitmap *mask;
- GtkWidget *widget;
-
- pixbuf = gdk_pixbuf_new_from_xpm_data (xpm);
-
- gdk_pixbuf_render_pixmap_and_mask (pixbuf, &pixmap, &mask, 127);
-
- widget = gtk_image_new_from_pixmap (pixmap, mask);
- gtk_widget_show (widget);
-
- return widget;
-}
-
static GdkPixbuf *
new_empty_pixbuf (void)
{
@@ -175,23 +120,6 @@ new_empty_image_widget (void)
}
-static void
-set_title_bar_label_style (GtkWidget *widget)
-{
- GtkRcStyle *rc_style;
-
- rc_style = gtk_rc_style_new();
-
- rc_style->color_flags[GTK_STATE_NORMAL] |= GTK_RC_FG;
- rc_style->fg[GTK_STATE_NORMAL].red = 0xffff;
- rc_style->fg[GTK_STATE_NORMAL].green = 0xffff;
- rc_style->fg[GTK_STATE_NORMAL].blue = 0xffff;
-
- gtk_widget_modify_style (widget, rc_style);
- gtk_rc_style_unref (rc_style);
-}
-
-
/* Utility functions. */
static int
@@ -341,7 +269,7 @@ add_navigation_buttons (EShellFolderTitleBar *folder_title_bar)
gtk_button_set_relief (GTK_BUTTON (priv->back_button), GTK_RELIEF_NONE);
GTK_WIDGET_UNSET_FLAGS (priv->back_button, GTK_CAN_FOCUS);
- back_image = create_image_widget_from_xpm (left_arrow_xpm);
+ back_image = gtk_arrow_new (GTK_ARROW_LEFT, GTK_SHADOW_NONE);
gtk_container_add (GTK_CONTAINER (priv->back_button), back_image);
g_signal_connect (priv->back_button, "clicked",
@@ -351,7 +279,7 @@ add_navigation_buttons (EShellFolderTitleBar *folder_title_bar)
gtk_button_set_relief (GTK_BUTTON (priv->forward_button), GTK_RELIEF_NONE);
GTK_WIDGET_UNSET_FLAGS (priv->forward_button, GTK_CAN_FOCUS);
- forward_image = create_image_widget_from_xpm (right_arrow_xpm);
+ forward_image = gtk_arrow_new (GTK_ARROW_RIGHT, GTK_SHADOW_NONE);
gtk_container_add (GTK_CONTAINER (priv->forward_button), forward_image);
g_signal_connect (priv->forward_button, "clicked",
@@ -455,6 +383,24 @@ impl_size_allocate (GtkWidget *widget,
}
+static int
+impl_expose_event (GtkWidget *widget,
+ GdkEventExpose *event)
+{
+ gtk_paint_flat_box (widget->style, widget->window,
+ GTK_STATE_ACTIVE, GTK_SHADOW_OUT,
+ &event->area, widget, "EShellFolderTitleBar",
+ widget->allocation.x,
+ widget->allocation.y,
+ widget->allocation.width,
+ widget->allocation.height);
+
+ (* GTK_WIDGET_CLASS (parent_class)->expose_event) (widget, event);
+
+ return FALSE;
+}
+
+
static void
class_init (EShellFolderTitleBarClass *klass)
{
@@ -467,6 +413,7 @@ class_init (EShellFolderTitleBarClass *klass)
widget_class = GTK_WIDGET_CLASS (klass);
widget_class->size_allocate = impl_size_allocate;
+ widget_class->expose_event = impl_expose_event;
parent_class = g_type_class_ref(PARENT_TYPE);
@@ -554,18 +501,15 @@ e_shell_folder_title_bar_construct (EShellFolderTitleBar *folder_title_bar)
priv->title_label = e_clipped_label_new ("", PANGO_WEIGHT_BOLD, 1.2);
gtk_misc_set_padding (GTK_MISC (priv->title_label), 0, 0);
gtk_misc_set_alignment (GTK_MISC (priv->title_label), 0.0, 0.5);
- set_title_bar_label_style (priv->title_label);
priv->title_button_label = e_clipped_label_new ("", PANGO_WEIGHT_BOLD, 1.2);
gtk_misc_set_padding (GTK_MISC (priv->title_button_label), 2, 0);
gtk_misc_set_alignment (GTK_MISC (priv->title_button_label), 0.0, 0.5);
gtk_widget_show (priv->title_button_label);
- set_title_bar_label_style (priv->title_button_label);
priv->folder_bar_label = e_clipped_label_new ("", PANGO_WEIGHT_NORMAL, 1.0);
gtk_misc_set_alignment (GTK_MISC (priv->folder_bar_label), 1.0, 0.5);
gtk_widget_show (priv->folder_bar_label);
- set_title_bar_label_style (priv->folder_bar_label);
priv->title_button_icon = new_empty_image_widget ();
gtk_widget_show (priv->title_button_icon);
@@ -575,7 +519,7 @@ e_shell_folder_title_bar_construct (EShellFolderTitleBar *folder_title_bar)
FALSE, TRUE, 2);
gtk_box_pack_start (GTK_BOX (title_button_hbox), priv->title_button_label,
TRUE, TRUE, 0);
- gtk_box_pack_start (GTK_BOX (title_button_hbox), create_image_widget_from_xpm (down_arrow_xpm),
+ gtk_box_pack_start (GTK_BOX (title_button_hbox), gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_NONE),
FALSE, TRUE, 2);
gtk_widget_show (title_button_hbox);
diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c
index 69e26e77ba..324a10bd17 100644
--- a/shell/e-shell-view.c
+++ b/shell/e-shell-view.c
@@ -1328,7 +1328,7 @@ setup_widgets (EShellView *shell_view)
gtk_paned_pack1 (GTK_PANED (priv->view_hpaned), priv->storage_set_view_box, FALSE, FALSE);
gtk_paned_pack2 (GTK_PANED (priv->view_hpaned), priv->notebook, TRUE, FALSE);
- gray_bar = e_gray_bar_new ();
+ gray_bar = gtk_event_box_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, 2);