In my application toolbar, I have two toolbar buttons Travel Planner and Departures as shown below,

enter image description here

I need to change it this,

enter image description here

As you can see in the 2nd image, it seems that 1 button has 3 actions combined in them. It is also similar to the Gnome Control Center style.

How can this be done?


This can be done directly through Glade.

Build and select your toolbar. In the right select the common tab and add the line inline-toolbar to the Style classes.

enter image description here

Note that you won't see anything different in the editor itself, but only when you run the application or through the builtin previewer.

If you build your interface by hand, you have to set the style class manually like this:

# You take care of getting the toolbar ofcourse
context = toolbar.get_style_context()

More style classes can be found in the documentation.

  • I couldn't do this using glade (12.04 Precise) since it does not have the Style Classes option. I could however set it using my python code. When I apply this though I lose the black background color which signifies the applications' main toolbar. Is there a way to combine both the styles together? – nik90 Feb 9 '13 at 16:42

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.