Skip to content

Commit

Permalink
add rotation on ctrl+R; show sizes on start
Browse files Browse the repository at this point in the history
  • Loading branch information
FRiMN committed Aug 15, 2015
1 parent c51f21e commit 476d147
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ build.guide
gettext_update.sh
messages.pot
*.po
*.komodoproject
13 changes: 11 additions & 2 deletions rackman.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@



VERSION = '1.6.4'
VERSION = '1.6.5'



Expand Down Expand Up @@ -164,11 +164,14 @@ def __init__(self):
('/{}/_90'.format( _('Opacity') ), '<ctrl>9', self.opacity_change, 90, '/{}/50'.format( _('Opacity') )),
('/{}/10_0'.format( _('Opacity') ), '<ctrl>0', self.opacity_change, 100,'/{}/50'.format( _('Opacity') )),

('/{}'.format( _('_Metric') ), None, None, 0, '<Branch>'),
('/{}'.format( _('_Metric') ), None, None, 0, '<Branch>'),
('/{}/p_x'.format(_('Metric') ), None, self.metric_change, 1, '<RadioItem>'),
('/{}/_mm'.format(_('Metric') ), None, self.metric_change, 2, '/{}/px'.format( _('Metric') )),
('/{}/_in'.format(_('Metric') ), None, self.metric_change, 3, '/{}/px'.format( _('Metric') )),
('/{}/_pt (Adobe)'.format( _('Metric') ), None, self.metric_change, 4, '/{}/px'.format( _('Metric') )),

('/{}'.format( _('_Tools') ), None, None, 0, '<Branch>'),
('/{}/{}'.format( _('Tools'), _('Rotate') ), '<ctrl>R', self.size_change, 1, '<Item>'),
)

menubar = self.get_main_menu()
Expand Down Expand Up @@ -224,6 +227,11 @@ def metric_change(self, ret, widget):
slave.window.emit("check-resize") # обновление показателей


def size_change(self, ret, widget):
w, h = slave.window.get_size()
slave.window.resize(h, w)



class Slave:
def __init__(self, parent):
Expand Down Expand Up @@ -396,5 +404,6 @@ def draw_cairo(self, area, event):

base = Master()
slave = Slave(base)
slave.window.emit("check-resize")

gtk.main()

0 comments on commit 476d147

Please sign in to comment.