[Webkit-unassigned] [Bug 51828] [GTK] Port combo box painting to GtkStyleContext

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jan 10 11:15:55 PST 2011


https://bugs.webkit.org/show_bug.cgi?id=51828





--- Comment #7 from Carlos Garcia Campos <cgarcia at igalia.com>  2011-01-10 11:15:55 PST ---
(In reply to comment #6)
> (In reply to comment #5)
> 
> > > > Source/WebCore/platform/gtk/RenderThemeGtk3.cpp:464
> > > > +    gfloat xalign = 0.5;
> > > > +    gfloat yalign = 0.5;
> > > > +    if (direction != GTK_TEXT_DIR_LTR)
> > > > +        xalign = 1.0 - xalign;
> 
> > > Doesn't this mean that xalign is always 0.5? If so wouldn't it just be better to use / 2 below and avoid xalign and yalign completely? In any case, yalign can go.
> 
> > Both xalign and yalign are 0.5 by default in gtk+, I left the code this way to make it closer to gtk+ code, so that it will be easier to maintain in case gtk+ code changes. 
> > To center the arrow, this is also based on gtk+ code:
> > http://git.gnome.org/browse/gtk+/tree/gtk/gtkarrow.c#n306
> 
> I still think it's better to use "/ 2" then here. We should favor clarity.

Ok.

> The GTK+ code fetches the xalign and valign via gtk_misc_get_alignment. I think that's why it uses xalign and valign.

Yes, indeed.

> Wouldn't it be safer to do the same thing here?

We can't, we don't have a widget to get the alignment from, that's why I'm using the default values. 

> > > I'd prefer cairo_restore here.
> > Me too :-), I thought I should use WebCore stuff always when possible.
> 
> Hrm. Interesting point. In my opinion, if code can be made simpler by using WebCore conveniences such as IntRect (which provides niceties like inflate), then I say we should use them. On the other hand, some WebCore classes exist only to wrap platform differences (like GraphicsContext). In platform-dependent code there is little reason to use them and it might add unecessary and unexpected overhead.

ok, I'll use cairo api directly here which is much cleaner indeed.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list