Re: Custom CSS in GtkBuilder XML


On 30 July 2016 at 11:54, lukas middelberg-bi net
<lukas middelberg-bi net> wrote:

Using GtkBuilder XML, you can currently only add Styling Information like

<object class="Foo">
        <class name="predefined-class" />

So (please correct me if I'm wrong) CSS cannot be added without actions
outside of this XML File.


You always have to create a GtkCssProvider and add
it to the widget's GtkStyleContext in your programming code.

Only if you have custom CSS, yes.

Wouldn't it be more consistent to allow something like this:

If by "consistent" you mean "convenient", then possibly.

In reality, though, you may want to determine the additional CSS to be
loaded based on programmatic conditions, like the current user theme,
or the current platform. Adding a bunch of conditions to the XML
instead of code is not going to help much in terms of making Glade
more useful.


[@] ebassi []

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