Merge lp:~vikoadi/pantheon-photos/flip-toolbar into lp:~pantheon-photos/pantheon-photos/trunk

Proposed by Viko Adi Rahmawan
Status: Merged
Approved by: meese
Approved revision: 2575
Merged at revision: 2590
Proposed branch: lp:~vikoadi/pantheon-photos/flip-toolbar
Merge into: lp:~pantheon-photos/pantheon-photos/trunk
Diff against target: 187 lines (+39/-12)
7 files modified
src/CollectionPage.vala (+12/-1)
src/PhotoPage.vala (+23/-0)
src/Resources.vala (+2/-0)
ui/collection.ui (+1/-0)
ui/direct.ui (+0/-2)
ui/media.ui (+1/-4)
ui/photo.ui (+0/-5)
To merge this branch: bzr merge lp:~vikoadi/pantheon-photos/flip-toolbar
Reviewer Review Type Date Requested Status
meese Approve
Danielle Foré ux Approve
Cody Garver (community) Needs Fixing
Review via email: mp+230231@code.launchpad.net

Commit message

add horizontal and vertical flip ToolButton to CollectionPage and EditingPage toolbar

Description of the change

-add horizontal and vertical flip ToolButton to CollectionPage and EditingPage toolbar
-remove flip menu from menubar

To post a comment you must log in.
Revision history for this message
Cody Garver (codygarver) wrote :

Needs trunk merged in and conflicts resolved

review: Needs Fixing
2572. By Viko Adi Rahmawan

merge trunk

Revision history for this message
Viko Adi Rahmawan (vikoadi) wrote :

done

Revision history for this message
Danielle Foré (danrabbit) wrote :

Hey Viko, please don't use Stock, it is deprecated.

Instead use Gtk.Button.from_icon_name

review: Needs Fixing
Revision history for this message
Danielle Foré (danrabbit) wrote :

Also, let's do the save behavior as the rotate button. Let's have the default be horizontal flip and do vertical flip when you hold "Ctrl"

2573. By Viko Adi Rahmawan

dont use stock, use same behaviour with rotate button

2574. By Viko Adi Rahmawan

merge trunk

Revision history for this message
Viko Adi Rahmawan (vikoadi) wrote :

done

Revision history for this message
Danielle Foré (danrabbit) wrote :

Works as expected :)

review: Approve (ux)
Revision history for this message
meese (meese) wrote :

works and style is fine. I think the tooltip should add "(press Ctrl to flip vertically)" like rotate has it.

2575. By Viko Adi Rahmawan

add (press Ctrl to flip vertically) to the tooltip

Revision history for this message
Viko Adi Rahmawan (vikoadi) wrote :

add (press Ctrl to flip vertically) to the tooltip"

Revision history for this message
meese (meese) wrote :

