Commit 77edb9b6 authored by VIGNET Pierre's avatar VIGNET Pierre
Browse files

Add mouse scroll event/zoom on overview

parent 028c9fdb
......@@ -220,6 +220,8 @@ class Charter(object):
# overview
self.overview_window = self.wtree.get_widget("Overview")
self.overview_window.connect('scroll-event',
self.on_button_scroll_event)
def check_curent_model(function):
......@@ -370,6 +372,12 @@ class Charter(object):
bhan = but.connect("clicked", self.current_edit_mvc.zoom_minus)
self.button_handlers["zoom_m"] = (but, bhan)
def on_button_scroll_event(self, widget, event):
"""Handle zoom based on mouse scroll event on the overview"""
if event.direction == gtk.gdk.SCROLL_UP:
self.current_edit_mvc.zoom_plus(widget)
elif event.direction == gtk.gdk.SCROLL_DOWN:
self.current_edit_mvc.zoom_minus(widget)
def add_image(self, widget, image_file):
"""Add image to a Button
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment