From 5810652218e5db7b73d7f814114e4541a8d05779 Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Thu, 16 Aug 2001 19:08:40 +0000 Subject: New callback for the realize signal. (make_bold): New. Hooks up the * e-shell-folder-title-bar.c (label_realize_callback): New callback for the realize signal. (make_bold): New. Hooks up the label_realize_callback. (e_shell_folder_title_bar_construct): Make the name of the folder bold using it. svn path=/trunk/; revision=12114 --- shell/ChangeLog | 8 ++++++++ shell/e-shell-folder-title-bar.c | 37 ++++++++++++++++++++++++++++++++++++- 2 files changed, 44 insertions(+), 1 deletion(-) (limited to 'shell') diff --git a/shell/ChangeLog b/shell/ChangeLog index 4458cc4bf5..8b5e3fd354 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,5 +1,13 @@ 2001-08-16 Ettore Perazzoli + * e-shell-folder-title-bar.c (label_realize_callback): New + callback for the realize signal. + (make_bold): New. Hooks up the label_realize_callback. + (e_shell_folder_title_bar_construct): Make the name of the folder + bold using it. + +o2001-08-16 Ettore Perazzoli + * e-gray-bar.c (endarken_style): Just hardcode the colors. * e-shell-folder-title-bar.c (set_title_bar_label_style): New. diff --git a/shell/e-shell-folder-title-bar.c b/shell/e-shell-folder-title-bar.c index 62ae177dc6..92b4a6577d 100644 --- a/shell/e-shell-folder-title-bar.c +++ b/shell/e-shell-folder-title-bar.c @@ -35,6 +35,7 @@ #include #include +#include #include "widgets/misc/e-clipped-label.h" #include "e-shell-constants.h" @@ -130,10 +131,42 @@ title_button_box_realize_cb (GtkWidget *widget, /* This is used to make the labels white. Yes, yes, I know I shouldn't do this. Yes, yes, I know it's evil. */ +static void +label_realize_callback (GtkWidget *widget, + void *data) +{ + GtkStyle *style; + EFont *e_font; + GdkFont *bolded_font; + + g_assert (widget->style->font != NULL); + + style = gtk_style_copy (widget->style); + gtk_style_unref (widget->style); + widget->style = style; + + e_font = e_font_from_gdk_font (style->font); + bolded_font = e_font_to_gdk_font (e_font, E_FONT_BOLD); + + gdk_font_unref (style->font); + style->font = bolded_font; + + gtk_style_attach (style, widget->window); +} + +static void +make_bold (GtkWidget *widget) +{ + gtk_signal_connect (GTK_OBJECT (widget), "realize", + GTK_SIGNAL_FUNC (label_realize_callback), NULL); +} + static void set_title_bar_label_style (GtkWidget *widget) { - GtkRcStyle *rc_style = gtk_rc_style_new(); + 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; @@ -445,12 +478,14 @@ e_shell_folder_title_bar_construct (EShellFolderTitleBar *folder_title_bar) gtk_misc_set_padding (GTK_MISC (priv->label), 5, 0); gtk_misc_set_alignment (GTK_MISC (priv->label), 0.0, 0.5); set_title_bar_label_style (priv->label); + make_bold (priv->label); priv->button_label = e_clipped_label_new (""); gtk_misc_set_padding (GTK_MISC (priv->button_label), 2, 0); gtk_misc_set_alignment (GTK_MISC (priv->button_label), 0.0, 0.5); gtk_widget_show (priv->button_label); set_title_bar_label_style (priv->button_label); + make_bold (priv->label); priv->folder_bar_label = e_clipped_label_new (""); gtk_misc_set_alignment (GTK_MISC (priv->folder_bar_label), 1.0, 0.5); -- cgit v1.2.3