~mmcg069/software-center/Bug846204

« back to all changes in this revision

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

  • Committer: Matthew McGowan
  • Date: 2011-09-20 20:53:11 UTC
  • mfrom: (2362.10.2 trunk)
  • mto: This revision was merged to the branch mainline in revision 2397.
  • Revision ID: matthew.joseph.mcgowan@gmail.com-20110920205311-lrdoiz3l4su2wu44
merge w trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
from softwarecenter.utils import SimpleFileDownloader
33
33
from softwarecenter.ui.gtk3.em import StockEms
34
34
from softwarecenter.ui.gtk3.shapes import Circle
 
35
from softwarecenter.ui.gtk3.drawing import rounded_rect
 
36
from softwarecenter.ui.gtk3.utils import point_in
35
37
import softwarecenter.paths
36
38
 
37
39
_asset_cache = {}
309
311
        window.set_cursor(None)
310
312
        return
311
313
 
312
 
    def on_button_release(self, *args):
 
314
    def on_button_release(self, widget, event):
 
315
        if not point_in(self.get_allocation(),
 
316
                        int(event.x), int(event.y)):
 
317
            return
 
318
 
313
319
        exhibit = self.exhibits[self.cursor]
314
320
        if exhibit.package_names:
315
321
            self.emit("show-exhibits-clicked", exhibit)
480
486
            Gdk.cairo_set_source_pixbuf(cr, self.image, x, y)
481
487
            cr.paint_with_alpha(self.alpha)
482
488
 
 
489
        if self.has_focus():
 
490
            # paint a focal border/frame
 
491
            context = self.get_style_context()
 
492
            context.save()
 
493
            context.add_class(Gtk.STYLE_CLASS_HIGHLIGHT)
 
494
            highlight = context.get_background_color(self.get_state_flags())
 
495
            context.restore()
 
496
 
 
497
            rounded_rect(cr, 1, 1, a.width-2, a.height-3, 5)
 
498
            Gdk.cairo_set_source_rgba(cr, highlight)
 
499
            cr.set_line_width(6)
 
500
            cr.stroke()
 
501
 
483
502
        # paint dropshadows last
484
503
        #~ cr.rectangle(0, 0, a.width, self.DROPSHADOW_HEIGHT)
485
504
        #~ cr.clip()