From d4f096e0ca0ec461d5ab7a3369aaa95480561d92 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Thu, 2 Apr 1998 08:10:50 +0000 Subject: New customization function. We can't decide on a stupid border type :-) 1998-04-02 Federico Mena Quintero * gncal-day-view.c (gncal_day_view_set_shadow): New customization function. We can't decide on a stupid border type :-) (gncal_day_view_init): Made GTK_SHADOW_ETCHED_IN be the default shadow type. Looks good. svn path=/trunk/; revision=94 --- calendar/ChangeLog | 7 +++++++ calendar/gncal-day-view.c | 17 ++++++++++++++++- calendar/gncal-day-view.h | 4 ++++ calendar/gui/gncal-day-view.c | 17 ++++++++++++++++- calendar/gui/gncal-day-view.h | 4 ++++ 5 files changed, 47 insertions(+), 2 deletions(-) (limited to 'calendar') diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 396f5d2a83..045ee929d9 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,10 @@ +1998-04-02 Federico Mena Quintero + + * gncal-day-view.c (gncal_day_view_set_shadow): New customization + function. We can't decide on a stupid border type :-) + (gncal_day_view_init): Made GTK_SHADOW_ETCHED_IN be the default + shadow type. Looks good. + 1998-04-02 Miguel de Icaza * main.c: New main program that uses our new datatypes and diff --git a/calendar/gncal-day-view.c b/calendar/gncal-day-view.c index aae6107b98..ce0b363c62 100644 --- a/calendar/gncal-day-view.c +++ b/calendar/gncal-day-view.c @@ -77,6 +77,8 @@ gncal_day_view_init (GncalDayView *dview) dview->lower = 0; dview->upper = 0; + + dview->shadow_type = GTK_SHADOW_ETCHED_IN; } static void @@ -202,7 +204,7 @@ gncal_day_view_expose (GtkWidget *widget, GdkEventExpose *event) event->area.width, event->area.height); gtk_draw_shadow (widget->style, widget->window, - GTK_STATE_NORMAL, GTK_SHADOW_IN, + GTK_STATE_NORMAL, dview->shadow_type, 0, 0, widget->allocation.width, widget->allocation.height); @@ -305,3 +307,16 @@ gncal_day_view_set_bounds (GncalDayView *dview, time_t lower, time_t upper) gncal_day_view_update (dview); } } + +void +gncal_day_view_set_shadow (GncalDayView *dview, GtkShadowType shadow_type) +{ + g_return_if_fail (dview != NULL); + g_return_if_fail (GNCAL_IS_DAY_VIEW (dview)); + + if (shadow_type != dview->shadow_type) { + dview->shadow_type = shadow_type; + + gtk_widget_draw (GTK_WIDGET (dview), NULL); + } +} diff --git a/calendar/gncal-day-view.h b/calendar/gncal-day-view.h index c10c0c78f8..e17eabcab7 100644 --- a/calendar/gncal-day-view.h +++ b/calendar/gncal-day-view.h @@ -34,6 +34,8 @@ struct _GncalDayView { time_t upper; char *day_str; /* what day is it? */ + + GtkShadowType shadow_type; }; struct _GncalDayViewClass { @@ -47,6 +49,8 @@ GtkWidget *gncal_day_view_new (Calendar *calendar, time_t lower, time_t void gncal_day_view_update (GncalDayView *dview); void gncal_day_view_set_bounds (GncalDayView *dview, time_t lower, time_t upper); +void gncal_day_view_set_shadow (GncalDayView *dview, GtkShadowType shadow_type); + END_GNOME_DECLS diff --git a/calendar/gui/gncal-day-view.c b/calendar/gui/gncal-day-view.c index aae6107b98..ce0b363c62 100644 --- a/calendar/gui/gncal-day-view.c +++ b/calendar/gui/gncal-day-view.c @@ -77,6 +77,8 @@ gncal_day_view_init (GncalDayView *dview) dview->lower = 0; dview->upper = 0; + + dview->shadow_type = GTK_SHADOW_ETCHED_IN; } static void @@ -202,7 +204,7 @@ gncal_day_view_expose (GtkWidget *widget, GdkEventExpose *event) event->area.width, event->area.height); gtk_draw_shadow (widget->style, widget->window, - GTK_STATE_NORMAL, GTK_SHADOW_IN, + GTK_STATE_NORMAL, dview->shadow_type, 0, 0, widget->allocation.width, widget->allocation.height); @@ -305,3 +307,16 @@ gncal_day_view_set_bounds (GncalDayView *dview, time_t lower, time_t upper) gncal_day_view_update (dview); } } + +void +gncal_day_view_set_shadow (GncalDayView *dview, GtkShadowType shadow_type) +{ + g_return_if_fail (dview != NULL); + g_return_if_fail (GNCAL_IS_DAY_VIEW (dview)); + + if (shadow_type != dview->shadow_type) { + dview->shadow_type = shadow_type; + + gtk_widget_draw (GTK_WIDGET (dview), NULL); + } +} diff --git a/calendar/gui/gncal-day-view.h b/calendar/gui/gncal-day-view.h index c10c0c78f8..e17eabcab7 100644 --- a/calendar/gui/gncal-day-view.h +++ b/calendar/gui/gncal-day-view.h @@ -34,6 +34,8 @@ struct _GncalDayView { time_t upper; char *day_str; /* what day is it? */ + + GtkShadowType shadow_type; }; struct _GncalDayViewClass { @@ -47,6 +49,8 @@ GtkWidget *gncal_day_view_new (Calendar *calendar, time_t lower, time_t void gncal_day_view_update (GncalDayView *dview); void gncal_day_view_set_bounds (GncalDayView *dview, time_t lower, time_t upper); +void gncal_day_view_set_shadow (GncalDayView *dview, GtkShadowType shadow_type); + END_GNOME_DECLS -- cgit