Philipp Hörist pushed to branch master at gajim / gajim
Commits: 358d410d by Philipp Hörist at 2017-04-19T16:58:16+02:00 Get rid of cairo dependency
- - - - - c5aa507e by Philipp Hörist at 2017-04-19T17:10:01+02:00 Remove timeout id after AvatarWindow is shown
- - - - -
3 changed files:
- src/chat_control.py - src/dialogs.py - src/gtkgui_helpers.py
Changes:
===================================== src/chat_control.py ===================================== --- a/src/chat_control.py +++ b/src/chat_control.py @@ -1671,6 +1671,8 @@ class ChatControl(ChatControlBase): dialogs.BigAvatarWindow(avatar_pixbuf, pos_x, pos_y, avatar_w, avatar_h, self.show_avatar)
+ self.show_bigger_avatar_timeout_id = None + def _on_send_file_menuitem_activate(self, widget): self._on_send_file()
===================================== src/dialogs.py ===================================== --- a/src/dialogs.py +++ b/src/dialogs.py @@ -34,7 +34,6 @@ from gi.repository import Gdk from gi.repository import GdkPixbuf from gi.repository import GObject from gi.repository import GLib -import cairo import os import nbxmpp import time @@ -5688,28 +5687,21 @@ class BigAvatarWindow(Gtk.Window): self.callback = callback self.screen = self.get_screen() self.visual = self.screen.get_rgba_visual() - if self.visual != None and self.screen.is_composited(): + if self.visual is not None and self.screen.is_composited(): self.set_visual(self.visual) self.set_app_paintable(True) self.set_size_request(width, height) self.move(pos_x, pos_y) - self.connect("draw", self.area_draw) # we should hide the window self.connect('leave_notify_event', self._on_window_avatar_leave_notify) self.connect('motion-notify-event', self._on_window_motion_notify) self.realize() # make the cursor invisible so we can see the image - invisible_cursor = gtkgui_helpers.get_invisible_cursor() - self.get_window().set_cursor(invisible_cursor) + self.get_window().set_cursor( + Gdk.Cursor.new(Gdk.CursorType.BLANK_CURSOR)) + self.add(Gtk.Image.new_from_pixbuf(self.avatar)) self.show_all()
- def area_draw(self, widget, cr): - cr.set_source_rgba(.2, .2, .2, 0.0) - cr.set_operator(cairo.OPERATOR_SOURCE) - Gdk.cairo_set_source_pixbuf(cr, self.avatar, 0, 0) - cr.paint() - cr.set_operator(cairo.OPERATOR_OVER) - def _on_window_avatar_leave_notify(self, widget, event): """ Just left the popup window that holds avatar
===================================== src/gtkgui_helpers.py ===================================== --- a/src/gtkgui_helpers.py +++ b/src/gtkgui_helpers.py @@ -486,14 +486,6 @@ def get_pixbuf_from_data(file_data, want_type = False): else: return pixbuf
-def get_invisible_cursor(): - import cairo - s = cairo.ImageSurface(cairo.FORMAT_A1, 1, 1) - cursor_pixbuf = Gdk.pixbuf_get_from_surface(s, 0, 0, 1, 1) - cursor = Gdk.Cursor.new_from_pixbuf(Gdk.Display.get_default(), \ - cursor_pixbuf, 0, 0) - return cursor - def get_cursor(attr): display = Gdk.Display.get_default() cursor = getattr(Gdk.CursorType, attr)
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/86e29fb7f460a9a93fe5af8981b041122d...