Xfce Forum

Sub domains
 

You are not logged in.

#1 2023-06-19 09:30:02

jt1122
Member
Registered: 2021-03-26
Posts: 245

Changing window title button size

Hi,

How can the size of the min-max-close buttons in the window title be changed?.

I've added

button.titlebutton {
    min-height: 32px;
    min-width: 32px;
    padding: 0;
}

to ~/.config/gtk-3.0/gtk.css but nothing happened.

Thanks

Offline

#2 2023-06-19 10:39:45

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

Re: Changing window title button size

For the older server side decorations (SSD), you need to edit the xfwm4 theme control elements.

For the newer client server decorations (CSD), it would depend on the theme. Some themes (e.g. Greybird) use assets to manage those buttons (have a look at Greybird's gtk-3.0/assets folder), others could use default values. The snippet you've shown is for CSD-type windows. If your theme doesn't use assets, then I would suggest using -gtk-icon-transform (at the risk of blurring the image, and something like):

button.titlebutton image {
    min-height: 32px;
    min-width: 32px;
    padding: 0;
    -gtk-icon-transform: scale(1.5);
}

...and adjust the "1.5" and min-width/height values to suit.


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 2023-06-19 10:48:14

jt1122
Member
Registered: 2021-03-26
Posts: 245

Re: Changing window title button size

Thanks.
I've updated the theme's gtk.css file.

Is there a way to test the effect w/o a logout+login ?.

Offline

#4 2023-06-19 11:47:20

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

Re: Changing window title button size

Depends on how/where you are testing it. If its an app, just restart the app - it should read the new content in gtk.css. I usually test via the Gtk Inspector. With the keybinding enabled, I press the key shortcut to open the inspector and add the code into the CSS tab. The effect is immediate.


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 2023-06-19 11:50:59

jt1122
Member
Registered: 2021-03-26
Posts: 245

Re: Changing window title button size

Thanks.

As mentioned I've updated the theme's css file :~/.themes/t/gtk-3.0/gtk.css but I don't see any changes to the windows' buttons.
Shouldn't all windows on-screen be affected?.

Offline

#6 2023-06-19 12:50:22

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

Re: Changing window title button size

jt1122 wrote:

Shouldn't all windows on-screen be affected?.

Only CSD (client side decorated) windows will be affected. Can you give an example of an app that you want to apply this effect to and maybe a screenshot?


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

#7 2023-06-19 18:39:18

jt1122
Member
Registered: 2021-03-26
Posts: 245

Re: Changing window title button size

I'm using a theme named "xfce-theme-greyleigh-master".

I'd like to have enlarged window buttons (for all apps).

I've added to ~/.themes/xfce-theme-greyleigh-master/gtk-3.0/gtk.css:

button.titlebutton {
    min-height: 40px;
    min-width: 40px;
    padding: 0;
}
 
button.titlebutton image{
    min-height: 40px;
    min-width: 40px;
    padding: 0;
    -gtk-icon-transform: scale(4);
}

but nothing changes.

Offline

#8 2023-06-19 20:14:16

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

Re: Changing window title button size

jt1122 wrote:

I'd like to have enlarged window buttons (for all apps).

If they are SSD (apps that use server side decorations - the older window manager decorations), then go to Settings Manager > Window Manager > Style and choose a different Window Manager theme - one with larger buttons (there should be a "Default-hdpi" and "Default-xhdpi" themes that you can try).

If you want to try the snippet you've created with CSD windows, try this to see what it looks like:

thunar -q
GTK_CSD=1 thunar

Getting both types of applications to have the same window decorations will be a challenge, unless you use a theme that is built to support both, or you convert your system to use only SSD or only CSD.


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

#9 2023-06-19 23:25:30

eight.bit.al
Member
Registered: 2022-06-09
Posts: 79

Re: Changing window title button size

ToZ wrote:

or you convert your system to use only SSD or only CSD.

I have been struggling with this to no avail; maybe at 71, my mind doesn't remember/understand as well as it used to.
Please elaborate on how to do this. TIA

8bit


Fight against surveillance capitalism.

Offline

#10 2023-06-20 01:06:26

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

Re: Changing window title button size

First, some background information:

  • SSD (Server side decorations) are window decorations that are drawn by the window manager - in our case, xfwm4. These decorations are managed via xfwm4 themes.
    .

  • CSD (Client side decorations) are window decorations that are drawn by the application itself. These are managed via css directives in the theme files (gtk.css).

To make all GTK applications you use SSD, you need to install and enable a hack like gtk3-nocsd. I don't have any experience with this, but there are some instructions at that link. What that does is wrap SSD around CSD windows so that you can manage them like SSD.

To make all of your windows use CSD, you need to set a global environment variable GTK_CSD=1. In Arch, I've created an /etc/profile.d/csd.sh file with the following content:

export GTK_CSD=1

This means that SSD windows will have CSD wrappers put around them and the window decorations managed by gtk.css directives. Caveat, I don't use any QT apps so I'm not sure how they interact with these settings or if there are some special configuration settings that might help, but I would like to draw attention to this Arch Wiki article that discusses this issue.


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

#11 2023-06-22 21:02:13

eight.bit.al
Member
Registered: 2022-06-09
Posts: 79

Re: Changing window title button size

^Thanks for the info.

I've read about gtk3-nocsd, at the time was running Debian 11, and it wasn't in the repo. Now running Debian 12 (MX Linux) and it is in the repo.
Before installing:
ekT8fG4.png
Top is controlled by xfwm4 and the bottom one is Firefox.
Installed gtk3-nocsd and everything looked like Firefox.

Installed Sparky Linux 8 (trixie) on another machine and everything followed xfwm4.
in /etc/environment, there''s a setting:
QT_QPA_PLATFORMTHEME=qt5ct

But it had no effect on MX, nor did export GTK_CSD=1

The saga continues. Thanks again.

8bit


Fight against surveillance capitalism.

Offline

#12 2023-06-22 23:52:05

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

Re: Changing window title button size

Specifically for firefox, you can change the window decoration by rick-clicking in the toolbar and selecting Customize Toolbar, and then enabling the "Title Bar" option at the bottom-left of the window.

nor did export GTK_CSD=1

Where did you put this? After re-logging in, does it show up in your environment variables?

env | grep GTK

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.015 seconds, 7 queries executed - Memory usage: 589.72 KiB (Peak: 606.56 KiB) ]