~mvo/software-center/spinner-fixes

« back to all changes in this revision

Viewing changes to softwarecenter/ui/gtk3/widgets/buttons.py

  • Committer: Michael Vogt
  • Date: 2012-02-16 20:16:43 UTC
  • mfrom: (2768.1.1 tweaks)
  • Revision ID: michael.vogt@ubuntu.com-20120216201643-im4j11gt1wpu6t8c
* softwarecenter/ui/gtk3/widgets/buttons.py:
  - draw the backgrounds of the channel selector menus (LP: #921477)

Show diffs side-by-side

added added

removed removed

Lines of Context:
451
451
        self.popup = Gtk.Menu()
452
452
        self.build_func(self.popup)
453
453
        self.popup.attach_to_widget(self, None)
 
454
        # draw themed bg for the popup menu to workaround bug
 
455
        #  #921477 - that looks like its actually a theme bug
 
456
        context = self.get_ancestor('GtkToolbar').get_style_context()
 
457
        color = context.get_border_color(Gtk.StateFlags.ACTIVE)
 
458
        def draw(widget, cr):
 
459
            a = widget.get_allocation()
 
460
            cr.set_source_rgba(color.red, color.green, color.blue, color.alpha)
 
461
            cr.rectangle(0, 0, a.width, a.height)
 
462
            cr.fill()
 
463
        self.popup.connect('draw', draw)
454
464
        return
455
465
 
456
466