Re: Custom CSS in GtkBuilder XML



Hi;

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
so:

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

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

Correct.

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.

Ciao,
 Emmanuele.

-- 
https://www.bassi.io
[@] ebassi [@gmail.com]


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