getsolus / brisk-menu

An efficient menu for the MATE Desktop
GNU General Public License v2.0
53 stars 18 forks source link

Fix for categories list always showing a scrollbar #13

Closed gabrielfin closed 5 years ago

gabrielfin commented 5 years ago

This is a fix for an issue from the old repo: solus-project/brisk-menu#83

The problem is that gtk_widget_get_preferred_height expects the height to include the border width as well. Therefore, on themes* that have a border around BriskMenuSidebarScroller, the scroller will always be a few pixels shorter.

(*) https://github.com/ubuntu-mate/ubuntu-mate-artwork/blob/master/usr/share/themes/Ambiant-MATE/gtk-3.0/apps/mate-applications.css#L694

kyrios123 commented 5 years ago

Unfortunately it doesn't seem to work on my test VM

image

gabrielfin commented 5 years ago

That's Adapta, right? The issue still occured because that theme adds a margin to BriskMenuSidebarScroller. So I added margin and padding to the height calculation as well.

It's not very pretty, I know very little about Gtk. Maybe there's a nicer way to solve this?

kyrios123 commented 5 years ago

LGTM. It works fine with Adapta and I haven't noticed regression with a few other random themes. Can be merged if @JoshStrobl agrees.

JoshStrobl commented 5 years ago

This is probably how I would've done it as well, to be fair. LGTM, thanks for the PR!