GNOME Bugzilla – Bug 97376
gtkcalendar arrow drawing
Last modified: 2010-10-30 01:58:13 UTC
The arrows in GtkCalendar: - Aren't drawn with the theme, even though the reason for that (weird arrows with a relief) is gone in the GTK+-2.0 default theme. - Don't follow the state of the widget (http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=69482)
There are also some redraw bugs in there: If I use testcalendar and turn on "show headings" and "show day names", the arrows are drawn. Now disable "show day names" again. This causes the calendar widget to shrink. The month arrows are redrawn, the year arrows aren't and I have to move the mouse over them to make them reappear.
Here is a patch which makes the arrows insensitive when the calendar is insensitive and uses style functions for drawing the arrows.
Created attachment 16342 [details] [review] patch
Any time one touches GtkCalendar, it's hard to tell where to stop fixing stuff... to get the arrow drawing right, I think the code should: - Make the arrow windows input-only - use gtk_paint_flat_box() instead of setting and clearing the background of the arrow window - Instead of calling gtk_paint_arrow() directly in changes, have a gtk_invalidate_arrow() which invalidates that portion of the window. The goal for all of GTK+ these days is that all drawing in done out of process_updates() That's sort of the minimum to get things to have a chance of theming nicely. I'd also comment that it doesn't look like: gtk_calendar_set_background() is using the right colors for the arrow windows, but with the above changes that doesn't matter.
I've committed the patch to get rid of draw_arrow_{left,right} in favour of gtk_paint_arrow and to fix the appearance of the arrows in an insensitive calendar. Leaving this open to track the more extensive drawing fixes proposed by Owen.
This should all be fixed