Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

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!

share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.