Add another rotation button
Because it's effectively free anyway
This commit is contained in:
parent
ec09d0c73c
commit
d8fa2ba00a
|
@ -12,11 +12,16 @@
|
|||
<property name="can_focus">False</property>
|
||||
<property name="icon_name">edit-delete-symbolic</property>
|
||||
</object>
|
||||
<object class="GtkImage" id="image_rotate">
|
||||
<object class="GtkImage" id="image_rotate_left">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="icon_name">object-rotate-left-symbolic</property>
|
||||
</object>
|
||||
<object class="GtkImage" id="image_rotate_right">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="icon_name">object-rotate-right-symbolic</property>
|
||||
</object>
|
||||
<template class="Drawing" parent="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
|
@ -61,11 +66,25 @@
|
|||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="btn_rotate">
|
||||
<object class="GtkButton" id="btn_rotate_left">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="image">image_rotate</property>
|
||||
<property name="image">image_rotate_left</property>
|
||||
<signal name="clicked" handler="_on_rotate_button_clicked" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="btn_rotate_right">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="image">image_rotate_right</property>
|
||||
<signal name="clicked" handler="_on_rotate_button_clicked" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
|
|
|
@ -42,6 +42,8 @@ class Drawing(Gtk.Box):
|
|||
|
||||
label_timestamp = Gtk.Template.Child()
|
||||
image_svg = Gtk.Template.Child()
|
||||
btn_rotate_left = Gtk.Template.Child()
|
||||
btn_rotate_right = Gtk.Template.Child()
|
||||
|
||||
def __init__(self, json_data, *args, **kwargs):
|
||||
super().__init__()
|
||||
|
@ -99,7 +101,12 @@ class Drawing(Gtk.Box):
|
|||
|
||||
@Gtk.Template.Callback('_on_rotate_button_clicked')
|
||||
def _on_rotate_button_clicked(self, button):
|
||||
orientations = ['portrait', 'landscape', 'reverse-portrait', 'reverse-landscape'] * 2
|
||||
o = orientations[orientations.index(self.orientation) + 1]
|
||||
if button == self.btn_rotate_left:
|
||||
advance = 1
|
||||
else:
|
||||
advance = 3
|
||||
|
||||
orientations = ['portrait', 'landscape', 'reverse-portrait', 'reverse-landscape'] * 3
|
||||
o = orientations[orientations.index(self.orientation) + advance]
|
||||
self.orientation = o
|
||||
self.refresh()
|
||||
|
|
Loading…
Reference in New Issue