You are not logged in.

#1 2021-12-21 13:38:31

novice
Member
Registered: 2020-01-30
Posts: 16

[SOLVED] Is there a way to change gtk2 menu separator colour?

Is there a setting anywhere that can change the colour of menu separators in gtk2 apps?  I've looked at all the documentation I can find but there only seems to be settings for the thickness of the separators.  I'm using a theme based on Arch-Dark and the separators are barely visible in gtk2 menus.

Last edited by novice (2021-12-25 00:11:50)

Offline

#2 2021-12-21 18:51:22

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,435
Website

Re: [SOLVED] Is there a way to change gtk2 menu separator colour?

Can you provide an example or two of a gtk2 app?

Offline

#3 2021-12-21 19:05:22

hhh
Ol' Pink Eyes
Registered: 2015-09-17
Posts: 12,759
Website

Re: [SOLVED] Is there a way to change gtk2 menu separator colour?

^ +1 to a screenshot, and a link to the theme if possible.

I've been messing with Arc-Dark gtk2rc and the other rc files and assets for an hour, no luck. I thought it might be the asset image line-h.png, but no go (hmm, I might have edited line-v.png by mistake, line-h might be the fix). It's definitely theme-specific, Arc-Dark has no visible menu-separators AKAICT...

Mw9cwXwt.png

But this theme I made using Oomox from its Arc-Dark preset shows lovely separators in the menu...

lmgvUwht.png

In short, GTK theming, both 2 and 3, is an enormous PITA. The easiest workaround is to change themes till you find one that works.


Does your physical disability preclude you from coming to the point?

Offline

#4 2021-12-21 19:52:20

novice
Member
Registered: 2020-01-30
Posts: 16

Re: [SOLVED] Is there a way to change gtk2 menu separator colour?

It's the apps that come with BL that I use: BL Image Viewer, xfburn, filezilla etc.  I may have misled you with the theme name, it's not based on Arch-Dark, it's Archlabs-dark. The menu separators are virtually invisible against my dark menu background.  I don't know how to get those thumbnails but here's a link so you can see what I mean:

https://imgur.com/Ws3OCvI

Offline

#5 2021-12-21 20:04:12

hhh
Ol' Pink Eyes
Registered: 2015-09-17
Posts: 12,759
Website

Re: [SOLVED] Is there a way to change gtk2 menu separator colour?

^ Right, thanks. So there are separators there, but with crappy contrast. Like I said before, maybe editing /assets/line-h.png in GIMP will fix it, or else try a different theme.


Does your physical disability preclude you from coming to the point?

Offline

#6 2021-12-22 00:36:53

novice
Member
Registered: 2020-01-30
Posts: 16

Re: [SOLVED] Is there a way to change gtk2 menu separator colour?

Thanks.  That worked but only in Gimp, which funnily enough doesn't need it because for some reason it isn't following the theme and has lighter menus.  I Think you have pointed me in the right direction though, as looking at the rc files in the Gimp folder has given me an idea.  My brain is turning to mush now though so I'll have to try it in the morning.  I'll let you know how I do.

Offline

#7 2021-12-22 01:30:41

hhh
Ol' Pink Eyes
Registered: 2015-09-17
Posts: 12,759
Website

Re: [SOLVED] Is there a way to change gtk2 menu separator colour?

GTK will turn your brain to mush, guaranteed.


Does your physical disability preclude you from coming to the point?

Offline

#8 2021-12-22 19:58:35

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,435
Website

Re: [SOLVED] Is there a way to change gtk2 menu separator colour?

For start, the way to easily test if the app is actually using gtk2 is to
- make a user copy of the theme (. themes)
- rename the entry "Name=mine" in index.theme file
- enable it via lxapperance
- disable or rename all gtk2 or gtk3 dirs
- start your app and draw conclusions

Filezilla in bullseye is certainly gtk3 app.

Last edited by brontosaurusrex (2021-12-22 21:23:01)

Offline

#9 2021-12-24 13:27:14

novice
Member
Registered: 2020-01-30
Posts: 16

Re: [SOLVED] Is there a way to change gtk2 menu separator colour?

Thanks guys.  I've finally got it sorted.  Brontosaurusrex - I checked and it is gtk2 on mine.  I'm on buster though, not bullseye.  I thought I was onto something in trying to get it working like gimp does using the pixmap engine and a .png image for the line.  But I couldn't get it to work.
I could see that the separator was definitely been drawn using a colour from the theme.  I had tried earlier inserting a colour statement into the 'separator-menu-item' style but it didn't work.  So I started taking all the colour definitions in the 'menu' style, one by one, and inserting them into the separator style with the colour changed to what I wanted, until I found the one which was being used for the separator - voilà.  I can't believe I was so close at the start and went through all that effort just to come back to the beginning.  If there was better documentation it would be so easy.  Anyway, if there are any more obsessives like me out there who like spending their time changing colours in out of date graphic engines, this is how to change separator colours in gtk2 (in ArchLabs-Dark theme at least).

style "murrine-separator-menu-item" = "murrine-thin" {
    bg[NORMAL] = your colour
    }

Bye the way.  A bit off topic but in the gtk3 .css, the colour assignments at the beginning such as:

@define-color theme_bg_color #2b303b;

What are they for?  The assignment isn't used anywhere in the file.  Are they there to be read externally by gtk?

Offline

Board footer

Powered by FluxBB