Replace "expose-event" signal by a new "draw" signal
GtkWidget "expose-event" signal has been replaced by a new "draw" signal [1]. The context is already clipped [2], so do not base it on the values returned by get_allocation like before. [1] http://developer.gnome.org/gtk3/3.0/ch25s02.html#id1467092 [2] http://developer.gnome.org/gtk3/3.0/GtkWidget.html#GtkWidget-draw Signed-off-by: Simon Schampijer <simon@schampijer.de> [squashed with a patch by Benjamin Berg <benjamin@sipsolutions.net>; removed useless additions] Signed-off-by: Sascha Silbe <silbe@activitycentral.com>
This commit is contained in:
@@ -385,7 +385,7 @@ class Icon(Gtk.Image):
|
||||
width = 0
|
||||
return (width, width)
|
||||
|
||||
def do_expose_event(self, event):
|
||||
def do_draw(self, cr):
|
||||
"""
|
||||
Parameters
|
||||
----------
|
||||
@@ -414,8 +414,6 @@ class Icon(Gtk.Image):
|
||||
y = math.floor(ypad +
|
||||
(allocation.height - requisition.height) * yalign)
|
||||
|
||||
cr = self.get_window().cairo_create()
|
||||
|
||||
if self._scale != 1.0:
|
||||
cr.scale(self._scale, self._scale)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user