approved

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/CollectionPage.vala'
2--- src/CollectionPage.vala 2014-08-17 07:06:58 +0000
3+++ src/CollectionPage.vala 2014-08-23 09:05:01 +0000
4@@ -144,12 +144,14 @@
5 TRANSLATABLE, on_flip_horizontally
6 };
7 hflip.label = Resources.HFLIP_MENU;
8+ hflip.tooltip = Resources.HFLIP_TOOLTIP;
9 actions += hflip;
10
11 Gtk.ActionEntry vflip = { "FlipVertically", Resources.VFLIP, TRANSLATABLE, null,
12 TRANSLATABLE, on_flip_vertically
13 };
14 vflip.label = Resources.VFLIP_MENU;
15+ vflip.tooltip = Resources.VFLIP_TOOLTIP;
16 actions += vflip;
17
18 Gtk.ActionEntry enhance = { "Enhance", Resources.ENHANCE, TRANSLATABLE, "<Ctrl>E",
19@@ -775,6 +777,11 @@
20 if (rotate_button != null)
21 rotate_button.set_related_action (get_action ("RotateCounterclockwise"));
22
23+ Gtk.ToolButton? flip_button = ui.get_widget ("/CollectionToolbar/ToolFlip")
24+ as Gtk.ToolButton;
25+ if (flip_button != null)
26+ flip_button.set_related_action (get_action ("FlipVertically"));
27+
28 return base.on_ctrl_pressed (event);
29 }
30
31@@ -783,6 +790,11 @@
32 as Gtk.ToolButton;
33 if (rotate_button != null)
34 rotate_button.set_related_action (get_action ("RotateClockwise"));
35+
36+ Gtk.ToolButton? flip_button = ui.get_widget ("/CollectionToolbar/ToolFlip")
37+ as Gtk.ToolButton;
38+ if (flip_button != null)
39+ flip_button.set_related_action (get_action ("FlipHorizontally"));
40
41 return base.on_ctrl_released (event);
42 }
43@@ -791,4 +803,3 @@
44 return search_filter;
45 }
46 }
47-
48
49=== modified file 'src/PhotoPage.vala'
50--- src/PhotoPage.vala 2014-08-23 07:13:38 +0000
51+++ src/PhotoPage.vala 2014-08-23 09:05:01 +0000
52@@ -392,6 +392,7 @@
53 private Gdk.Pixbuf swapped = null;
54 private bool pixbuf_dirty = true;
55 private Gtk.ToolButton rotate_button = null;
56+ private Gtk.ToolButton flip_button = null;
57 private Gtk.ToggleToolButton crop_button = null;
58 private Gtk.ToggleToolButton redeye_button = null;
59 private Gtk.ToggleToolButton adjust_button = null;
60@@ -440,6 +441,15 @@
61 rotate_button.is_important = true;
62 toolbar.insert (rotate_button, -1);
63
64+ // horizontal flip tool
65+ flip_button = new Gtk.ToolButton (null, null);
66+ flip_button.set_icon_name (Resources.HFLIP);
67+ flip_button.set_label (Resources.HFLIP_LABEL);
68+ flip_button.set_tooltip_text (Resources.HFLIP_TOOLTIP);
69+ flip_button.clicked.connect (on_flip_horizontally);
70+ flip_button.is_important = true;
71+ toolbar.insert (flip_button, -1);
72+
73 // crop tool
74 crop_button = new Gtk.ToggleToolButton.from_stock (Resources.CROP);
75 crop_button.set_label (Resources.CROP_LABEL);
76@@ -1074,6 +1084,7 @@
77 protected virtual void update_ui (bool missing) {
78 bool sensitivity = !missing;
79
80+ flip_button.sensitive = sensitivity;
81 rotate_button.sensitive = sensitivity;
82 crop_button.sensitive = sensitivity;
83 straighten_button.sensitive = sensitivity;
84@@ -2006,6 +2017,12 @@
85 rotate_button.clicked.disconnect (on_rotate_clockwise);
86 rotate_button.clicked.connect (on_rotate_counterclockwise);
87
88+ flip_button.set_icon_name (Resources.VFLIP);
89+ flip_button.set_label (Resources.VFLIP_LABEL);
90+ flip_button.set_tooltip_text (Resources.VFLIP_TOOLTIP);
91+ flip_button.clicked.disconnect (on_flip_horizontally);
92+ flip_button.clicked.connect (on_flip_vertically);
93+
94 if (current_tool == null)
95 swap_out_original ();
96
97@@ -2019,6 +2036,12 @@
98 rotate_button.clicked.disconnect (on_rotate_counterclockwise);
99 rotate_button.clicked.connect (on_rotate_clockwise);
100
101+ flip_button.set_icon_name (Resources.HFLIP);
102+ flip_button.set_label (Resources.HFLIP_LABEL);
103+ flip_button.set_tooltip_text (Resources.HFLIP_TOOLTIP);
104+ flip_button.clicked.disconnect (on_flip_vertically);
105+ flip_button.clicked.connect (on_flip_horizontally);
106+
107 if (current_tool == null && get_shift_pressed () && !get_alt_pressed ())
108 swap_in_original ();
109
110
111=== modified file 'src/Resources.vala'
112--- src/Resources.vala 2014-08-23 02:56:29 +0000
113+++ src/Resources.vala 2014-08-23 09:05:01 +0000
114@@ -148,9 +148,11 @@
115
116 public const string HFLIP_MENU = _("Flip Hori_zontally");
117 public const string HFLIP_LABEL = _("Flip Horizontally");
118+public const string HFLIP_TOOLTIP = _("Flip the image horizontally (press Ctrl to flip vertically)");
119
120 public const string VFLIP_MENU = _("Flip Verti_cally");
121 public const string VFLIP_LABEL = _("Flip Vertically");
122+public const string VFLIP_TOOLTIP = _("Flip the image vertically");
123
124 public const string ENHANCE_MENU = _("_Enhance");
125 public const string ENHANCE_LABEL = _("Enhance");
126
127=== modified file 'ui/collection.ui'
128--- ui/collection.ui 2014-08-17 07:06:58 +0000
129+++ ui/collection.ui 2014-08-23 09:05:01 +0000
130@@ -49,6 +49,7 @@
131
132 <toolbar name="CollectionToolbar">
133 <toolitem name="ToolRotate" action="RotateClockwise" />
134+ <toolitem name="ToolFlip" action="FlipHorizontally" />
135 <toolitem name="ToolEnhance" action="Enhance" />
136 <separator />
137 <toolitem name="ToolPublish" action="Publish" />
138
139=== modified file 'ui/direct.ui'
140--- ui/direct.ui 2014-08-08 15:28:05 +0000
141+++ ui/direct.ui 2014-08-23 09:05:01 +0000
142@@ -35,8 +35,6 @@
143 <separator />
144 <menuitem name="RotateClockwise" action="RotateClockwise" />
145 <menuitem name="RotateCounterclockwise" action="RotateCounterclockwise" />
146- <menuitem name="FlipHorizontally" action="FlipHorizontally" />
147- <menuitem name="FlipVertically" action="FlipVertically" />
148 <separator />
149 <menu name="Tools" action="Tools">
150 <menuitem name="Enhance" action="Enhance" />
151
152=== modified file 'ui/media.ui'
153--- ui/media.ui 2014-07-27 04:42:53 +0000
154+++ ui/media.ui 2014-08-23 09:05:01 +0000
155@@ -20,9 +20,6 @@
156 </menu>
157
158 <menu name="PhotosMenu" action="PhotosMenu">
159- <menuitem name="FlipHorizontally" action="FlipHorizontally" />
160- <menuitem name="FlipVertically" action="FlipVertically" />
161- <separator />
162 <placeholder name="PhotosExtrasEditsPlaceholder" />
163 <separator />
164 <placeholder name="PhotosExtrasExternalsPlaceholder" />
165@@ -63,4 +60,4 @@
166 <menuitem name="SelectAll" action="CommonSelectAll" />
167 </popup>
168
169-</ui>
170+</ui>
171\ No newline at end of file
172
173=== modified file 'ui/photo.ui'
174--- ui/photo.ui 2014-08-08 15:28:05 +0000
175+++ ui/photo.ui 2014-08-23 09:05:01 +0000
176@@ -18,11 +18,6 @@
177 <separator />
178 <menuitem name="Preferences" action="CommonPreferences" />
179 </menu>
180-
181- <menu name="PhotoMenu" action="PhotoMenu">
182- <menuitem name="FlipHorizontally" action="FlipHorizontally" />
183- <menuitem name="FlipVertically" action="FlipVertically" />
184- </menu>
185
186 <menu name="HelpMenu" action="HelpMenu">
187 <menuitem name="About" action="CommonAbout" />

Subscribers

People subscribed via source and target branches