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
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2014-02-23 19:07:04 +0000
+++ CMakeLists.txt 2014-04-27 22:26:07 +0000
@@ -28,7 +28,7 @@
28include (ValaVersion)28include (ValaVersion)
29include (ValaPrecompile)29include (ValaPrecompile)
3030
31ensure_vala_version ("0.20.1" MINIMUM)31ensure_vala_version ("0.23.2" MINIMUM)
3232
33#33#
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.)
@@ -45,7 +45,7 @@
45 gee-0.8)45 gee-0.8)
4646
47set (PKG_DEPS_CHECK47set (PKG_DEPS_CHECK
48 gtk+-3.0>=3.3.1448 gtk+-3.0>=3.11.6
49 gio-unix-2.049 gio-unix-2.0
50 gthread-2.050 gthread-2.0
51 gee-0.8)51 gee-0.8)
5252
=== modified file 'lib/Widgets/DatePicker.vala'
--- lib/Widgets/DatePicker.vala 2014-03-19 07:21:38 +0000
+++ lib/Widgets/DatePicker.vala 2014-04-27 22:26:07 +0000
@@ -27,6 +27,8 @@
27 */27 */
28 public class DatePicker : Gtk.Entry, Gtk.Buildable {28 public class DatePicker : Gtk.Entry, Gtk.Buildable {
2929
30 const int OFFSET = 15;
31 const int MARGIN = 6;
30 /**32 /**
31 * Desired format of DatePicker33 * Desired format of DatePicker
32 */34 */
@@ -41,7 +43,7 @@
41 */43 */
42 protected Calendar calendar;44 protected Calendar calendar;
4345
44 PopOver popover;46 private Gtk.Popover popover;
4547
46 private GLib.DateTime _date;48 private GLib.DateTime _date;
4749
@@ -66,8 +68,9 @@
66 format = Granite.DateTime.get_default_date_format (false, true, true);68 format = Granite.DateTime.get_default_date_format (false, true, true);
67 69
68 dropdown = new Gtk.EventBox ();70 dropdown = new Gtk.EventBox ();
69 popover = new PopOver ();71 dropdown.margin = MARGIN;
70 ((Gtk.Box) popover.get_content_area ()).add (dropdown);72 popover = new Gtk.Popover (this);
73 popover.add (dropdown);
71 calendar = new Calendar ();74 calendar = new Calendar ();
72 date = new GLib.DateTime.now_local ();75 date = new GLib.DateTime.now_local ();
7376
@@ -117,30 +120,20 @@
117 }120 }
118121
119 private void on_icon_press (EntryIconPosition position) {122 private void on_icon_press (EntryIconPosition position) {
120123 Gdk.Rectangle rect = Gdk.Rectangle ();
121 int x, y;124 position_dropdown (out rect);
122 position_dropdown (out x, out y);125 popover.pointing_to = rect;
123126 popover.position = Gtk.PositionType.BOTTOM;
124 popover.show_all ();127 popover.show_all ();
125 popover.move_to_coords (x, y);
126 popover.present ();
127 calendar.grab_focus ();128 calendar.grab_focus ();
128 }129 }
129130
130 protected virtual void position_dropdown (out int x, out int y) {131 protected virtual void position_dropdown (out Gdk.Rectangle rect) {
131132 Gtk.Allocation size;
132 Allocation size;
133 Requisition calendar_size;
134
135 get_allocation (out size);133 get_allocation (out size);
136 calendar.get_preferred_size (out calendar_size, null);134
137 get_window ().get_origin (out x, out y);135 rect.x = size.width - OFFSET;
138136 rect.y = size.height;
139 x += size.x + size.width - 10; //size.x - (calendar_size.width - size.width);
140 y += size.y + size.height;
141
142 //x = x.clamp (0, int.max (0, Screen.width () - calendar_size.width));
143 //y = y.clamp (0, int.max (0, Screen.height () - calendar_size.height));
144 }137 }
145138
146 private void on_calendar_day_selected () {139 private void on_calendar_day_selected () {
@@ -156,4 +149,4 @@
156 popover.hide ();149 popover.hide ();
157 }150 }
158 }151 }
159}152}
160\ No newline at end of file153\ No newline at end of file
161154
=== modified file 'lib/Widgets/PopOver.vala'
--- lib/Widgets/PopOver.vala 2014-04-08 20:21:10 +0000
+++ lib/Widgets/PopOver.vala 2014-04-27 22:26:07 +0000
@@ -492,5 +492,4 @@
492 cr.paint_with_alpha(1.0);492 cr.paint_with_alpha(1.0);
493 return base.draw(cr);493 return base.draw(cr);
494 }494 }
495}495}
496
497\ No newline at end of file496\ No newline at end of file
498497
=== modified file 'lib/Widgets/TimePicker.vala'
--- lib/Widgets/TimePicker.vala 2014-02-07 16:19:37 +0000
+++ lib/Widgets/TimePicker.vala 2014-04-27 22:26:07 +0000
@@ -25,6 +25,8 @@
25 */25 */
26 public class TimePicker : Gtk.Entry {26 public class TimePicker : Gtk.Entry {
2727
28 const int OFFSET = 15;
29 const int MARGIN = 6;
28 // Signals30 // Signals
29 /**31 /**
30 * Sent when the time got changed32 * Sent when the time got changed
@@ -86,7 +88,7 @@
86 private Gtk.Grid am_pm_grid;88 private Gtk.Grid am_pm_grid;
87 private bool changing_time = false;89 private bool changing_time = false;
8890
89 private PopOver popover;91 private Gtk.Popover popover;
9092
91 construct {93 construct {
92 if (format_12 == null)94 if (format_12 == null)
@@ -100,11 +102,9 @@
100 icon_release.connect (on_icon_press);102 icon_release.connect (on_icon_press);
101103
102 // Creates the popover104 // Creates the popover
103 popover = new PopOver ();
104 var pop_grid = new Gtk.Grid ();105 var pop_grid = new Gtk.Grid ();
105 pop_grid.column_spacing = 6;106 pop_grid.column_spacing = 6;
106 pop_grid.row_spacing = 6;107 pop_grid.row_spacing = 6;
107 ((Gtk.Box) popover.get_content_area ()).add (pop_grid);
108108
109 am_pm_grid = new Gtk.Grid ();109 am_pm_grid = new Gtk.Grid ();
110 am_pm_grid.column_spacing = 6;110 am_pm_grid.column_spacing = 6;
@@ -151,6 +151,10 @@
151 pop_grid.attach (separation_label, 1, 0, 1, 1);151 pop_grid.attach (separation_label, 1, 0, 1, 1);
152 pop_grid.attach (minutes_spinbutton, 2, 0, 1, 1);152 pop_grid.attach (minutes_spinbutton, 2, 0, 1, 1);
153 pop_grid.attach (am_pm_grid, 0, 1, 3, 1);153 pop_grid.attach (am_pm_grid, 0, 1, 3, 1);
154 pop_grid.margin = MARGIN;
155
156 popover = new Gtk.Popover (this);
157 popover.add (pop_grid);
154158
155 // Connecting to events allowing manual changes159 // Connecting to events allowing manual changes
156 add_events (Gdk.EventMask.FOCUS_CHANGE_MASK|Gdk.EventMask.SCROLL_MASK);160 add_events (Gdk.EventMask.FOCUS_CHANGE_MASK|Gdk.EventMask.SCROLL_MASK);
@@ -222,7 +226,7 @@
222 update_text ();226 update_text ();
223 }227 }
224228
225 private void on_icon_press (Gtk.EntryIconPosition position) {229 private void on_icon_press (Gtk.EntryIconPosition position, Gdk.Event event) {
226 changing_time = true;230 changing_time = true;
227231
228 if (Granite.DateTime.is_clock_format_12h () && time.get_hour () > 12)232 if (Granite.DateTime.is_clock_format_12h () && time.get_hour () > 12)
@@ -249,20 +253,23 @@
249 minutes_spinbutton.set_value (time.get_minute ());253 minutes_spinbutton.set_value (time.get_minute ());
250 changing_time = false;254 changing_time = false;
251255
252 int x, y;256 Gdk.Rectangle rect = Gdk.Rectangle ();
257 int x = 0;
258 int y = 0;
253 position_dropdown (out x, out y);259 position_dropdown (out x, out y);
260 rect.x = x;
261 rect.y = y;
262 popover.pointing_to = rect;
263 popover.position = Gtk.PositionType.BOTTOM;
254 popover.show_all ();264 popover.show_all ();
255 popover.move_to_coords (x, y);
256 popover.present ();
257 }265 }
258266
259 protected virtual void position_dropdown (out int x, out int y) {267 protected virtual void position_dropdown (out int x, out int y) {
260 Gtk.Allocation size;268 Gtk.Allocation size;
261 get_allocation (out size);269 get_allocation (out size);
262 get_window ().get_origin (out x, out y);
263270
264 x += size.x + size.width - 10;271 x = size.width - OFFSET;
265 y += size.y + size.height;272 y = size.height;
266 }273 }
267274
268 private void is_unfocused () {275 private void is_unfocused () {

Subscribers

People subscribed via source and target branches