Geordie Fischer
Geordie Fischer

Reputation: 117

Glade - Sidebar for GtkStack

Several GTK3 Programs such as Gedit have a sidebar.
Screenshot
I've noticed that this seems to behave like a GtkPaned, somehow with CSD enabled. Is it possible to do this in Glade, or do I have to add it in the code (Vala, if it matters). If this helps at all, there seems to be a quirk with gedit that makes the controls disappear altogether if they are set to the left and the side panel is enabled.

Upvotes: 1

Views: 1233

Answers (1)

Jussi Kukkonen
Jussi Kukkonen

Reputation: 14587

This design requires some effort from the app and the final details might not be completely doable in Glade alone: What looks like a headerbar is actually a GtkPaned with two headerbars in it. The left headerbar and the document pane are in the same size group and have their visibility properties bound together. The tricky part is making sure the headerbars don't contain duplicate default items while still making sure custom decoration layouts work (this is where it sounds like you found a bug).

Search for side_headerbar in gedit/resources/ui/gedit-window.ui and gedit/gedit-window.c in GEdit source code and you'll see the details.

Upvotes: 1

Related Questions