Re: focus line theme patch



I've now applied much of this patch with some changes. Mostly,
the changes consisted of figuring out how things are supposed
to draw as opposed to how they actually draw now, and fitting
wide focus lines into that.

Highlights of the changes from your patch:

 - Reordered where the state-type argument was 
   the argument list for gtk_paint_focus() to
   be consistent with other gtk_paint_*() functions.

 - Changed the interpretation of the focus rectangle
   passed to paint_focus() so that it is the bounding
   box of the focus as drawn, not the rectangle passed
   to gdk_draw_rectangle. (This gets rid of the 
   - 1 that was in every old usage of paint_focus() 
   and all sorts of focus_width / 2 factors now.)

 - Made the default focus-padding 1 pixel, not 0, and
   used that it as the padding between the button and 
   the interior focus rectangle. Since exterior focus
   is not the default, I think it's fine you have
   to explicitely set the focus-padding to 0 to get
   back the GTK+-1.2 look.

 - Created docs/widget_geometry.txt which documents the
   exact painting behavior for a handful of widgets.

 - Did some work on making the default 1-1 stippled
   focus rectangle match properly at the corners.
 
 - A fair bit of small style-fixes. Main thing was that
   operators need spaces around them. (focus_width / 2,
   not focus_width/2)

Things I didn't commit:

 - GtkCalendar changes. Didn't work properly with large
   focus widths, I didn't understand the changes, and
   the colors weren't really right. I think the focus
   should always be drawn to contrast with the background
   (base color) not with the selected 

   I also don't think it makes sense to have a focus
   rectangle drawn around the whole widget and also
   around the focused day. However, this probably does
   mean that we need to always focus one day so we
   have some indication of focus. (Another possibility
   would be to change the headers and selected day
   color as we do in GtkTreeView ... in fact, this
   is probably right to do in any case.)

   I did a fair bit of cleanup in gtkcalendar.c trying
   to get this to work and committed those changes, but
   left size requisition and focus drawing alone
   in the end.

   Note that in the calendar and similar widgets, you
   can get away with focus_width space between the day
   widgets instead of 2 * focus_width.

   The GtkCalendar sizing code is pretty complex and
   will take some study to figure out how to add focus
   widths into it.

 - GtkTreeViewColumn changes. Didn't make much sense
   to me; needs to be discussed with Jonathan to come
   up with the right way of drawing things and 
   reserving extra space.

 - GtkRange changes. Need formal specification in the
   style of widget_geometry.txt for how this should
   work ... the code in GtkRange currently is 
   "vestigal" and I don't think trying to change a bit
   without figuring out what is supposed to be drawn,
   for GtkScale and probably for GtkScrollbar too.
   (GtkScrollbar isn't normally focusable, but can
   be _made_ focusable by setting the CAN_FOCUS flag;
   this might have legitimate uses.)

Other notes:

 - I have GtkCheckButton putting focus-padding between
   the focus rectangle and the child in interior-focus
   mode, but this is probably wrong since in GtkButton
   you only have a fixed spacing in this position
   and focus-padding is outside. focus-padding should
   probably be ignored for checkbuttons in interior-focus
   mode.

 - The GtkColorSel swatch need to be expanded for bigger
   focus widths.
 
 - Bigger focus widths can cover over the entire ring
   in GtkHSV; extra space needs to be allowed.

 - For GtkColorsel and GtkHSV, a non solid focus-line-pattern
   looks ugly; we need to either somehow use a different
   default here or just focus-line-pattern.

 - GtkNotebook should probably have focus-padding spacing
   between the tab borders and the focus indicator for
   consistency with GtkButton.

 - GtkEntry in exterior-focus mode should probably have
   focus-padding  spacing bewteen the bevel and focus
   rectangle llike GtkButton, etc.

I don't really have time to work on these remaining issues -
it might be good to file bug reports on them (or just one
for all of them) so we don't lose track. Patches fixing
up the remaining stuff would be much appreciated.

Regards,
                                        Owen



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]