Merge lp:~elementary-apps/pantheon-photos/more-editing-tools-cleanup into lp:~pantheon-photos/pantheon-photos/trunk

Proposed by Danielle Foré
Status: Merged
Approved by: Cody Garver
Approved revision: 2796
Merged at revision: 2797
Proposed branch: lp:~elementary-apps/pantheon-photos/more-editing-tools-cleanup
Merge into: lp:~pantheon-photos/pantheon-photos/trunk
Diff against target: 152 lines (+11/-27)
2 files modified
src/editing_tools/EditingTools.vala (+9/-26)
src/editing_tools/StraightenTool.vala (+2/-1)
To merge this branch: bzr merge lp:~elementary-apps/pantheon-photos/more-editing-tools-cleanup
Reviewer Review Type Date Requested Status
Photos Devs Pending
Review via email: mp+267462@code.launchpad.net

Commit message

* Remove unnecessary constants
* Use box margin instead of extra frame
* Remove histrogram alignment
* hexpand histogram sliders

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/editing_tools/EditingTools.vala'
2--- src/editing_tools/EditingTools.vala 2015-08-08 21:07:04 +0000
3+++ src/editing_tools/EditingTools.vala 2015-08-09 23:41:00 +0000
4@@ -26,9 +26,8 @@
5 }
6
7 public abstract class EditingToolWindow : Gtk.Window {
8- private const int FRAME_BORDER = 6;
9
10- private Gtk.Frame layout_frame = new Gtk.Frame (null);
11+ private Gtk.Frame outer_frame = new Gtk.Frame (null);
12 private bool user_moved = false;
13
14 public EditingToolWindow (Gtk.Window container) {
15@@ -38,13 +37,6 @@
16 set_decorated (false);
17 set_transient_for (container);
18
19- Gtk.Frame outer_frame = new Gtk.Frame (null);
20- outer_frame.set_border_width (0);
21-
22- layout_frame.set_border_width (FRAME_BORDER);
23- layout_frame.set_shadow_type (Gtk.ShadowType.NONE);
24-
25- outer_frame.add (layout_frame);
26 base.add (outer_frame);
27
28 add_events (Gdk.EventMask.BUTTON_PRESS_MASK | Gdk.EventMask.KEY_PRESS_MASK);
29@@ -62,7 +54,7 @@
30 }
31
32 public override void add (Gtk.Widget widget) {
33- layout_frame.add (widget);
34+ outer_frame.add (widget);
35 }
36
37 public bool has_user_moved () {
38@@ -680,6 +672,7 @@
39 response_layout.add (ok_button);
40
41 layout = new Gtk.Box (Gtk.Orientation.HORIZONTAL, CONTROL_SPACING);
42+ layout.margin = 12;
43 layout.add (constraint_combo);
44 layout.add (pivot_reticle_button);
45 layout.add (response_layout);
46@@ -1869,6 +1862,7 @@
47 apply_button.set_tooltip_text (_ ("Remove any red-eye effects in the selected region"));
48
49 Gtk.Box layout = new Gtk.Box (Gtk.Orientation.HORIZONTAL, CONTROL_SPACING);
50+ layout.margin = 12;
51 layout.add (slider_label);
52 layout.add (slider);
53 layout.add (close_button);
54@@ -2176,7 +2170,6 @@
55 }
56
57 public class AdjustTool : EditingTool {
58- private const int SLIDER_WIDTH = 160;
59 private const uint SLIDER_DELAY_MSEC = 100;
60
61 private class AdjustToolWindow : EditingToolWindow {
62@@ -2212,50 +2205,43 @@
63 slider_organizer.set_column_homogeneous (false);
64 slider_organizer.set_row_spacing (12);
65 slider_organizer.set_column_spacing (12);
66- slider_organizer.set_margin_start (12);
67 slider_organizer.set_margin_bottom (12);
68
69 Gtk.Label exposure_label = new Gtk.Label.with_mnemonic (_ ("Exposure:"));
70 exposure_label.set_halign (Gtk.Align.END);
71 slider_organizer.attach (exposure_label, 0, 0, 1, 1);
72 slider_organizer.attach (exposure_slider, 1, 0, 1, 1);
73- exposure_slider.set_size_request (SLIDER_WIDTH, -1);
74 exposure_slider.set_draw_value (false);
75+ exposure_slider.set_hexpand (true);
76
77 Gtk.Label saturation_label = new Gtk.Label.with_mnemonic (_ ("Saturation:"));
78 saturation_label.set_halign (Gtk.Align.END);
79 slider_organizer.attach (saturation_label, 0, 1, 1, 1);
80 slider_organizer.attach (saturation_slider, 1, 1, 1, 1);
81- saturation_slider.set_size_request (SLIDER_WIDTH, -1);
82 saturation_slider.set_draw_value (false);
83
84 Gtk.Label tint_label = new Gtk.Label.with_mnemonic (_ ("Tint:"));
85 tint_label.set_halign (Gtk.Align.END);
86 slider_organizer.attach (tint_label, 0, 2, 1, 1);
87 slider_organizer.attach (tint_slider, 1, 2, 1, 1);
88- tint_slider.set_size_request (SLIDER_WIDTH, -1);
89 tint_slider.set_draw_value (false);
90
91- Gtk.Label temperature_label =
92- new Gtk.Label.with_mnemonic (_ ("Temperature:"));
93+ Gtk.Label temperature_label = new Gtk.Label.with_mnemonic (_ ("Temperature:"));
94 temperature_label.set_halign (Gtk.Align.END);
95 slider_organizer.attach (temperature_label, 0, 3, 1, 1);
96 slider_organizer.attach (temperature_slider, 1, 3, 1, 1);
97- temperature_slider.set_size_request (SLIDER_WIDTH, -1);
98 temperature_slider.set_draw_value (false);
99
100 Gtk.Label shadows_label = new Gtk.Label.with_mnemonic (_ ("Shadows:"));
101 shadows_label.set_halign (Gtk.Align.END);
102 slider_organizer.attach (shadows_label, 0, 4, 1, 1);
103 slider_organizer.attach (shadows_slider, 1, 4, 1, 1);
104- shadows_slider.set_size_request (SLIDER_WIDTH, -1);
105 shadows_slider.set_draw_value (false);
106
107 Gtk.Label highlights_label = new Gtk.Label.with_mnemonic (_ ("Highlights:"));
108 highlights_label.set_halign (Gtk.Align.END);
109 slider_organizer.attach (highlights_label, 0, 5, 1, 1);
110 slider_organizer.attach (highlights_slider, 1, 5, 1, 1);
111- highlights_slider.set_size_request (SLIDER_WIDTH, -1);
112 highlights_slider.set_draw_value (false);
113
114 Gtk.Box button_layouter = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 8);
115@@ -2264,15 +2250,12 @@
116 button_layouter.pack_start (reset_button, true, true, 1);
117 button_layouter.pack_start (ok_button, true, true, 1);
118
119- Gtk.Alignment histogram_aligner = new Gtk.Alignment (0.0f, 0.0f, 0.0f, 0.0f);
120- histogram_aligner.add (histogram_manipulator);
121- histogram_aligner.set_padding (12, 8, 12, 12);
122-
123 Gtk.Box pane_layouter = new Gtk.Box (Gtk.Orientation.VERTICAL, 8);
124- pane_layouter.add (histogram_aligner);
125+ pane_layouter.margin = 12;
126+ pane_layouter.add (histogram_manipulator);
127 pane_layouter.add (slider_organizer);
128 pane_layouter.add (button_layouter);
129- pane_layouter.set_child_packing (histogram_aligner, true, true, 0, Gtk.PackType.START);
130+ pane_layouter.set_child_packing (histogram_manipulator, true, true, 0, Gtk.PackType.START);
131
132 add (pane_layouter);
133 }
134
135=== modified file 'src/editing_tools/StraightenTool.vala'
136--- src/editing_tools/StraightenTool.vala 2014-08-08 21:13:09 +0000
137+++ src/editing_tools/StraightenTool.vala 2015-08-09 23:41:00 +0000
138@@ -130,6 +130,7 @@
139 button_layout.pack_start (ok_button, true, true, 0);
140
141 Gtk.Box main_layout = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0);
142+ main_layout.margin = 12;
143 main_layout.pack_start (description_label, true, true, 0);
144 main_layout.pack_start (slider_layout, true, true, 0);
145 main_layout.pack_start (angle_label, true, true, 0);
146@@ -556,4 +557,4 @@
147 }
148 }
149
150-} // end namespace
151\ No newline at end of file
152+} // end namespace

Subscribers

People subscribed via source and target branches