Xfce Forum

Sub domains
 

You are not logged in.

#1 2018-07-03 03:58:54

memeplex
Member
Registered: 2013-11-21
Posts: 15

Set style of XFCE UI element knowing its class and property

In general, I would like to understand how to change the style of elements in the latest (gtk3) development versions of XFCE. But to keep the question focused I'm going to ask for a particular case: changing the icon size of the alt-tab window switcher.

The code is [here](https://git.xfce.org/xfce/xfwm4/tree/src/tabwin.c). One can see that a class is registered with name `XfwmTabwinWidget` and later a property `icon-size` for that class is added:

    ...
            type = g_type_register_static (GTK_TYPE_WINDOW, "XfwmTabwinWidget", &info, 0);
    ...
        gtk_widget_class_install_style_property (widget_class,
                                                 g_param_spec_int ("icon-size",
                                                                   "icon size",
                                                                    "the size of the application icon",
                                                                    24, 128,
                                                                    WIN_ICON_SIZE,
                                                                    G_PARAM_READABLE));
    ...

Now, my first (and only) attempt was to add the following to `~/.config/gtk-3.0/gtk.css`:

    XfwmTabwinWidget {
        icon-size: 128px;
    }

But I get


    (xfwm4:28535): Gtk-WARNING **: 00:35:08.156: Theme parsing error: gtk.css:2:13: 'icon-size' is not a valid property name

Well, that was the example but, returning to the general case, how do I change the style of a property of some element once I have the relevant fragments of source code (as the ones above).

Offline

#2 2018-07-03 11:04:01

alcornoqui
Member
Registered: 2014-07-28
Posts: 831

Re: Set style of XFCE UI element knowing its class and property

Not my area of expertise, but maybe the info in this thread helps...

Offline

#3 2018-07-03 20:22:14

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Set style of XFCE UI element knowing its class and property

I would have thought that something like this:

* {
-Xfwm4TabwinWidget-icon-size: 48;
-Xfwm4TabWinWidget-preview-size: 256;
}

...would have worked, but it doesn't. The GTK Inspector doesn't seem to work with xfwm4 (probably because its a daemon) so I can't check using that method either.

Perhaps ask the developers at the xfce4-dev mailing list and see what they say.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#4 2018-07-04 22:54:00

memeplex
Member
Registered: 2013-11-21
Posts: 15

Re: Set style of XFCE UI element knowing its class and property

I tried to subscribe to the dev list yesterday and again today but no subscription email ever arrives.

Offline

#5 2018-07-04 23:31:24

memeplex
Member
Registered: 2013-11-21
Posts: 15

Re: Set style of XFCE UI element knowing its class and property

Btw, your example does work but you have to remove the 4 in Xfwm4.

Nevertheless I get some blurred icons when increasing the size, for example the one for emacs. This also happens in plasma (but not in gnome not cinnamon) and I remember having read that it's due to the fact that plasma is using the icon embedded as a resource of the window itself, they argued it was the "right thing to do" (TM) but certainly it's not the right thing to look at.

Offline

#6 2018-07-04 23:32:37

memeplex
Member
Registered: 2013-11-21
Posts: 15

Re: Set style of XFCE UI element knowing its class and property

Offline

#7 2018-07-04 23:42:27

memeplex
Member
Registered: 2013-11-21
Posts: 15

Re: Set style of XFCE UI element knowing its class and property

I've reported it for xfce too: https://bugzilla.xfce.org/show_bug.cgi?id=14518

Offline

#8 2018-07-05 00:21:41

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Set style of XFCE UI element knowing its class and property

memeplex wrote:

Btw, your example does work but you have to remove the 4 in Xfwm4.

So close. Thanks for the info - it works here for me as well.

Nevertheless I get some blurred icons when increasing the size, for example the one for emacs. This also happens in plasma (but not in gnome not cinnamon) and I remember having read that it's due to the fact that plasma is using the icon embedded as a resource of the window itself, they argued it was the "right thing to do" (TM) but certainly it's not the right thing to look at.

Try a different icon theme. My emacs icon doesn't look blurry (using the Vibrancy icon set). Perhaps your icon theme doesn't have a properly scaled emacs icon available?


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

Board footer

Powered by FluxBB