[gnome-control-center] printers: Don't use methods of deprecated GtkMisc
- From: Marek Kašík <mkasik src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] printers: Don't use methods of deprecated GtkMisc
- Date: Tue, 25 Nov 2014 11:02:12 +0000 (UTC)
commit 66eb1c9164aa62b92b9377a26c119ca4f192a767
Author: Marek Kasik <mkasik redhat com>
Date: Fri Nov 7 14:57:00 2014 +0100
printers: Don't use methods of deprecated GtkMisc
Use GtkWidget's methods for settings of halign, valign and margin-start
instead of GtkMisc's methods for settings of xalign, yalign and xpad.
https://bugzilla.gnome.org/show_bug.cgi?id=739737
panels/printers/cc-printers-panel.c | 8 ++++----
panels/printers/pp-options-dialog.c | 6 ++++--
panels/printers/pp-ppd-selection-dialog.c | 4 ++--
3 files changed, 10 insertions(+), 8 deletions(-)
---
diff --git a/panels/printers/cc-printers-panel.c b/panels/printers/cc-printers-panel.c
index 7fdd394..7967f84 100644
--- a/panels/printers/cc-printers-panel.c
+++ b/panels/printers/cc-printers-panel.c
@@ -2814,7 +2814,7 @@ update_label_padding (GtkWidget *widget,
GtkWidget *label;
GtkWidget *sublabel;
gint offset;
- gint pad;
+ gint margin;
priv = PRINTERS_PANEL_PRIVATE (self);
@@ -2829,9 +2829,9 @@ update_label_padding (GtkWidget *widget,
label = (GtkWidget*)
gtk_builder_get_object (priv->builder, "printer-model-label");
- gtk_misc_get_padding (GTK_MISC (label), &pad, NULL);
- if (offset != pad)
- gtk_misc_set_padding (GTK_MISC (label), offset, 0);
+ margin = gtk_widget_get_margin_start (label);
+ if (offset != margin)
+ gtk_widget_set_margin_start (label, offset);
}
}
diff --git a/panels/printers/pp-options-dialog.c b/panels/printers/pp-options-dialog.c
index e3c1eb7..e96f4e7 100644
--- a/panels/printers/pp-options-dialog.c
+++ b/panels/printers/pp-options-dialog.c
@@ -350,7 +350,8 @@ ipp_option_add (IPPAttribute *attr_supported,
label = gtk_label_new (option_display_name);
context = gtk_widget_get_style_context (label);
gtk_style_context_add_class (context, "dim-label");
- gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
+ gtk_widget_set_halign (label, GTK_ALIGN_END);
+ gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
gtk_widget_set_margin_start (label, 10);
gtk_grid_attach (GTK_GRID (grid), label, 0, position, 1, 1);
@@ -381,7 +382,8 @@ ppd_option_add (ppd_option_t option,
label = gtk_label_new (ppd_option_name_translate (&option));
context = gtk_widget_get_style_context (label);
gtk_style_context_add_class (context, "dim-label");
- gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
+ gtk_widget_set_halign (label, GTK_ALIGN_END);
+ gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
gtk_widget_set_margin_start (label, 10);
gtk_grid_attach (GTK_GRID (grid), label, 0, position, 1, 1);
diff --git a/panels/printers/pp-ppd-selection-dialog.c b/panels/printers/pp-ppd-selection-dialog.c
index ba9401b..8c2b1ca 100644
--- a/panels/printers/pp-ppd-selection-dialog.c
+++ b/panels/printers/pp-ppd-selection-dialog.c
@@ -234,7 +234,7 @@ populate_dialog (PpPPDSelectionDialog *dialog)
"text", PPD_MANUFACTURERS_DISPLAY_NAMES_COLUMN, NULL);
gtk_tree_view_column_set_expand (column, TRUE);
header = gtk_label_new (gtk_tree_view_column_get_title (column));
- gtk_misc_set_padding (GTK_MISC (header), 10, 0);
+ gtk_widget_set_margin_start (header, 10);
gtk_tree_view_column_set_widget (column, header);
gtk_widget_show (header);
gtk_tree_view_append_column (manufacturers_treeview, column);
@@ -252,7 +252,7 @@ populate_dialog (PpPPDSelectionDialog *dialog)
NULL);
gtk_tree_view_column_set_expand (column, TRUE);
header = gtk_label_new (gtk_tree_view_column_get_title (column));
- gtk_misc_set_padding (GTK_MISC (header), 10, 0);
+ gtk_widget_set_margin_start (header, 10);
gtk_tree_view_column_set_widget (column, header);
gtk_widget_show (header);
gtk_tree_view_append_column (models_treeview, column);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]