Xfce Forum

Sub domains
 

You are not logged in.

#1 2019-01-12 07:53:45

Von_Kossa
Member
Registered: 2011-02-14
Posts: 24

[Solved] xfce4-panel-4.13.4 (gtk3) cannot change font color

Hi!

I recently migrated to Xfce4-panel 4.13.4, and everything works well except that iḿ trying to change the font color on the panel.
Iḿ running gentoo with gtk+ 3.24 and have tried to put the following code in the gtk.css file:


.xfce4-panel    {
    color: #ffffff;
}

I have put the gtk.css file in the following places without success:
./config/gtk-3.0/gtk.css
/etc/gtk-3.0/gtk.css

Iḿ going nuts here, what do i do wrong?
Either the syntax is wrong in 3.24 or for some strange reason it doesnt read the gtk.css file.

Thanks in advance.

Last edited by Von_Kossa (2019-01-12 18:09:44)

Offline

#2 2019-01-12 12:31:44

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,491

Re: [Solved] xfce4-panel-4.13.4 (gtk3) cannot change font color

From https://developer.gnome.org/gtk3/stable … rties.html:

The color property specifies the color to use for text, icons and other foreground rendering.

So changing the color value will change more than just the font color.

Referencing just the .xfce4-panel class itself won't help since the color value won't affect it - you want to affect everything underneath it. The simple answer is:

.xfce4-panel * {
    color: #ffffff;
}

...but as you see, it will affect more than just the font color.

If you want to direct a font color change towards a specific plugin, you'll need to tailor the tweak to that plugin. Some examples:

/* clock text color */
#clock-button { color: #ffffff }

/* tasklist (window buttons) label text color */
.tasklist>*>box { color: #ffffff }

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

#3 2019-01-12 13:14:33

Von_Kossa
Member
Registered: 2011-02-14
Posts: 24

Re: [Solved] xfce4-panel-4.13.4 (gtk3) cannot change font color

Wonderful! Itś working. smile

It also maybe the clipman icon white! *lol*

Offline

#4 2019-01-12 13:18:40

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,491

Re: [Solved] xfce4-panel-4.13.4 (gtk3) cannot change font color

Von_Kossa wrote:

It also maybe the clipman icon white! *lol*

You can reverse this via:

#xfce4-clipman-plugin { color: #ff0000 }

...and change "#ff0000" to any color that you want.


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

#5 2019-01-12 13:19:02

Von_Kossa
Member
Registered: 2011-02-14
Posts: 24

Re: [Solved] xfce4-panel-4.13.4 (gtk3) cannot change font color

More specifically i want to make the "clock" plugin and the "action buttons" (log in/log out) plugins with white fonts.
How do i get the name for the plugin?

I noticed it also made the panel menus white, not exactly what i want.

Last edited by Von_Kossa (2019-01-12 13:19:47)

Offline

#6 2019-01-12 13:26:37

Von_Kossa
Member
Registered: 2011-02-14
Posts: 24

Re: [Solved] xfce4-panel-4.13.4 (gtk3) cannot change font color

Well, the clock is of course "clock-button" like you wrote above but the action buttons i don´t know.

Offline

#7 2019-01-12 13:27:31

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,491

Re: [Solved] xfce4-panel-4.13.4 (gtk3) cannot change font color

Von_Kossa wrote:

How do i get the name for the plugin?

To find the names of the CSS style classes, you can use the GTK Inspector. To use it, first quit the panel:

xfce4-panel -q

...the start it in inspector mode:

GTK_DEBUG=interactive xfce4-panel

More specifically i want to make the "clock" plugin and the "action buttons" (log in/log out) plugins with white fonts.

For the clock, as mentioned above, use:

#clock-button { color: #ffffff }

For the actions plugin, assuming its the username that is being displayed, use:

#actions-button { color: #ffffff }

I noticed it also made the panel menus white, not exactly what i want.

Yes.

ToZ wrote:

...but as you see, it will affect more than just the font color.

That's why you need to identify the specific plugins that you want to effect and tweak them.


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

#8 2019-01-12 13:30:00

Von_Kossa
Member
Registered: 2011-02-14
Posts: 24

Re: [Solved] xfce4-panel-4.13.4 (gtk3) cannot change font color

That did fix it! smile
Thank you for your help.

I think many people will want to know this when they migrate to gtk3, maybe make this post sticky?

Offline

#9 2019-01-12 13:48:02

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,491

Re: [Solved] xfce4-panel-4.13.4 (gtk3) cannot change font color

Von_Kossa wrote:

I think many people will want to know this when they migrate to gtk3, maybe make this post sticky?

We'll need more than a sticky post. This is only the tip of the iceberg. There are many posts in this forum on GTK3 theming of Xfce. And since Xfce is still in development, many of those are changing. When Xfce 4.14 is released an effort will need to be made to document these theming parameters.


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

#10 2019-04-01 18:22:27

gwhitney
Member
Registered: 2017-04-10
Posts: 3

Re: [Solved] xfce4-panel-4.13.4 (gtk3) cannot change font color

In particular it took me quite a while to figure out that custom CSS properties (i.e., the ones added in the application's code) must be prefixed with -[WIDGET_CLASS_NAME]- to be recognized. So for example, what used to be

style "my-xfce-tasklist-style"
{
    XfceTasklist::max-button-size = 72
}
class "XfceTasklist" style "my-xfce-tasklist-style"

in .gtkrc-2.0 should in .config/gtk-3.0/gtk.css become

.tasklist {
    -XfceTasklist-max-button-size:72;
}

This should definitely be clearly laid out in the upcoming documentation for 4.14. Thanks!
(Also, not sure if this is likely to be read by any developers, but while tracking this down I noted that the tasklist code still uses the "style_set" signal, which is deprecated in gtk 3; it should be replaced by "style_updated".)

Offline

#11 2019-04-01 20:17:03

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,491

Re: [Solved] xfce4-panel-4.13.4 (gtk3) cannot change font color

gwhitney wrote:

In particular it took me quite a while to figure out that custom CSS properties (i.e., the ones added in the application's code) must be prefixed with -[WIDGET_CLASS_NAME]- to be recognized. So for example, what used to be

style "my-xfce-tasklist-style"
{
    XfceTasklist::max-button-size = 72
}
class "XfceTasklist" style "my-xfce-tasklist-style"

in .gtkrc-2.0 should in .config/gtk-3.0/gtk.css become

.tasklist {
    -XfceTasklist-max-button-size:72;
}

This should definitely be clearly laid out in the upcoming documentation for 4.14. Thanks!

And thanks to you - I didn't know that you could use the widget name for these properties - though it makes a lot of sense.

(Also, not sure if this is likely to be read by any developers, but while tracking this down I noted that the tasklist code still uses the "style_set" signal, which is deprecated in gtk 3; it should be replaced by "style_updated".)

You should consider creating a bug report to bring it to the developer's attention. Better to fix it now rather than when GTK3 developers remove the code and leave us hanging.


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

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.009 seconds, 7 queries executed - Memory usage: 584.95 KiB (Peak: 601.79 KiB) ]