Re: Theming API hackfest: last call



On Wed, Oct 15, 2008 at 12:03 PM, Christian Dywan <christian imendio com> wrote:

[...]

> Sounds like it would make subclassing kind of hard, if I understand you
> right. For instance people like to subclass to create all sorts of
> buttons and it is only intuitive that they all look similar. What would
> happen to my hypothetical ExampleSelectColorButton if the GtkButton
> styles are not applied to it?

It's not so much about picking the one or the other way, but providing
both possibilities. The general case will likely be styling on the
type name, but in rare cases implicit style inheritance may not be
desired. Imagine (ok, this is somewhat contrieved) that window
decorations will be drawn by gtk itself, and designers will just style
GtkWindow to their liking. It is conceivable that this styling should
not be inherited to GtkPlug, so ".GtkWindow { ... }" would be the way
to go.

Relatedly I am thinking of a sane way to import styling into CSS
blocks to aid widget mimicking. Imagine you want to mimick a GtkButton
with your own wonderful implementation "FooButton", but unrelated in
the GType hierarchy (not inheriting from GtkButton). Something like
this might aid to apply GtkButton styling:

FooButton {
    ccss: import(GtkButton);
}

Analogously, from the GtkWindow example above, it would be possible to
apply styling from GtkWindow to GtkDialog (it would not apply
implicitly, because we want to avoid styling GtkPlug). And let's make
up some additional properties as well:

GtkDialog {
    ccss: import(.GtkWindow);
    minimize-button: none;
    maximize-button: none;
}

All this is of course pretty premature, but I hope the idea is clear.

- Rob


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