4

I've recently updated a few programs to gtk3 (deadbeef gtk3 plugin, pcmanfm-gtk3, l3afpad) and there's one thing that's really been bugging me:

Why is the Statusbar thrice the height of the gtk2 version?

It's clearly not because there's more information or a bigger font - the text is the same for both versions, it's just a 10 px margin for the statusbar in gtk3. So I thought "hey, gtk3 has some nice CSS, maybe I can tweak that with gtk.css oder settings.ini" - turns out that nah, not really. Any stuff in gtk.css like

    GtkStatusbar { margin:0px; margin-top:0px; margin-bottom:0px; }

doesn't do anything, sadly.

So I tried playing around with GtkInspector in pcmanfm. When I select the whole Statusbar element (you have to select the whitespace between the left and the right labels, only 10 px wide) and I check the properties, I see theres a 10 px value for all margins defined for GtkWidget (except for bottom and top, those are 6). Now if I doubleclick that value and set "all margins" to 0 it immediately gives me a gtk2 statusbar - rejoice!

So I know it is possible, but I just haven't found a way to get that into gtk.css. I got desperate enough to try:

GtkWidget { margin:0px; margin-top:0px; margin-bottom:0px; }

but I didn't really expect it to work - so of course it didn't.

I've also tried searching for solutions online, but I've only ended up with a few very specific tips to downgrade eclipse from gtk3 to gtk2 in order to save screen space or this patch to engrampa that removes those margins.

Hell, it could be there's some GUI-Tool for GNOME that does this in like 5 seconds, and I've been searching for the wrong stuff all along.

5
  • You should mention your version of GTK3: dpkg -l libgtk-3-0
    – DK Bose
    Mar 20, 2016 at 14:03
  • 1
    gtk3 version is 3.18.9-1 - I'm on archlinux
    – Spleen
    Mar 20, 2016 at 15:50
  • Sorry to bug you without providing an answer, but which theme are you using? Some themes are difficult to tweak. These themes have gtk3 files like *.scss (Arc or Numix) or have binary "blobs" (Adwaita).
    – DK Bose
    Mar 22, 2016 at 5:32
  • I'm using Numix (with gtk-application-prefer-dark-theme=1, so its the dark one) - but in /usr/share/themes/Numix/gtk-3.0/ I couldnt find any *.scss-files, just the normal *.css ones
    – Spleen
    Mar 22, 2016 at 16:25
  • 2
    after updating gtk to 3.20 and numix to 2.5.1 - now everthing is huge. this would look really lovely with 2x the font size on 4k, but on 1080p it just redefined waste of space for me...
    – Spleen
    Apr 14, 2016 at 19:31

1 Answer 1

0

This helps somewhat:

gtk_widget_set_margin_top(GTK_WIDGET(statusbar), 0);
gtk_widget_set_margin_bottom(GTK_WIDGET(statusbar), 0);
2
  • uhm, that doesnt look like css or ini-code or anything I can change as a user. is this code that the maintainer could use to reduce the margin?
    – Spleen
    Aug 14, 2018 at 16:42
  • No, it has to be set in the program code. This is not configureable through CSS.
    – Thomas F.
    Aug 16, 2018 at 16:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .