Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
VIGNET Pierre
cadbiom
Commits
77edb9b6
Commit
77edb9b6
authored
Sep 17, 2017
by
VIGNET Pierre
Browse files
Add mouse scroll event/zoom on overview
parent
028c9fdb
Changes
1
Hide whitespace changes
Inline
Side-by-side
gui/cadbiom_gui/gt_gui/charter.py
View file @
77edb9b6
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment