Some comments on the StyleContext stuff



This started out as a little TODO list while I was looking into
deprecating GdkColor for GdkRGBA in Lisbon's airport (it's much nicer
than Madrid) and ended as a pretty large list of comments. The
contents are unfiltered, so don't take anything personal. It wasn't
originally meant to be public. I decided to post it nonetheless,
because:
- There's lots of easy fixes that people could do.
- There's a bunch of questions about how to proceed that I'd like opinions on.

So here it goes:

9Slice:
- Why does 9Slice allow doubles but then doesn't handle them?
- CAIRO_EXTEND_PAD please
- Use cairo_surface_get_content() when creating similar surfaces
- or even better: cairo_surface_create_for_rectangle()
- don't create surfaces for 0px slices
- check return value for surface creation - otherwise painting might
abort half-way through due to an error surface in a 9slice
- Where do we handle 200px borders on 1px images?

StyleContext:
- Where's the error checking in the CSS provider? Shouldn't it mirror
CSS semantics for bad input?
- Are there any tests for the CSS parser and the 9slice rendering?
- Why doesn't GtkCssProvider use the GScanner warning/error facilities?
- gtkrc.c is a mess atm - everything is commented out. I suppose this
is going to be fixed (emacs keybindings)? Or should I just remove all
code so I have one less file to hate (Cheers Xan)
- we should probably remove gtk_rc_parse_string() and friends from
public API - They don't work anymore. Better to remove than keep the
compiler happyand people clueless why their code fails, no?
- some tests throw warnings, somebody please fix them
- gtk_paint_layout() uses a really mad method for x/y on rotated
layouts. Don't replicate in GtkStyleContext, fix GtkLabel instead.
(gtk_theming_engine_render_layout(), line 2292)

GdkColor vs GdkRGBA vs StyleContext:
- Allowing GdkColor and GdkRGBA properties is fail because of alpha:
What GdkColor do we return for (0,0,0,0)? Backwards compat could still
allow setting GdkColor, but is that necessary? People need to handle
RGBA anyway.
- style properties should all transition to RGBA
- all rendering should of course become RGBA, too
- With transparency, we fail at overdraw. Example:
- If all style properties are rgba, everything that uses GdkColor is
fail. Widgets using GtkStyle will suddenly look wrong when we use
translucency for background colors. Can we just remove GtkStyle,
please? And deal with the fallout? It's not like people don't have to
rewrite their draw functions anyway for GTK2 => GTK3 ...


Benjamin


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