Change colour of title bar close button background [SOLVED]

Please post suggestions for improvement of Cinnamon here
https://github.com/linuxmint/Cinnamon
Post Reply
zimbo
Level 1
Level 1
Posts: 18
Joined: Mon Jan 19, 2009 6:14 pm

Change colour of title bar close button background [SOLVED]

Post by zimbo » Fri Aug 23, 2019 5:14 am

I'm tweaking my desktop setup after upgrading to LM 19.2 but I'm unsure how to change one aspect of it.

Below is a link to an image that shows the buttons on the focused and unfocused title bars and it is the background of the close button on the focused title bar (the blue one) that I wish to change. As the button background is also blue it isn't very prominent.

https://my.owndrive.com/index.php/s/cs9F9iknwaPipPY

I'm running LM 19.2 Cinnamon with the following Theme options:
Windows Borders - Mint-Y-Dark
Controls - Mint-Y-Dark-Blue
Desktop - Mint-Y-Dark-Blue

The title bar colours I've changed were all done fairly easily by changing colour values in /usr/share/themes/metacity-1/metacity-theme-3.xml

However, no changes I made in that file made a difference to the close button.

After searching on the internet I found a reference that said the overall windows borders colour is taken from the Theme-Controls selection, in my case Mint-Y-Dark-Blue.

I made some test changes in Mint-Y-Dark-Blue/gtk-3.0/gtk.css but again couldn't find one that made any difference to the close button. I even changed the colour of some of the images in Mint-Y-Dark-Blue/gtk-3.0/assets in case they are used in the title bar but that also made no difference.

Can someone who has a better understanding off how these themes are put together point me in the right direction?

Thanks for any help with this.
Last edited by zimbo on Mon Aug 26, 2019 7:27 am, edited 1 time in total.

sjsepan
Level 1
Level 1
Posts: 2
Joined: Fri Aug 23, 2019 10:07 am

Re: Change colour of title bar close button background

Post by sjsepan » Sun Aug 25, 2019 9:31 pm

Have you looked at /usr/share/themes/Mint-Y-Dark-Blue/metacity-1/metacity-theme-2.xml? (There is only version 2 of the xml in my copy of 19.2 Cinnamon). Line 23 starts close button colors (i.e. #5b73c4;). Hope this helps...

--Steve

User avatar
smurphos
Level 12
Level 12
Posts: 4045
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher
Contact:

Re: Change colour of title bar close button background

Post by smurphos » Sun Aug 25, 2019 11:03 pm

Cinnamon normally uses the metacity-theme-3.xml which should ship with the mint themes. It derives the close button colour from the exported selected_bg_color from the GTK3 theme. The exported color definitions are found right at the end of gtk.css.

You can either edit the gtk.css to change the exported color or edit metacity-theme-3.xml to replace the imported color definitions with your own preference.
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.

zimbo
Level 1
Level 1
Posts: 18
Joined: Mon Jan 19, 2009 6:14 pm

Re: Change colour of title bar close button background

Post by zimbo » Mon Aug 26, 2019 7:25 am

Thanks for pointing me in the right direction. The two lines in Mint-Y-Dark/metacity-1/metacity-theme-3.xml that deal with the close button are

<constant name="C_button_close_bg_focused" value="gtk:custom(selected_bg_color,#92b372)" />
<constant name="C_button_close_bg_hover" value="shade/gtk:custom(selected_bg_color,#92b372)/1.14" />

and I see that they should take their colour from selected_bg_color in the gtk.css file. However, when I changed the defined value of selected_bg_color it made no difference to the background of the close button. So instead I decided to amend the above two lines and that resolved the issue, the lines are now:

<constant name="C_button_close_bg_focused" value="#db787f" />
<constant name="C_button_close_bg_hover" value="shade/#db787f/0.8" />

Post Reply

Return to “Cinnamon”