After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 63075 - gtkcalendar does not use standard focus drawing mechanism
gtkcalendar does not use standard focus drawing mechanism
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
1.3.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2001-10-26 12:47 UTC by bill.haneman
Modified: 2011-02-04 16:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch to provide fix for this bug (3.47 KB, patch)
2002-01-24 12:13 UTC, bill.haneman
none Details | Review

Description bill.haneman 2001-10-26 12:47:09 UTC
gtkcalendar uses its own focus drawing code, not gtk_paint_focus.  As part
of the patch for bug 61079, gtkcalendar is modified to call
gtk_paint_focus() instead, so that it can be consistent with the rest of
GTK+.
Comment 1 Owen Taylor 2002-01-24 01:26:39 UTC
http://mail.gnome.org/archives/gtk-devel-list/2001-December/msg00018.html

Describes what needs to be done to GtkCalendar.
Comment 2 bill.haneman 2002-01-24 12:13:45 UTC
Created attachment 6499 [details] [review]
patch to provide fix for this bug
Comment 3 bill.haneman 2002-01-24 12:17:58 UTC
The previous suggestion that the spacing between calendar dates needs
only to be increased by one focus-width is incorrect, since the focus
rectangle must be drawn entirely within the background rectangle for
the date, in order to be visible in high contrast themes.  Also the
paint_focus call must have an appropriate GTK_WIDGET_STATE set
according to whether the focussed cell is selected or not.

THe attached patch addresses these issues.
Comment 4 Owen Taylor 2002-02-14 03:50:11 UTC
To quibble over the comment about selected backgrounds:

The optimum appearance is when the focus rectangle contrasts with
both the selected and non-selected background. In this case, it's
clearly visible.

If you have a monochrome color scheme with an inverted selection,
then this is not possible. Two effects are then possible:

 a) The focus rectangle is drawn in place of the non-selected 
    background surrounding the selected cell and makes the cell
    visually larger. (Possibbly with a dashed pattern.)
 
 b) The focus rectangle is drawn in place of the selected 
    background within the selected cell and makes the cell
    visually smaller. (Possibly with a dashed pattern.)

In theory, it would be possible to mix the two, but that would
produce ugly results.

I don't think there is any real difference between a) and b)
in terms of distinctiveness. The one advantage for b) is that
the current values of the parameters DAY_XPAD and DAY_XSEP
are 2 and 0 respectively, so currently the focus is drawn
inside the selected area instead of outside the selected area.
Comment 5 Owen Taylor 2002-02-14 04:05:07 UTC
Applied mostly as provided, with a few cleanups (don't need
to pass an area to paint_focus() unless you have clipping,etc.)

Wed Feb 13 23:01:20 2002  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkcalendar.c: Patch from Bill Haneman to draw
	to focus using gtk_paint_focus() with the focus width
	GtkWidget::focus-width. (#63075)