Skip to content

Commit

Permalink
Реализовано симметричное изменение размера измерителя (issue 9)
Browse files Browse the repository at this point in the history
  • Loading branch information
FRiMN committed Dec 17, 2015
1 parent 8aaddc9 commit 65f4259
Showing 1 changed file with 25 additions and 10 deletions.
35 changes: 25 additions & 10 deletions rackman.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@



__version__ = '1.9.0'
__version__ = '1.10.0'



Expand All @@ -26,7 +26,7 @@ def initial():



config = {} # lint:ok
config = {}

conf_file_name = "rackman.conf"
conf_path_curdir = os.path.join('./', conf_file_name)
Expand Down Expand Up @@ -399,22 +399,37 @@ def resizing(self, widget, event):
acc = config['fast_mode_speed']

if event.state & gtk.gdk.CONTROL_MASK:
if event.hardware_keycode == 114: # right
if event.hardware_keycode == 114: # right
ox += acc
elif event.hardware_keycode == 116: # down
elif event.hardware_keycode == 116: # down
oy += acc
elif event.hardware_keycode == 113: # left
elif event.hardware_keycode == 113: # left
ox -= acc
elif event.hardware_keycode == 111: # up
elif event.hardware_keycode == 111: # up
oy -= acc
elif event.state & gtk.gdk.MOD1_MASK: # ~ alt
if event.hardware_keycode == 114: # right
ox -= acc
x += acc*2
elif event.hardware_keycode == 116: # down
oy -= acc
y += acc*2
elif event.hardware_keycode == 113: # left
if x > acc*2:
ox += acc
x -= acc*2
elif event.hardware_keycode == 111: # up
if y > acc*2:
oy += acc
y -= acc*2
else:
if event.hardware_keycode == 114: # right
if event.hardware_keycode == 114: # right
x += acc
elif event.hardware_keycode == 116: # down
elif event.hardware_keycode == 116: # down
y += acc
elif event.hardware_keycode == 113: # left
elif event.hardware_keycode == 113: # left
x -= acc
elif event.hardware_keycode == 111: # up
elif event.hardware_keycode == 111: # up
y -= acc

self.window.move(ox, oy)
Expand Down

0 comments on commit 65f4259

Please sign in to comment.