3

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()
    mainToolbarStyle.add_class(Gtk.STYLE_CLASS_PRIMARY_TOOLBAR)

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!

Andrew

1 Answer 1

1

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!

1
  • 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, 2012 at 8:29

You must log in to answer this question.

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