aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell-folder-title-bar.c
diff options
context:
space:
mode:
authorLarry Ewing <lewing@helixcode.com>2000-08-18 13:07:06 +0800
committerLarry Ewing <lewing@src.gnome.org>2000-08-18 13:07:06 +0800
commit3c98da1fc7cbe17c28fed4a893efd5c6c8b763cf (patch)
tree9d00824a9cb143d9128fd078f2920926e3a5cacd /shell/e-shell-folder-title-bar.c
parente9a97e185488cfbfe458e2ea8e15cb38150a9f48 (diff)
downloadgsoc2013-evolution-3c98da1fc7cbe17c28fed4a893efd5c6c8b763cf.tar
gsoc2013-evolution-3c98da1fc7cbe17c28fed4a893efd5c6c8b763cf.tar.gz
gsoc2013-evolution-3c98da1fc7cbe17c28fed4a893efd5c6c8b763cf.tar.bz2
gsoc2013-evolution-3c98da1fc7cbe17c28fed4a893efd5c6c8b763cf.tar.lz
gsoc2013-evolution-3c98da1fc7cbe17c28fed4a893efd5c6c8b763cf.tar.xz
gsoc2013-evolution-3c98da1fc7cbe17c28fed4a893efd5c6c8b763cf.tar.zst
gsoc2013-evolution-3c98da1fc7cbe17c28fed4a893efd5c6c8b763cf.zip
update the pixmap define E_USE_STYLES to disable the current darkening
2000-08-18 Larry Ewing <lewing@helixcode.com> * e-shell-folder-title-bar.c (style_set_cb): update the pixmap define E_USE_STYLES to disable the current darkening behavior (destroy): free the icon. (e_shell_folder_title_bar_construct): style_set_cb does everything important now. (e_shell_folder_title_bar_set_icon): actually store the pixbuf when we set it so that we still have it if the style changes and take care of refcounting them properly. svn path=/trunk/; revision=4872
Diffstat (limited to 'shell/e-shell-folder-title-bar.c')
-rw-r--r--shell/e-shell-folder-title-bar.c45
1 files changed, 22 insertions, 23 deletions
diff --git a/shell/e-shell-folder-title-bar.c b/shell/e-shell-folder-title-bar.c
index 447a991d02..62b0958b20 100644
--- a/shell/e-shell-folder-title-bar.c
+++ b/shell/e-shell-folder-title-bar.c
@@ -177,6 +177,7 @@ title_button_box_realize_cb (GtkWidget *widget,
static void
endarken_style (GtkWidget *widget)
{
+#ifndef E_USE_STYLES
GtkStyle *style;
GtkRcStyle *new_rc_style;
int i;
@@ -199,6 +200,7 @@ endarken_style (GtkWidget *widget)
gtk_widget_modify_style (widget, new_rc_style);
gtk_rc_style_unref (new_rc_style);
+#endif
}
static void
@@ -206,33 +208,21 @@ style_set_cb (GtkWidget *widget,
GtkStyle *previous_style,
void *data)
{
- /* This will cause a style_set signal to be emitted again, so we need to do this to prevent infinite recursion. */
+ EShellFolderTitleBar *folder_title_bar;
+
+ folder_title_bar = E_SHELL_FOLDER_TITLE_BAR (widget);
+
+ /*
+ This will cause a style_set signal to be emitted again,
+ so we need to do this to prevent infinite recursion.
+ */
gtk_signal_handler_block_by_func (GTK_OBJECT (widget), GTK_SIGNAL_FUNC (style_set_cb), data);
endarken_style (widget);
-
gtk_signal_handler_unblock_by_func (GTK_OBJECT (widget), GTK_SIGNAL_FUNC (style_set_cb), data);
-}
-static void
-endarken_and_connect_style_set_signal (GtkWidget *widget)
-{
- endarken_style (widget);
- gtk_signal_connect (GTK_OBJECT (widget), "style_set",
- GTK_SIGNAL_FUNC (style_set_cb), NULL);
-}
-
-static void
-setup_style (EShellFolderTitleBar *folder_title_bar)
-{
- EShellFolderTitleBarPrivate *priv;
-
- priv = folder_title_bar->priv;
-
- endarken_and_connect_style_set_signal (priv->label);
- endarken_and_connect_style_set_signal (priv->button);
- endarken_and_connect_style_set_signal (priv->button_label);
- endarken_and_connect_style_set_signal (GTK_WIDGET (folder_title_bar));
+ if (folder_title_bar->priv->icon)
+ e_shell_folder_title_bar_set_icon (folder_title_bar, folder_title_bar->priv->icon);
}
@@ -302,6 +292,7 @@ destroy (GtkObject *object)
folder_title_bar = E_SHELL_FOLDER_TITLE_BAR (object);
priv = folder_title_bar->priv;
+ gdk_pixbuf_unref (priv->icon);
g_free (priv);
(* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
@@ -408,7 +399,8 @@ e_shell_folder_title_bar_construct (EShellFolderTitleBar *folder_title_bar)
gtk_container_add (GTK_CONTAINER (folder_title_bar), priv->hbox);
- setup_style (folder_title_bar);
+ gtk_signal_connect (GTK_OBJECT (folder_title_bar), "style_set",
+ GTK_SIGNAL_FUNC (style_set_cb), NULL);
e_shell_folder_title_bar_set_title (folder_title_bar, NULL);
@@ -481,11 +473,18 @@ e_shell_folder_title_bar_set_icon (EShellFolderTitleBar *folder_title_bar,
EShellFolderTitleBarPrivate *priv;
GdkPixmap *pixmap;
+ g_return_if_fail (icon != NULL);
+
g_return_if_fail (folder_title_bar != NULL);
g_return_if_fail (E_IS_SHELL_FOLDER_TITLE_BAR (folder_title_bar));
priv = folder_title_bar->priv;
+ gdk_pixbuf_ref (icon);
+ if (priv->icon)
+ gdk_pixbuf_unref (priv->icon);
+ priv->icon = icon;
+
pixmap = make_icon_pixmap (folder_title_bar, icon);
gtk_pixmap_set (GTK_PIXMAP (priv->icon_widget), pixmap, NULL);