diff options
Diffstat (limited to 'calendar/gui/view-utils.c')
-rw-r--r-- | calendar/gui/view-utils.c | 46 |
1 files changed, 43 insertions, 3 deletions
diff --git a/calendar/gui/view-utils.c b/calendar/gui/view-utils.c index 6e8c4044dd..b13fbf7b54 100644 --- a/calendar/gui/view-utils.c +++ b/calendar/gui/view-utils.c @@ -79,11 +79,11 @@ view_utils_draw_events (GtkWidget *widget, GdkWindow *window, GdkGC *gc, GdkRect str = ico->summary; if (flags & VIEW_UTILS_DRAW_END) { - strftime (buf, 512, "%X - ", &tm_start); + strftime (buf, 512, "%R%p - ", &tm_start); len = strlen (buf); - strftime (buf + len, 512 - len, "%X ", &tm_end); + strftime (buf + len, 512 - len, "%R%p ", &tm_end); } else - strftime (buf, 512, "%X ", &tm_start); + strftime (buf, 512, "%R%p ", &tm_start); gdk_draw_string (window, widget->style->font, @@ -107,3 +107,43 @@ view_utils_draw_events (GtkWidget *widget, GdkWindow *window, GdkGC *gc, GdkRect } gdk_gc_set_clip_rectangle (gc, NULL); } + +void +view_utils_draw_textured_frame (GtkWidget *widget, GdkWindow *window, GdkRectangle *rect, GtkShadowType shadow) +{ + int x, y; + int xthick, ythick; + GdkGC *light_gc, *dark_gc; + + gdk_draw_rectangle (window, + widget->style->bg_gc[GTK_STATE_NORMAL], + TRUE, + rect->x, rect->y, + rect->width, rect->height); + + light_gc = widget->style->light_gc[GTK_STATE_NORMAL]; + dark_gc = widget->style->dark_gc[GTK_STATE_NORMAL]; + + xthick = widget->style->klass->xthickness; + ythick = widget->style->klass->ythickness; + + gdk_gc_set_clip_rectangle (light_gc, rect); + gdk_gc_set_clip_rectangle (dark_gc, rect); + + for (y = rect->y + ythick; y < (rect->y + rect->height - ythick); y += 3) + for (x = rect->x + xthick; x < (rect->x + rect->width - xthick); x += 6) { + gdk_draw_point (window, light_gc, x, y); + gdk_draw_point (window, dark_gc, x + 1, y + 1); + + gdk_draw_point (window, light_gc, x + 3, y + 1); + gdk_draw_point (window, dark_gc, x + 4, y + 2); + } + + gdk_gc_set_clip_rectangle (light_gc, NULL); + gdk_gc_set_clip_rectangle (dark_gc, NULL); + + gtk_draw_shadow (widget->style, window, + GTK_STATE_NORMAL, shadow, + rect->x, rect->y, + rect->width, rect->height); +} |