summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Ulbrich <[email protected]>2015-12-13 17:36:55 +0100
committerWolfgang Ulbrich <[email protected]>2015-12-13 17:36:55 +0100
commitb8d7f35570dad2b6285a4c7f02712c6111e79902 (patch)
tree0e13cb1921b0bcfecbec7c19ccd9d105d77602ce
parentf78b6c9444c46c54440b8f6367d88f0e80e72a36 (diff)
downloadmate-screensaver-b8d7f35570dad2b6285a4c7f02712c6111e79902.tar.bz2
mate-screensaver-b8d7f35570dad2b6285a4c7f02712c6111e79902.tar.xz
GTK3: don't use deprecated GtkMisc
-rw-r--r--src/copy-theme-dialog.c19
-rw-r--r--src/gs-lock-plug.c34
-rw-r--r--src/gs-window-x11.c12
3 files changed, 65 insertions, 0 deletions
diff --git a/src/copy-theme-dialog.c b/src/copy-theme-dialog.c
index 17821e0..bbde2c6 100644
--- a/src/copy-theme-dialog.c
+++ b/src/copy-theme-dialog.c
@@ -221,7 +221,12 @@ copy_theme_dialog_init (CopyThemeDialog *dlg)
gtk_label_set_markup (GTK_LABEL (dlg->priv->status), markup);
g_free (markup);
+#if GTK_CHECK_VERSION (3, 14, 0)
+ gtk_widget_set_halign (dlg->priv->status, GTK_ALIGN_START);
+ gtk_widget_set_valign (dlg->priv->status, GTK_ALIGN_START);
+#else
gtk_misc_set_alignment (GTK_MISC (dlg->priv->status), 0.0, 0.0);
+#endif
gtk_box_pack_start (GTK_BOX (vbox), dlg->priv->status, FALSE, FALSE, 0);
@@ -253,7 +258,11 @@ copy_theme_dialog_init (CopyThemeDialog *dlg)
dlg->priv->current = gtk_label_new ("");
gtk_box_pack_start (GTK_BOX (progress_vbox),
dlg->priv->current, FALSE, FALSE, 0);
+#if GTK_CHECK_VERSION (3, 14, 0)
+ gtk_widget_set_halign (dlg->priv->current, GTK_ALIGN_START);
+#else
gtk_misc_set_alignment (GTK_MISC (dlg->priv->current), 0.0, 0.5);
+#endif
gtk_dialog_add_button (GTK_DIALOG (dlg),
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
@@ -532,7 +541,12 @@ create_titled_label (GtkTable *table,
{
*title_widget = gtk_label_new ("");
eel_gtk_label_make_bold (GTK_LABEL (*title_widget));
+#if GTK_CHECK_VERSION (3, 14, 0)
+ gtk_widget_set_halign (*title_widget, GTK_ALIGN_END);
+ gtk_widget_set_valign (*title_widget, GTK_ALIGN_START);
+#else
gtk_misc_set_alignment (GTK_MISC (*title_widget), 1, 0);
+#endif
gtk_table_attach (table, *title_widget,
0, 1,
row, row + 1,
@@ -548,5 +562,10 @@ create_titled_label (GtkTable *table,
GTK_FILL | GTK_EXPAND, 0,
0, 0);
gtk_widget_show (*label_text_widget);
+#if GTK_CHECK_VERSION (3, 14, 0)
+ gtk_widget_set_halign (*label_text_widget, GTK_ALIGN_START);
+ gtk_widget_set_valign (*label_text_widget, GTK_ALIGN_START);
+#else
gtk_misc_set_alignment (GTK_MISC (*label_text_widget), 0, 0);
+#endif
}
diff --git a/src/gs-lock-plug.c b/src/gs-lock-plug.c
index b8f5294..af3326b 100644
--- a/src/gs-lock-plug.c
+++ b/src/gs-lock-plug.c
@@ -1960,20 +1960,35 @@ create_page_one (GSLockPlug *plug)
str = g_strdup ("<span size=\"xx-large\" weight=\"ultrabold\">%s</span>");
plug->priv->auth_time_label = gtk_label_new (str);
g_free (str);
+#if GTK_CHECK_VERSION (3, 14, 0)
+ gtk_widget_set_halign (plug->priv->auth_time_label, GTK_ALIGN_CENTER);
+ gtk_widget_set_valign (plug->priv->auth_time_label, GTK_ALIGN_CENTER);
+#else
gtk_misc_set_alignment (GTK_MISC (plug->priv->auth_time_label), 0.5, 0.5);
+#endif
gtk_label_set_use_markup (GTK_LABEL (plug->priv->auth_time_label), TRUE);
gtk_box_pack_start (GTK_BOX (vbox2), plug->priv->auth_time_label, FALSE, FALSE, 0);
str = g_strdup ("<span size=\"large\">%s</span>");
plug->priv->auth_date_label = gtk_label_new (str);
g_free (str);
+#if GTK_CHECK_VERSION (3, 14, 0)
+ gtk_widget_set_halign (plug->priv->auth_date_label, GTK_ALIGN_CENTER);
+ gtk_widget_set_valign (plug->priv->auth_date_label, GTK_ALIGN_CENTER);
+#else
gtk_misc_set_alignment (GTK_MISC (plug->priv->auth_date_label), 0.5, 0.5);
+#endif
gtk_label_set_use_markup (GTK_LABEL (plug->priv->auth_date_label), TRUE);
gtk_box_pack_start (GTK_BOX (vbox2), plug->priv->auth_date_label, FALSE, FALSE, 0);
plug->priv->auth_face_image = gtk_image_new ();
gtk_box_pack_start (GTK_BOX (vbox), plug->priv->auth_face_image, TRUE, TRUE, 0);
+#if GTK_CHECK_VERSION (3, 14, 0)
+ gtk_widget_set_halign (plug->priv->auth_face_image, GTK_ALIGN_CENTER);
+ gtk_widget_set_valign (plug->priv->auth_face_image, GTK_ALIGN_END);
+#else
gtk_misc_set_alignment (GTK_MISC (plug->priv->auth_face_image), 0.5, 1.0);
+#endif
vbox2 = gtk_vbox_new (FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), vbox2, FALSE, FALSE, 0);
@@ -1982,7 +1997,12 @@ create_page_one (GSLockPlug *plug)
plug->priv->auth_realname_label = gtk_label_new (str);
g_free (str);
expand_string_for_label (plug->priv->auth_realname_label);
+#if GTK_CHECK_VERSION (3, 14, 0)
+ gtk_widget_set_halign (plug->priv->auth_realname_label, GTK_ALIGN_CENTER);
+ gtk_widget_set_valign (plug->priv->auth_realname_label, GTK_ALIGN_CENTER);
+#else
gtk_misc_set_alignment (GTK_MISC (plug->priv->auth_realname_label), 0.5, 0.5);
+#endif
gtk_label_set_use_markup (GTK_LABEL (plug->priv->auth_realname_label), TRUE);
gtk_box_pack_start (GTK_BOX (vbox2), plug->priv->auth_realname_label, FALSE, FALSE, 0);
@@ -1991,7 +2011,12 @@ create_page_one (GSLockPlug *plug)
plug->priv->auth_username_label = gtk_label_new (str);
g_free (str);
expand_string_for_label (plug->priv->auth_username_label);
+#if GTK_CHECK_VERSION (3, 14, 0)
+ gtk_widget_set_halign (plug->priv->auth_username_label, GTK_ALIGN_CENTER);
+ gtk_widget_set_valign (plug->priv->auth_username_label, GTK_ALIGN_CENTER);
+#else
gtk_misc_set_alignment (GTK_MISC (plug->priv->auth_username_label), 0.5, 0.5);
+#endif
gtk_label_set_use_markup (GTK_LABEL (plug->priv->auth_username_label), TRUE);
gtk_box_pack_start (GTK_BOX (vbox2), plug->priv->auth_username_label, FALSE, FALSE, 0);
@@ -2002,7 +2027,11 @@ create_page_one (GSLockPlug *plug)
gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
plug->priv->auth_prompt_label = gtk_label_new_with_mnemonic (_("_Password:"));
+#if GTK_CHECK_VERSION (3, 14, 0)
+ gtk_widget_set_halign (plug->priv->auth_prompt_label, GTK_ALIGN_START);
+#else
gtk_misc_set_alignment (GTK_MISC (plug->priv->auth_prompt_label), 0, 0.5);
+#endif
gtk_box_pack_start (GTK_BOX (hbox), plug->priv->auth_prompt_label, FALSE, FALSE, 0);
plug->priv->auth_prompt_entry = gtk_entry_new ();
@@ -2012,7 +2041,12 @@ create_page_one (GSLockPlug *plug)
plug->priv->auth_prompt_entry);
plug->priv->auth_capslock_label = gtk_label_new ("");
+#if GTK_CHECK_VERSION (3, 14, 0)
+ gtk_widget_set_halign (plug->priv->auth_capslock_label, GTK_ALIGN_CENTER);
+ gtk_widget_set_valign (plug->priv->auth_capslock_label, GTK_ALIGN_CENTER);
+#else
gtk_misc_set_alignment (GTK_MISC (plug->priv->auth_capslock_label), 0.5, 0.5);
+#endif
gtk_box_pack_start (GTK_BOX (vbox2), plug->priv->auth_capslock_label, FALSE, FALSE, 0);
/* Status text */
diff --git a/src/gs-window-x11.c b/src/gs-window-x11.c
index 15fb677..066d4a7 100644
--- a/src/gs-window-x11.c
+++ b/src/gs-window-x11.c
@@ -1125,7 +1125,11 @@ set_info_text_and_icon (GSWindow *window,
image = gtk_image_new_from_stock (icon_stock_id, GTK_ICON_SIZE_DIALOG);
gtk_widget_show (image);
gtk_box_pack_start (GTK_BOX (hbox_content), image, FALSE, FALSE, 0);
+#if GTK_CHECK_VERSION (3, 14, 0)
+ gtk_widget_set_valign (image, GTK_ALIGN_START);
+#else
gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0);
+#endif
vbox = gtk_vbox_new (FALSE, 6);
gtk_widget_show (vbox);
@@ -1138,7 +1142,11 @@ set_info_text_and_icon (GSWindow *window,
gtk_box_pack_start (GTK_BOX (vbox), primary_label, TRUE, TRUE, 0);
gtk_label_set_use_markup (GTK_LABEL (primary_label), TRUE);
gtk_label_set_line_wrap (GTK_LABEL (primary_label), TRUE);
+#if GTK_CHECK_VERSION (3, 14, 0)
+ gtk_widget_set_halign (primary_label, GTK_ALIGN_START);
+#else
gtk_misc_set_alignment (GTK_MISC (primary_label), 0, 0.5);
+#endif
if (secondary_text != NULL)
{
@@ -1150,7 +1158,11 @@ set_info_text_and_icon (GSWindow *window,
gtk_box_pack_start (GTK_BOX (vbox), secondary_label, TRUE, TRUE, 0);
gtk_label_set_use_markup (GTK_LABEL (secondary_label), TRUE);
gtk_label_set_line_wrap (GTK_LABEL (secondary_label), TRUE);
+#if GTK_CHECK_VERSION (3, 14, 0)
+ gtk_widget_set_halign (secondary_label, GTK_ALIGN_START);
+#else
gtk_misc_set_alignment (GTK_MISC (secondary_label), 0, 0.5);
+#endif
}
/* remove old content */