Merge lp:~tintou/granite/gtk3.12 into lp:~elementary-pantheon/granite/granite
- gtk3.12
- Merge into granite
Status: | Superseded |
---|---|
Proposed branch: | lp:~tintou/granite/gtk3.12 |
Merge into: | lp:~elementary-pantheon/granite/granite |
Diff against target: |
198 lines (+36/-37) 4 files modified
CMakeLists.txt (+2/-2) lib/Widgets/DatePicker.vala (+16/-23) lib/Widgets/PopOver.vala (+1/-2) lib/Widgets/TimePicker.vala (+17/-10) |
To merge this branch: | bzr merge lp:~tintou/granite/gtk3.12 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Danielle Foré | Needs Fixing | ||
Review via email: mp+209498@code.launchpad.net |
This proposal has been superseded by a proposal from 2014-04-28.
Commit message
Description of the change
I did change the API to simplify things, only Maya does use those two widgets and th change did not triggered problems at all.
Rico Tzschichholz (ricotz) wrote : | # |
Danielle Foré (danrabbit) wrote : | # |
Corentin, can we add 12px of margin in the timepicker and datepicker popovers? I can't do it in the theme since we need to have 0px available for the modelbutton items
- 697. By Launchpad Translations on behalf of elementary-pantheon
-
Launchpad automatic translations update.
Rico Tzschichholz (ricotz) wrote : | # |
If there is a need to constant adjuments use some public "const int POPOVER_PADDING" or something and reuse it for consistency.
Rico Tzschichholz (ricotz) wrote : | # |
I was referring to those "rect.x = size.width - 15;" as well ;)
Corentin Noël (tintou) wrote : | # |
OFFSET constant added, I did change the API to simplify things, only Maya does use those two widgets and th change did not triggered problems at all.
- 698. By Launchpad Translations on behalf of elementary-pantheon
-
Launchpad automatic translations update.
- 699. By Launchpad Translations on behalf of elementary-pantheon
-
Launchpad automatic translations update.
- 700. By Launchpad Translations on behalf of elementary-pantheon
-
Launchpad automatic translations update.
- 701. By Launchpad Translations on behalf of elementary-pantheon
-
Launchpad automatic translations update.
- 702. By Launchpad Translations on behalf of elementary-pantheon
-
Launchpad automatic translations update.
- 703. By Rico Tzschichholz
-
datepicker: Fix typo, luckily vala seems to correct it automagically
- 704. By Launchpad Translations on behalf of elementary-pantheon
-
Launchpad automatic translations update.
- 705. By Victor Martinez
-
Only show close buttons for active or hovered tabs. Fixes lp:1205236
The implementation uses Gtk.Revealer to animate close buttons.
- 706. By Launchpad Translations on behalf of elementary-pantheon
-
Launchpad automatic translations update.
- 707. By Launchpad Translations on behalf of elementary-pantheon
-
Launchpad automatic translations update.
- 708. By Launchpad Translations on behalf of elementary-pantheon
-
Launchpad automatic translations update.
- 709. By Launchpad Translations on behalf of elementary-pantheon
-
Launchpad automatic translations update.
- 710. By Sergey "Shnatsel" Davidoff
-
ContractorProxy: Improve documentation.
- 711. By Victor Martinez
-
ThinPaned: make sure the handle follows the cursor position when using client-side decorations. Fixes lp:1302314
- 712. By Sergey "Shnatsel" Davidoff
-
Document IconFactory and CellRendererBadge classes, misc Contractor documentation fixes, added a description for DynamicNotebook
- 713. By Danielle Foré
-
update 24px "application-menu" for dark toolbars
- 714. By Launchpad Translations on behalf of elementary-pantheon
-
Launchpad automatic translations update.
- 715. By Sergey "Shnatsel" Davidoff
-
Documentation: Add screenshots for OverlayBar, AboutDialog, DynamicNotebook, Welcome, LightWindow and ModeButton.
- 716. By Sergey "Shnatsel" Davidoff
-
Documentation: Add descriptions for Granite.
Services. Contract and Granite. Services. ContractorError . - 717. By Launchpad Translations on behalf of elementary-pantheon
-
Launchpad automatic translations update.
- 718. By Launchpad Translations on behalf of elementary-pantheon
-
Launchpad automatic translations update.
- 719. By Launchpad Translations on behalf of elementary-pantheon
-
Launchpad automatic translations update.
- 720. By Launchpad Translations on behalf of elementary-pantheon
-
Launchpad automatic translations update.
- 721. By Victor Martinez
-
Style class: Change "granite-
overlay- bar" to "overlay-bar". Fixes lp:1309713 - 722. By Sergey "Shnatsel" Davidoff
-
Deprecate HintedEntry and SearchBar because GTK has those since 3.6
- 723. By Launchpad Translations on behalf of elementary-pantheon
-
Launchpad automatic translations update.
- 724. By Launchpad Translations on behalf of elementary-pantheon
-
Launchpad automatic translations update.
- 725. By Launchpad Translations on behalf of elementary-pantheon
-
Launchpad automatic translations update.
- 726. By Corentin Noël
-
new version synced with trunk.
do not break the API.
Unmerged revisions
Preview Diff
1 | === modified file 'CMakeLists.txt' | |||
2 | --- CMakeLists.txt 2014-02-23 19:07:04 +0000 | |||
3 | +++ CMakeLists.txt 2014-04-27 22:26:07 +0000 | |||
4 | @@ -28,7 +28,7 @@ | |||
5 | 28 | include (ValaVersion) | 28 | include (ValaVersion) |
6 | 29 | include (ValaPrecompile) | 29 | include (ValaPrecompile) |
7 | 30 | 30 | ||
9 | 31 | ensure_vala_version ("0.20.1" MINIMUM) | 31 | ensure_vala_version ("0.23.2" MINIMUM) |
10 | 32 | 32 | ||
11 | 33 | # | 33 | # |
12 | 34 | # Packages in PKG_DEPS are used with the vala compiler and other related tools (not versioned.) | 34 | # Packages in PKG_DEPS are used with the vala compiler and other related tools (not versioned.) |
13 | @@ -45,7 +45,7 @@ | |||
14 | 45 | gee-0.8) | 45 | gee-0.8) |
15 | 46 | 46 | ||
16 | 47 | set (PKG_DEPS_CHECK | 47 | set (PKG_DEPS_CHECK |
18 | 48 | gtk+-3.0>=3.3.14 | 48 | gtk+-3.0>=3.11.6 |
19 | 49 | gio-unix-2.0 | 49 | gio-unix-2.0 |
20 | 50 | gthread-2.0 | 50 | gthread-2.0 |
21 | 51 | gee-0.8) | 51 | gee-0.8) |
22 | 52 | 52 | ||
23 | === modified file 'lib/Widgets/DatePicker.vala' | |||
24 | --- lib/Widgets/DatePicker.vala 2014-03-19 07:21:38 +0000 | |||
25 | +++ lib/Widgets/DatePicker.vala 2014-04-27 22:26:07 +0000 | |||
26 | @@ -27,6 +27,8 @@ | |||
27 | 27 | */ | 27 | */ |
28 | 28 | public class DatePicker : Gtk.Entry, Gtk.Buildable { | 28 | public class DatePicker : Gtk.Entry, Gtk.Buildable { |
29 | 29 | 29 | ||
30 | 30 | const int OFFSET = 15; | ||
31 | 31 | const int MARGIN = 6; | ||
32 | 30 | /** | 32 | /** |
33 | 31 | * Desired format of DatePicker | 33 | * Desired format of DatePicker |
34 | 32 | */ | 34 | */ |
35 | @@ -41,7 +43,7 @@ | |||
36 | 41 | */ | 43 | */ |
37 | 42 | protected Calendar calendar; | 44 | protected Calendar calendar; |
38 | 43 | 45 | ||
40 | 44 | PopOver popover; | 46 | private Gtk.Popover popover; |
41 | 45 | 47 | ||
42 | 46 | private GLib.DateTime _date; | 48 | private GLib.DateTime _date; |
43 | 47 | 49 | ||
44 | @@ -66,8 +68,9 @@ | |||
45 | 66 | format = Granite.DateTime.get_default_date_format (false, true, true); | 68 | format = Granite.DateTime.get_default_date_format (false, true, true); |
46 | 67 | 69 | ||
47 | 68 | dropdown = new Gtk.EventBox (); | 70 | dropdown = new Gtk.EventBox (); |
50 | 69 | popover = new PopOver (); | 71 | dropdown.margin = MARGIN; |
51 | 70 | ((Gtk.Box) popover.get_content_area ()).add (dropdown); | 72 | popover = new Gtk.Popover (this); |
52 | 73 | popover.add (dropdown); | ||
53 | 71 | calendar = new Calendar (); | 74 | calendar = new Calendar (); |
54 | 72 | date = new GLib.DateTime.now_local (); | 75 | date = new GLib.DateTime.now_local (); |
55 | 73 | 76 | ||
56 | @@ -117,30 +120,20 @@ | |||
57 | 117 | } | 120 | } |
58 | 118 | 121 | ||
59 | 119 | private void on_icon_press (EntryIconPosition position) { | 122 | private void on_icon_press (EntryIconPosition position) { |
64 | 120 | 123 | Gdk.Rectangle rect = Gdk.Rectangle (); | |
65 | 121 | int x, y; | 124 | position_dropdown (out rect); |
66 | 122 | position_dropdown (out x, out y); | 125 | popover.pointing_to = rect; |
67 | 123 | 126 | popover.position = Gtk.PositionType.BOTTOM; | |
68 | 124 | popover.show_all (); | 127 | popover.show_all (); |
69 | 125 | popover.move_to_coords (x, y); | ||
70 | 126 | popover.present (); | ||
71 | 127 | calendar.grab_focus (); | 128 | calendar.grab_focus (); |
72 | 128 | } | 129 | } |
73 | 129 | 130 | ||
79 | 130 | protected virtual void position_dropdown (out int x, out int y) { | 131 | protected virtual void position_dropdown (out Gdk.Rectangle rect) { |
80 | 131 | 132 | Gtk.Allocation size; | |
76 | 132 | Allocation size; | ||
77 | 133 | Requisition calendar_size; | ||
78 | 134 | |||
81 | 135 | get_allocation (out size); | 133 | get_allocation (out size); |
90 | 136 | calendar.get_preferred_size (out calendar_size, null); | 134 | |
91 | 137 | get_window ().get_origin (out x, out y); | 135 | rect.x = size.width - OFFSET; |
92 | 138 | 136 | rect.y = size.height; | |
85 | 139 | x += size.x + size.width - 10; //size.x - (calendar_size.width - size.width); | ||
86 | 140 | y += size.y + size.height; | ||
87 | 141 | |||
88 | 142 | //x = x.clamp (0, int.max (0, Screen.width () - calendar_size.width)); | ||
89 | 143 | //y = y.clamp (0, int.max (0, Screen.height () - calendar_size.height)); | ||
93 | 144 | } | 137 | } |
94 | 145 | 138 | ||
95 | 146 | private void on_calendar_day_selected () { | 139 | private void on_calendar_day_selected () { |
96 | @@ -156,4 +149,4 @@ | |||
97 | 156 | popover.hide (); | 149 | popover.hide (); |
98 | 157 | } | 150 | } |
99 | 158 | } | 151 | } |
101 | 159 | } | 152 | } |
102 | 160 | \ No newline at end of file | 153 | \ No newline at end of file |
103 | 161 | 154 | ||
104 | === modified file 'lib/Widgets/PopOver.vala' | |||
105 | --- lib/Widgets/PopOver.vala 2014-04-08 20:21:10 +0000 | |||
106 | +++ lib/Widgets/PopOver.vala 2014-04-27 22:26:07 +0000 | |||
107 | @@ -492,5 +492,4 @@ | |||
108 | 492 | cr.paint_with_alpha(1.0); | 492 | cr.paint_with_alpha(1.0); |
109 | 493 | return base.draw(cr); | 493 | return base.draw(cr); |
110 | 494 | } | 494 | } |
113 | 495 | } | 495 | } |
112 | 496 | |||
114 | 497 | \ No newline at end of file | 496 | \ No newline at end of file |
115 | 498 | 497 | ||
116 | === modified file 'lib/Widgets/TimePicker.vala' | |||
117 | --- lib/Widgets/TimePicker.vala 2014-02-07 16:19:37 +0000 | |||
118 | +++ lib/Widgets/TimePicker.vala 2014-04-27 22:26:07 +0000 | |||
119 | @@ -25,6 +25,8 @@ | |||
120 | 25 | */ | 25 | */ |
121 | 26 | public class TimePicker : Gtk.Entry { | 26 | public class TimePicker : Gtk.Entry { |
122 | 27 | 27 | ||
123 | 28 | const int OFFSET = 15; | ||
124 | 29 | const int MARGIN = 6; | ||
125 | 28 | // Signals | 30 | // Signals |
126 | 29 | /** | 31 | /** |
127 | 30 | * Sent when the time got changed | 32 | * Sent when the time got changed |
128 | @@ -86,7 +88,7 @@ | |||
129 | 86 | private Gtk.Grid am_pm_grid; | 88 | private Gtk.Grid am_pm_grid; |
130 | 87 | private bool changing_time = false; | 89 | private bool changing_time = false; |
131 | 88 | 90 | ||
133 | 89 | private PopOver popover; | 91 | private Gtk.Popover popover; |
134 | 90 | 92 | ||
135 | 91 | construct { | 93 | construct { |
136 | 92 | if (format_12 == null) | 94 | if (format_12 == null) |
137 | @@ -100,11 +102,9 @@ | |||
138 | 100 | icon_release.connect (on_icon_press); | 102 | icon_release.connect (on_icon_press); |
139 | 101 | 103 | ||
140 | 102 | // Creates the popover | 104 | // Creates the popover |
141 | 103 | popover = new PopOver (); | ||
142 | 104 | var pop_grid = new Gtk.Grid (); | 105 | var pop_grid = new Gtk.Grid (); |
143 | 105 | pop_grid.column_spacing = 6; | 106 | pop_grid.column_spacing = 6; |
144 | 106 | pop_grid.row_spacing = 6; | 107 | pop_grid.row_spacing = 6; |
145 | 107 | ((Gtk.Box) popover.get_content_area ()).add (pop_grid); | ||
146 | 108 | 108 | ||
147 | 109 | am_pm_grid = new Gtk.Grid (); | 109 | am_pm_grid = new Gtk.Grid (); |
148 | 110 | am_pm_grid.column_spacing = 6; | 110 | am_pm_grid.column_spacing = 6; |
149 | @@ -151,6 +151,10 @@ | |||
150 | 151 | pop_grid.attach (separation_label, 1, 0, 1, 1); | 151 | pop_grid.attach (separation_label, 1, 0, 1, 1); |
151 | 152 | pop_grid.attach (minutes_spinbutton, 2, 0, 1, 1); | 152 | pop_grid.attach (minutes_spinbutton, 2, 0, 1, 1); |
152 | 153 | pop_grid.attach (am_pm_grid, 0, 1, 3, 1); | 153 | pop_grid.attach (am_pm_grid, 0, 1, 3, 1); |
153 | 154 | pop_grid.margin = MARGIN; | ||
154 | 155 | |||
155 | 156 | popover = new Gtk.Popover (this); | ||
156 | 157 | popover.add (pop_grid); | ||
157 | 154 | 158 | ||
158 | 155 | // Connecting to events allowing manual changes | 159 | // Connecting to events allowing manual changes |
159 | 156 | add_events (Gdk.EventMask.FOCUS_CHANGE_MASK|Gdk.EventMask.SCROLL_MASK); | 160 | add_events (Gdk.EventMask.FOCUS_CHANGE_MASK|Gdk.EventMask.SCROLL_MASK); |
160 | @@ -222,7 +226,7 @@ | |||
161 | 222 | update_text (); | 226 | update_text (); |
162 | 223 | } | 227 | } |
163 | 224 | 228 | ||
165 | 225 | private void on_icon_press (Gtk.EntryIconPosition position) { | 229 | private void on_icon_press (Gtk.EntryIconPosition position, Gdk.Event event) { |
166 | 226 | changing_time = true; | 230 | changing_time = true; |
167 | 227 | 231 | ||
168 | 228 | if (Granite.DateTime.is_clock_format_12h () && time.get_hour () > 12) | 232 | if (Granite.DateTime.is_clock_format_12h () && time.get_hour () > 12) |
169 | @@ -249,20 +253,23 @@ | |||
170 | 249 | minutes_spinbutton.set_value (time.get_minute ()); | 253 | minutes_spinbutton.set_value (time.get_minute ()); |
171 | 250 | changing_time = false; | 254 | changing_time = false; |
172 | 251 | 255 | ||
174 | 252 | int x, y; | 256 | Gdk.Rectangle rect = Gdk.Rectangle (); |
175 | 257 | int x = 0; | ||
176 | 258 | int y = 0; | ||
177 | 253 | position_dropdown (out x, out y); | 259 | position_dropdown (out x, out y); |
178 | 260 | rect.x = x; | ||
179 | 261 | rect.y = y; | ||
180 | 262 | popover.pointing_to = rect; | ||
181 | 263 | popover.position = Gtk.PositionType.BOTTOM; | ||
182 | 254 | popover.show_all (); | 264 | popover.show_all (); |
183 | 255 | popover.move_to_coords (x, y); | ||
184 | 256 | popover.present (); | ||
185 | 257 | } | 265 | } |
186 | 258 | 266 | ||
187 | 259 | protected virtual void position_dropdown (out int x, out int y) { | 267 | protected virtual void position_dropdown (out int x, out int y) { |
188 | 260 | Gtk.Allocation size; | 268 | Gtk.Allocation size; |
189 | 261 | get_allocation (out size); | 269 | get_allocation (out size); |
190 | 262 | get_window ().get_origin (out x, out y); | ||
191 | 263 | 270 | ||
194 | 264 | x += size.x + size.width - 10; | 271 | x = size.width - OFFSET; |
195 | 265 | y += size.y + size.height; | 272 | y = size.height; |
196 | 266 | } | 273 | } |
197 | 267 | 274 | ||
198 | 268 | private void is_unfocused () { | 275 | private void is_unfocused () { |
Don't change the API without giving a proper reasoning!