[gnome-contacts] build: remove margin_left/right deprecated calls
- From: Erick Pérez Castellanos <erickpc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-contacts] build: remove margin_left/right deprecated calls
- Date: Fri, 14 Feb 2014 21:29:49 +0000 (UTC)
commit d6ba84ea7342665a9e571e5fa7e6d3028dd04633
Author: Erick Pérez Castellanos <erick red gmail com>
Date: Thu Feb 13 19:24:43 2014 -0500
build: remove margin_left/right deprecated calls
Remove some additional code added to deal with locales RTL
src/contacts-accounts-list.vala | 19 +++++--------------
src/contacts-app.vala | 8 ++++----
src/contacts-contact-editor.vala | 20 ++++----------------
src/contacts-contact-pane.vala | 15 +++------------
src/contacts-contact-sheet.vala | 15 +++------------
src/contacts-linked-accounts-dialog.vala | 10 ++--------
src/contacts-setup-window.vala | 8 ++++----
7 files changed, 25 insertions(+), 70 deletions(-)
---
diff --git a/src/contacts-accounts-list.vala b/src/contacts-accounts-list.vala
index 83709d4..1e3d501 100644
--- a/src/contacts-accounts-list.vala
+++ b/src/contacts-accounts-list.vala
@@ -47,8 +47,8 @@ public class Contacts.AccountsList : Grid {
add_account_button = new Button.with_label (_("Online Accounts"));
add_account_button.get_style_context ().add_class (STYLE_CLASS_RAISED);
- add_account_button.get_child ().margin_left = 6;
- add_account_button.get_child ().margin_right = 6;
+ add_account_button.get_child ().margin_start = 6;
+ add_account_button.get_child ().margin_end = 6;
add_account_button.get_child ().margin_top = 3;
add_account_button.get_child ().margin_bottom = 3;
add_account_button.clicked.connect (() => {
@@ -75,10 +75,7 @@ public class Contacts.AccountsList : Grid {
var row_data = (row as Bin).get_child () as Grid;
var checkmark = new Image.from_icon_name ("object-select-symbolic", IconSize.MENU);
- if (checkmark.get_direction () == TextDirection.LTR)
- checkmark.margin_right = 12;
- else
- checkmark.margin_left = 12;
+ checkmark.margin_end = 12;
checkmark.set_valign (Align.CENTER);
checkmark.set_halign (Align.END);
checkmark.set_vexpand (true);
@@ -131,10 +128,7 @@ public class Contacts.AccountsList : Grid {
var row_data = new Grid ();
row_data.set_data ("store", persona_store);
row_data.margin = 6;
- if (row_data.get_direction () == TextDirection.LTR)
- row_data.margin_left = 5;
- else
- row_data.margin_right = 5;
+ row_data.margin_start = 5;
row_data.set_row_spacing (2);
row_data.set_column_spacing (10);
@@ -172,10 +166,7 @@ public class Contacts.AccountsList : Grid {
var local_data = new Grid ();
local_data.margin = 6;
- if (local_data.get_direction () == TextDirection.LTR)
- local_data.margin_left = 5;
- else
- local_data.margin_right = 5;
+ local_data.margin_start = 5;
local_data.set_column_spacing (10);
local_data.set_data ("store", local_store);
var provider_image = new Image.from_icon_name ("drive-harddisk-system-symbolic",
diff --git a/src/contacts-app.vala b/src/contacts-app.vala
index 7aa78ea..5d92e3d 100644
--- a/src/contacts-app.vala
+++ b/src/contacts-app.vala
@@ -119,8 +119,8 @@ public class Contacts.App : Gtk.Application {
var cancel_button = new Button.with_label (_("Cancel"));
cancel_button.valign = Gtk.Align.CENTER;
cancel_button.get_child ().margin = 3;
- cancel_button.get_child ().margin_left = 6;
- cancel_button.get_child ().margin_right = 6;
+ cancel_button.get_child ().margin_start = 6;
+ cancel_button.get_child ().margin_end = 6;
cancel_button.clicked.connect (() => {
dialog.response (ResponseType.CANCEL);
});
@@ -130,8 +130,8 @@ public class Contacts.App : Gtk.Application {
done_button.valign = Gtk.Align.CENTER;
done_button.get_style_context ().add_class ("suggested-action");
done_button.get_child ().margin = 3;
- done_button.get_child ().margin_left = 6;
- done_button.get_child ().margin_right = 6;
+ done_button.get_child ().margin_start = 6;
+ done_button.get_child ().margin_end = 6;
done_button.clicked.connect (() => {
dialog.response (ResponseType.OK);
});
diff --git a/src/contacts-contact-editor.vala b/src/contacts-contact-editor.vala
index cf3b69d..ab59205 100644
--- a/src/contacts-contact-editor.vala
+++ b/src/contacts-contact-editor.vala
@@ -268,10 +268,7 @@ public class Contacts.ContactEditor : Grid {
var title_label = new Label (title);
title_label.set_hexpand (false);
title_label.set_halign (Align.START);
- if (title_label.get_direction () == TextDirection.LTR)
- title_label.margin_right = 6;
- else
- title_label.margin_left = 6;
+ title_label.margin_end = 6;
attach (title_label, 0, row, 1, 1);
var value_entry = new Entry ();
@@ -304,10 +301,7 @@ public class Contacts.ContactEditor : Grid {
title_label.set_halign (Align.START);
title_label.set_valign (Align.START);
title_label.margin_top = 3;
- if (title_label.get_direction () == TextDirection.LTR)
- title_label.margin_right = 6;
- else
- title_label.margin_left = 6;
+ title_label.margin_end = 6;
attach (title_label, 0, row, 1, 1);
var sw = new ScrolledWindow (null, null);
@@ -344,10 +338,7 @@ public class Contacts.ContactEditor : Grid {
var title_label = new Label (title);
title_label.set_hexpand (false);
title_label.set_halign (Align.START);
- if (title_label.get_direction () == TextDirection.LTR)
- title_label.margin_right = 6;
- else
- title_label.margin_left = 6;
+ title_label.margin_end = 6;
attach (title_label, 0, row, 1, 1);
var box = new Grid ();
@@ -696,10 +687,7 @@ public class Contacts.ContactEditor : Grid {
Contact.format_persona_store_name_for_contact (p)));
store_name.set_halign (Align.START);
store_name.xalign = 0.0f;
- if (store_name.get_direction () == TextDirection.LTR)
- store_name.margin_left = 6;
- else
- store_name.margin_right = 6;
+ store_name.margin_start = 6;
attach (store_name, 0, i, 2, 1);
last_store_position = ++i;
}
diff --git a/src/contacts-contact-pane.vala b/src/contacts-contact-pane.vala
index 22830f8..d099a76 100644
--- a/src/contacts-contact-pane.vala
+++ b/src/contacts-contact-pane.vala
@@ -174,10 +174,7 @@ public class Contacts.ContactPane : Notebook {
var image_frame = new ContactFrame (Contact.SMALL_AVATAR_SIZE);
image_frame.set_hexpand (false);
image_frame.margin = 24;
- if (image_frame.get_direction () == TextDirection.LTR)
- image_frame.margin_right = 12;
- else
- image_frame.margin_left = 12;
+ image_frame.margin_end = 12;
c.keep_widget_uptodate (image_frame, (w) => {
(w as ContactFrame).set_image (c.individual, c);
});
@@ -223,10 +220,7 @@ public class Contacts.ContactPane : Notebook {
bbox.set_halign (Align.END);
bbox.set_hexpand (true);
bbox.margin = 24;
- if (bbox.get_direction () == TextDirection.LTR)
- bbox.margin_left = 12;
- else
- bbox.margin_right = 12;
+ bbox.margin_start = 12;
suggestion_grid.attach (bbox, 2, 0, 1, 2);
suggestion_grid.show_all ();
}
@@ -435,10 +429,7 @@ public class Contacts.ContactPane : Notebook {
var tool_item = new ToolItem ();
tool_item.add (add_detail_button);
- if (tool_item.get_direction () == TextDirection.LTR)
- tool_item.margin_right = 12;
- else
- tool_item.margin_left = 12;
+ tool_item.margin_end = 12;
edit_toolbar.insert (tool_item, -1);
tool_item = new ToolItem ();
diff --git a/src/contacts-contact-sheet.vala b/src/contacts-contact-sheet.vala
index 9e407d3..8abe69a 100644
--- a/src/contacts-contact-sheet.vala
+++ b/src/contacts-contact-sheet.vala
@@ -61,10 +61,7 @@ public class Contacts.ContactSheet : Grid {
/* FIXME: hardcode gap to match the button size */
type_label.margin_top = 3;
- if (value_label.get_direction () == TextDirection.LTR)
- value_label.margin_left = 6;
- else
- value_label.margin_right = 6;
+ value_label.margin_start = 6;
value_label.margin_top = 3;
value_label.margin_bottom = 3;
@@ -93,10 +90,7 @@ public class Contacts.ContactSheet : Grid {
name_label.set_hexpand (true);
name_label.set_halign (Align.START);
name_label.set_valign (Align.CENTER);
- if (name_label.get_direction () == TextDirection.LTR)
- name_label.margin_left = 6;
- else
- name_label.margin_right = 6;
+ name_label.margin_start = 6;
name_label.set_ellipsize (Pango.EllipsizeMode.END);
name_label.xalign = 0.0f;
@@ -118,10 +112,7 @@ public class Contacts.ContactSheet : Grid {
Contact.format_persona_store_name_for_contact (p)));
store_name.set_halign (Align.START);
store_name.xalign = 0.0f;
- if (store_name.get_direction () == TextDirection.LTR)
- store_name.margin_left = 6;
- else
- store_name.margin_right = 6;
+ store_name.margin_start = 6;
attach (store_name, 0, i, 3, 1);
last_store_position = ++i;
}
diff --git a/src/contacts-linked-accounts-dialog.vala b/src/contacts-linked-accounts-dialog.vala
index 6b5b392..109e8a6 100644
--- a/src/contacts-linked-accounts-dialog.vala
+++ b/src/contacts-linked-accounts-dialog.vala
@@ -77,10 +77,7 @@ public class Contacts.LinkedAccountsDialog : Dialog {
var image_frame = new ContactFrame (Contact.SMALL_AVATAR_SIZE);
image_frame.set_hexpand (false);
image_frame.margin = 6;
- if (image_frame.get_direction () == TextDirection.LTR)
- image_frame.margin_right = 12;
- else
- image_frame.margin_left = 12;
+ image_frame.margin_end = 12;
contact.keep_widget_uptodate (image_frame, (w) => {
(w as ContactFrame).set_image (contact.individual, contact);
});
@@ -104,10 +101,7 @@ public class Contacts.LinkedAccountsDialog : Dialog {
var button = new Button.with_label (_("Remove"));
button.margin = 6;
- if (button.get_direction () == TextDirection.LTR)
- button.margin_left = 12;
- else
- button.margin_right = 12;
+ button.margin_start = 12;
button.set_valign (Align.CENTER);
button.get_child ().margin = 6;
row_grid.attach (button, 2, 0, 1, 2);
diff --git a/src/contacts-setup-window.vala b/src/contacts-setup-window.vala
index 980145a..0219c44 100644
--- a/src/contacts-setup-window.vala
+++ b/src/contacts-setup-window.vala
@@ -41,8 +41,8 @@ public class Contacts.SetupWindow : Gtk.Window {
var cancel_button = new Button.with_label (_("Cancel"));
cancel_button.valign = Gtk.Align.CENTER;
cancel_button.get_child ().margin = 3;
- cancel_button.get_child ().margin_left = 6;
- cancel_button.get_child ().margin_right = 6;
+ cancel_button.get_child ().margin_start = 6;
+ cancel_button.get_child ().margin_end = 6;
titlebar.pack_start (cancel_button);
cancel_button.clicked.connect ( (button) => {
this.destroy ();
@@ -55,8 +55,8 @@ public class Contacts.SetupWindow : Gtk.Window {
done_button = new Button.with_label (_("Done"));
done_button.valign = Gtk.Align.CENTER;
done_button.get_child ().margin = 3;
- done_button.get_child ().margin_left = 6;
- done_button.get_child ().margin_right = 6;
+ done_button.get_child ().margin_start = 6;
+ done_button.get_child ().margin_end = 6;
done_button.set_sensitive (false);
titlebar.pack_end (done_button);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]