[california] Ensure when built w/ Vala 0.28 will link w/ GTK+ <= 3.14: Bug #741265
- From: Jim Nelson <jnelson src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [california] Ensure when built w/ Vala 0.28 will link w/ GTK+ <= 3.14: Bug #741265
- Date: Mon, 8 Dec 2014 20:26:43 +0000 (UTC)
commit 44c977a8ccb253b1b81a657f1a9f62566100eb75
Author: Jim Nelson <jim yorba org>
Date: Mon Dec 8 12:25:50 2014 -0800
Ensure when built w/ Vala 0.28 will link w/ GTK+ <= 3.14: Bug #741265
src/activator/activator-instance-list.vala | 2 +-
.../google/google-calendar-list-pane.vala | 2 +-
src/event-editor/event-editor-attendees-card.vala | 2 +-
src/host/host-show-event.vala | 2 +-
src/toolkit/toolkit.vala | 14 ++++++++++++++
5 files changed, 18 insertions(+), 4 deletions(-)
---
diff --git a/src/activator/activator-instance-list.vala b/src/activator/activator-instance-list.vala
index 9749fb5..c3ec578 100644
--- a/src/activator/activator-instance-list.vala
+++ b/src/activator/activator-instance-list.vala
@@ -68,7 +68,7 @@ public class InstanceList : Gtk.Grid, Toolkit.Card {
private Gtk.Widget model_presentation(Instance activator) {
Gtk.Label label = new Gtk.Label(activator.title);
- label.xalign = 0.0f;
+ Toolkit.set_label_xalign(label, 0.0f);
label.margin = 4;
return label;
diff --git a/src/activator/google/google-calendar-list-pane.vala
b/src/activator/google/google-calendar-list-pane.vala
index de1e75d..60391d7 100644
--- a/src/activator/google/google-calendar-list-pane.vala
+++ b/src/activator/google/google-calendar-list-pane.vala
@@ -110,7 +110,7 @@ public class CalendarListPane : Gtk.Grid, Toolkit.Card {
private Gtk.Widget entry_to_widget(GData.CalendarCalendar calendar) {
Gtk.Label label = new Gtk.Label(calendar.title);
- label.xalign = 0.0f;
+ Toolkit.set_label_xalign(label, 0.0f);
return label;
}
diff --git a/src/event-editor/event-editor-attendees-card.vala
b/src/event-editor/event-editor-attendees-card.vala
index 4ee391e..f0b6679 100644
--- a/src/event-editor/event-editor-attendees-card.vala
+++ b/src/event-editor/event-editor-attendees-card.vala
@@ -35,7 +35,7 @@ public class AttendeesCard : Gtk.Box, Toolkit.Card {
update_invite_button();
Gtk.Label email_label = new Gtk.Label(attendee.full_mailbox);
- email_label.xalign = 0.0f;
+ Toolkit.set_label_xalign(email_label, 0.0f);
add(invite_button);
add(email_label);
diff --git a/src/host/host-show-event.vala b/src/host/host-show-event.vala
index ade79d9..2b8822e 100644
--- a/src/host/host-show-event.vala
+++ b/src/host/host-show-event.vala
@@ -118,7 +118,7 @@ public class ShowEvent : Gtk.Grid, Toolkit.Card {
rotating_button_box.pack_end(FAMILY_NORMAL, action_box, false, true);
- delete_label.xalign = 1.0f;
+ Toolkit.set_label_xalign(delete_label, 1.0f);
delete_label.get_style_context().add_class(Gtk.STYLE_CLASS_DIM_LABEL);
rotating_button_box.pack_start(FAMILY_REMOVING, delete_label);
rotating_button_box.pack_end(FAMILY_REMOVING, remove_this_button);
diff --git a/src/toolkit/toolkit.vala b/src/toolkit/toolkit.vala
index f407356..94c87ae 100644
--- a/src/toolkit/toolkit.vala
+++ b/src/toolkit/toolkit.vala
@@ -117,6 +117,20 @@ public Gdk.Cursor? set_toplevel_cursor(Gtk.Widget widget, Gdk.CursorType? cursor
}
/**
+ * Set xalign property on Gtk.Label in a compatible way.
+ *
+ * GtkMisc is being deprecated in GTK+ 3 and the "xalign" property has been moved to GtkLabel. This
+ * causes compatibility problems with newer versions of Vala generating code that won't link with
+ * older versions of GTK+. This is a convenience method until California requires GTK+ 3.16 as its
+ * minimum GTK+ version.
+ *
+ * See [[https://bugzilla.gnome.org/show_bug.cgi?id=741265]]
+ */
+public void set_label_xalign(Gtk.Label label, float xalign) {
+ label.set("xalign", xalign);
+}
+
+/**
* Destroy a Gtk.Widget when the event loop is idle.
*/
public void destroy_later(Gtk.Widget widget) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]