Merge lp:~tintou/granite/gtk3.12 into lp:~elementary-pantheon/granite/granite

Proposed by Corentin Noël
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
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.

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.

To post a comment you must log in.
Revision history for this message
Rico Tzschichholz (ricotz) wrote :

Don't change the API without giving a proper reasoning!

Revision history for this message
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

review: Needs Fixing
lp:~tintou/granite/gtk3.12 updated
697. By Launchpad Translations on behalf of elementary-pantheon

Launchpad automatic translations update.

Revision history for this message
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.

Revision history for this message
Rico Tzschichholz (ricotz) wrote :

I was referring to those "rect.x = size.width - 15;" as well ;)

Revision history for this message
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.

lp:~tintou/granite/gtk3.12 updated
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

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
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 include (ValaVersion)
6 include (ValaPrecompile)
7
8-ensure_vala_version ("0.20.1" MINIMUM)
9+ensure_vala_version ("0.23.2" MINIMUM)
10
11 #
12 # Packages in PKG_DEPS are used with the vala compiler and other related tools (not versioned.)
13@@ -45,7 +45,7 @@
14 gee-0.8)
15
16 set (PKG_DEPS_CHECK
17- gtk+-3.0>=3.3.14
18+ gtk+-3.0>=3.11.6
19 gio-unix-2.0
20 gthread-2.0
21 gee-0.8)
22
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 */
28 public class DatePicker : Gtk.Entry, Gtk.Buildable {
29
30+ const int OFFSET = 15;
31+ const int MARGIN = 6;
32 /**
33 * Desired format of DatePicker
34 */
35@@ -41,7 +43,7 @@
36 */
37 protected Calendar calendar;
38
39- PopOver popover;
40+ private Gtk.Popover popover;
41
42 private GLib.DateTime _date;
43
44@@ -66,8 +68,9 @@
45 format = Granite.DateTime.get_default_date_format (false, true, true);
46
47 dropdown = new Gtk.EventBox ();
48- popover = new PopOver ();
49- ((Gtk.Box) popover.get_content_area ()).add (dropdown);
50+ dropdown.margin = MARGIN;
51+ popover = new Gtk.Popover (this);
52+ popover.add (dropdown);
53 calendar = new Calendar ();
54 date = new GLib.DateTime.now_local ();
55
56@@ -117,30 +120,20 @@
57 }
58
59 private void on_icon_press (EntryIconPosition position) {
60-
61- int x, y;
62- position_dropdown (out x, out y);
63-
64+ Gdk.Rectangle rect = Gdk.Rectangle ();
65+ position_dropdown (out rect);
66+ popover.pointing_to = rect;
67+ popover.position = Gtk.PositionType.BOTTOM;
68 popover.show_all ();
69- popover.move_to_coords (x, y);
70- popover.present ();
71 calendar.grab_focus ();
72 }
73
74- protected virtual void position_dropdown (out int x, out int y) {
75-
76- Allocation size;
77- Requisition calendar_size;
78-
79+ protected virtual void position_dropdown (out Gdk.Rectangle rect) {
80+ Gtk.Allocation size;
81 get_allocation (out size);
82- calendar.get_preferred_size (out calendar_size, null);
83- get_window ().get_origin (out x, out y);
84-
85- x += size.x + size.width - 10; //size.x - (calendar_size.width - size.width);
86- y += size.y + size.height;
87-
88- //x = x.clamp (0, int.max (0, Screen.width () - calendar_size.width));
89- //y = y.clamp (0, int.max (0, Screen.height () - calendar_size.height));
90+
91+ rect.x = size.width - OFFSET;
92+ rect.y = size.height;
93 }
94
95 private void on_calendar_day_selected () {
96@@ -156,4 +149,4 @@
97 popover.hide ();
98 }
99 }
100-}
101+}
102\ No newline at end of file
103
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 cr.paint_with_alpha(1.0);
109 return base.draw(cr);
110 }
111-}
112-
113+}
114\ No newline at end of file
115
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 */
121 public class TimePicker : Gtk.Entry {
122
123+ const int OFFSET = 15;
124+ const int MARGIN = 6;
125 // Signals
126 /**
127 * Sent when the time got changed
128@@ -86,7 +88,7 @@
129 private Gtk.Grid am_pm_grid;
130 private bool changing_time = false;
131
132- private PopOver popover;
133+ private Gtk.Popover popover;
134
135 construct {
136 if (format_12 == null)
137@@ -100,11 +102,9 @@
138 icon_release.connect (on_icon_press);
139
140 // Creates the popover
141- popover = new PopOver ();
142 var pop_grid = new Gtk.Grid ();
143 pop_grid.column_spacing = 6;
144 pop_grid.row_spacing = 6;
145- ((Gtk.Box) popover.get_content_area ()).add (pop_grid);
146
147 am_pm_grid = new Gtk.Grid ();
148 am_pm_grid.column_spacing = 6;
149@@ -151,6 +151,10 @@
150 pop_grid.attach (separation_label, 1, 0, 1, 1);
151 pop_grid.attach (minutes_spinbutton, 2, 0, 1, 1);
152 pop_grid.attach (am_pm_grid, 0, 1, 3, 1);
153+ pop_grid.margin = MARGIN;
154+
155+ popover = new Gtk.Popover (this);
156+ popover.add (pop_grid);
157
158 // Connecting to events allowing manual changes
159 add_events (Gdk.EventMask.FOCUS_CHANGE_MASK|Gdk.EventMask.SCROLL_MASK);
160@@ -222,7 +226,7 @@
161 update_text ();
162 }
163
164- private void on_icon_press (Gtk.EntryIconPosition position) {
165+ private void on_icon_press (Gtk.EntryIconPosition position, Gdk.Event event) {
166 changing_time = true;
167
168 if (Granite.DateTime.is_clock_format_12h () && time.get_hour () > 12)
169@@ -249,20 +253,23 @@
170 minutes_spinbutton.set_value (time.get_minute ());
171 changing_time = false;
172
173- int x, y;
174+ Gdk.Rectangle rect = Gdk.Rectangle ();
175+ int x = 0;
176+ int y = 0;
177 position_dropdown (out x, out y);
178+ rect.x = x;
179+ rect.y = y;
180+ popover.pointing_to = rect;
181+ popover.position = Gtk.PositionType.BOTTOM;
182 popover.show_all ();
183- popover.move_to_coords (x, y);
184- popover.present ();
185 }
186
187 protected virtual void position_dropdown (out int x, out int y) {
188 Gtk.Allocation size;
189 get_allocation (out size);
190- get_window ().get_origin (out x, out y);
191
192- x += size.x + size.width - 10;
193- y += size.y + size.height;
194+ x = size.width - OFFSET;
195+ y = size.height;
196 }
197
198 private void is_unfocused () {

Subscribers

People subscribed via source and target branches