2

On my Elementary OS Freya dconf Editor have less height than others applications (for example atom or chromium) and I prefer this smaller appearance. I wonder what css or xml file I have to edit in order to achieve it, is it possible?

2

I had the same problem with Visual Studio Code, except that I'm using Loki, but I don't see why it won't work with Freya.

Go to /usr/share/themes/elementary/gtk-3.0 and add this inside apps.css :

.header-bar.default-decoration {
    padding-top: 2px;
    padding-bottom: 2px;
}

.header-bar.default-decoration .button.titlebutton {
    padding-top: 2px;
    padding-bottom: 2px;
}

Just play with the padding to get the desired height.

Do not forget to restart Gala, after you've edited the file. Not sure why, but some apps such as Terminal and File Manager won't get affected.

Source : https://bbs.archlinux.org/viewtopic.php?pid=1518845#p1518845


UPDATE

This trick doesn't work with GTK3.18+, so if you're using 3.19 or 3.20, please use this css code instead.

/* shrink headerbars */
headerbar {
    min-height: 0px;
    padding-left: 2px; /* same as childrens vertical margins for nicer proportions */
    padding-right: 2px;
    background-color: #2d2d2d;
}

headerbar entry,
headerbar spinbutton,
headerbar button,
headerbar separator {
    margin-top: 0px; /* same as headerbar side padding for nicer proportions */
    margin-bottom: 0px;
}

/* shrink ssd titlebars */
.default-decoration {
    min-height: 0; /* let the entry and button drive the titlebar size */
    padding: 0px
    background-color: #2d2d2d;
}

.default-decoration .titlebutton {
    min-height: 0px; /* tweak these two props to reduce button size */
    min-width: 0px;
}

window.ssd headerbar.titlebar {
    padding-top: 3px;
    padding-bottom: 3px;
    min-height: 0;
}

window.ssd headerbar.titlebar button.titlebutton {
    padding-top: 3px;
    padding-bottom:3px;
    min-height: 0;
}

Source : https://ogbe.net/blog/gnome_titles.html & https://www.reddit.com/r/gnome/comments/46gplm/does_anyone_know_how_to_decrease_titlebar_height/?sort=old

  • I have a few questions. In gtk-3.0 directory are several – daGo May 7 '17 at 20:44
  • Ooops sorry, totally forgot to say which file to edit... :) It's the 'apps.css' file – priesto May 7 '17 at 20:45
  • sudo vim /usr/share/themes/elementary/gtk-3.0/apps.css Added this snippet at the beginning of this file and saved it. Restarted Gala by sudo service lightdm restart Opened Atom, Firefox, dconf - there are no changes, maybe I've something missed? PS. Even added !important - just for a good measure, but it didn't the trick :( – daGo May 7 '17 at 21:08
  • With GTK3.18+ this doesn't work, could you tell me which version you're using by typing this command : dpkg -s libgtk-3-0 | grep '^Version' – priesto May 8 '17 at 14:19
  • Version: 3.14.15-0ubuntu1~14.04~ricotz1 (since I'm using Freya I believe it's impossible to upgrade GTK further without crashing). I wonder why very first code failed, though. Maybe it requires at least 3.16 or something... – daGo May 9 '17 at 8:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.