I have used Jono Bacons creating your first ubuntu application to discover how to theme toolbars using the ubuntu theme. I followed the exact same code and the program loads with a black toolbar, however the text on the buttons does not change colour and stays black.

This is an image of my apps issue:

Black text on ambiance

Jono's text colour however turns white when the style is changed.

This is the code I have used:

    self.mainToolbar = self.builder.get_object("mainToolbar")

    mainToolbarStyle = self.mainToolbar.get_style_context()

I have been tearing my hair out over this and I'm sure there is an easy solution.

Thanks very much for any help you can give!



I strangely fixed this issue by adding in a Menu Bar that I had removed at the start of my design. The text is now white. I would love to know what caused this!

  • I have the exact same problem in my app and adding menu bar solved it. As per Documentation: "A CSS class to match primary toolbars.This should be used for the 'main' toolbar of an application, right below its menubar." That explains it but it is really weird that we need to add a menubar to make it look good. – user8592 Jul 7 '12 at 8:29

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.