[gedit-plugins] Direct access to union attributes.



commit 40fddb7796faa3b636b833a0c0d7fe981f9b3e3c
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Wed Mar 2 15:34:49 2011 +0100

    Direct access to union attributes.
    
    We needed to access .key due to a pygobject bug that it is now fixed.

 plugins/synctex/synctex/synctex.py          |    4 ++--
 plugins/textsize/textsize/documenthelper.py |   10 +++++-----
 2 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/plugins/synctex/synctex/synctex.py b/plugins/synctex/synctex/synctex.py
index ecce025..a7b605c 100644
--- a/plugins/synctex/synctex/synctex.py
+++ b/plugins/synctex/synctex/synctex.py
@@ -103,8 +103,8 @@ class SynctexViewHelper:
 
     def on_button_release(self, view, event):
         modifier_mask = Gtk.accelerator_get_default_mod_mask()
-        event_state = event.button.state & modifier_mask
-        if event.button.button == 1 and event_state == Gdk.ModifierType.CONTROL_MASK:
+        event_state = event.state & modifier_mask
+        if event.button == 1 and event_state == Gdk.ModifierType.CONTROL_MASK:
             self.sync_view()
 
     def on_saved_or_loaded(self, doc, data):
diff --git a/plugins/textsize/textsize/documenthelper.py b/plugins/textsize/textsize/documenthelper.py
index 0296961..8877172 100644
--- a/plugins/textsize/textsize/documenthelper.py
+++ b/plugins/textsize/textsize/documenthelper.py
@@ -157,24 +157,24 @@ class DocumentHelper(Signals):
                 buf.remove_tag(tag, bounds[0], bounds[1])
 
     def on_scroll_event(self, view, event):
-        state = event.scroll.state & Gtk.accelerator_get_default_mod_mask()
+        state = event.state & Gtk.accelerator_get_default_mod_mask()
 
         if state != Gdk.ModifierType.CONTROL_MASK:
             return False
 
-        if event.scroll.direction == Gdk.ScrollDirection.UP:
+        if event.direction == Gdk.ScrollDirection.UP:
             self.increase_font_size()
             return True
-        elif event.scroll.direction == Gdk.ScrollDirection.DOWN:
+        elif event.direction == Gdk.ScrollDirection.DOWN:
             self.decrease_font_size()
             return True
 
         return False
 
     def on_button_press_event(self, view, event):
-        state = event.button.state & Gtk.accelerator_get_default_mod_mask()
+        state = event.state & Gtk.accelerator_get_default_mod_mask()
 
-        if state == Gdk.ModifierType.CONTROL_MASK and event.button.button == 2:
+        if state == Gdk.ModifierType.CONTROL_MASK and event.button == 2:
             self.reset_font_size()
             return True
         else:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]