[eog] Drop GtkMisc and GtkAlignment usage in eog code
- From: Felix Riemann <friemann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [eog] Drop GtkMisc and GtkAlignment usage in eog code
- Date: Fri, 30 May 2014 11:58:32 +0000 (UTC)
commit 2fad22161c739ec4ff86309d51a98b8a14ba219b
Author: Felix Riemann <friemann gnome org>
Date: Thu May 29 21:48:11 2014 +0200
Drop GtkMisc and GtkAlignment usage in eog code
Both are deprecated and can be replaced by simple GtkWidget properties.
This leaves out the dialogs made with Glade as it doesn't have
support for the new margin-start property yet.
configure.ac | 2 +-
src/eog-close-confirmation-dialog.c | 14 +++++++-------
src/eog-error-message-area.c | 6 +++---
src/eog-metadata-sidebar.c | 6 ++++--
src/eog-print-image-setup.c | 19 +++++++------------
src/eog-window.c | 8 ++++----
6 files changed, 26 insertions(+), 29 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 79710ab..fc7b2ce 100644
--- a/configure.ac
+++ b/configure.ac
@@ -85,7 +85,7 @@ YELP_HELP_INIT
# GNOME Libs
# **********
-GTK_REQUIRED=3.10.6
+GTK_REQUIRED=3.11.6
GLIB_REQUIRED=2.38.0
GNOME_DESKTOP_REQUIRED=2.91.2
GDKPIXBUF_REQUIRED=2.4.0
diff --git a/src/eog-close-confirmation-dialog.c b/src/eog-close-confirmation-dialog.c
index 533ca4b..0cb91e5 100644
--- a/src/eog-close-confirmation-dialog.c
+++ b/src/eog-close-confirmation-dialog.c
@@ -414,13 +414,13 @@ build_single_img_dialog (EogCloseConfirmationDialog *dlg)
/* Image */
image = gtk_image_new_from_icon_name ("dialog-warning-symbolic",
GTK_ICON_SIZE_DIALOG);
- gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0.0);
+ gtk_widget_set_valign (image, GTK_ALIGN_START);
/* Primary label */
primary_label = gtk_label_new (NULL);
gtk_label_set_line_wrap (GTK_LABEL (primary_label), TRUE);
gtk_label_set_use_markup (GTK_LABEL (primary_label), TRUE);
- gtk_misc_set_alignment (GTK_MISC (primary_label), 0.0, 0.5);
+ gtk_widget_set_halign (primary_label, GTK_ALIGN_START);
gtk_label_set_selectable (GTK_LABEL (primary_label), TRUE);
image_name = eog_image_get_caption (img);
@@ -439,7 +439,7 @@ build_single_img_dialog (EogCloseConfirmationDialog *dlg)
secondary_label = gtk_label_new (str);
g_free (str);
gtk_label_set_line_wrap (GTK_LABEL (secondary_label), TRUE);
- gtk_misc_set_alignment (GTK_MISC (secondary_label), 0.0, 0.5);
+ gtk_widget_set_halign (secondary_label, GTK_ALIGN_START);
gtk_label_set_selectable (GTK_LABEL (secondary_label), TRUE);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
@@ -618,7 +618,7 @@ build_multiple_imgs_dialog (EogCloseConfirmationDialog *dlg)
/* Image */
image = gtk_image_new_from_icon_name ("dialog-warning-symbolic",
GTK_ICON_SIZE_DIALOG);
- gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0.0);
+ gtk_widget_set_valign (image, GTK_ALIGN_START);
gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
@@ -628,7 +628,7 @@ build_multiple_imgs_dialog (EogCloseConfirmationDialog *dlg)
primary_label = gtk_label_new (NULL);
gtk_label_set_line_wrap (GTK_LABEL (primary_label), TRUE);
gtk_label_set_use_markup (GTK_LABEL (primary_label), TRUE);
- gtk_misc_set_alignment (GTK_MISC (primary_label), 0.0, 0.5);
+ gtk_widget_set_halign (primary_label, GTK_ALIGN_START);
gtk_label_set_selectable (GTK_LABEL (primary_label), TRUE);
str = g_strdup_printf (
@@ -653,7 +653,7 @@ build_multiple_imgs_dialog (EogCloseConfirmationDialog *dlg)
gtk_box_pack_start (GTK_BOX (vbox2), select_label, FALSE, FALSE, 0);
gtk_label_set_line_wrap (GTK_LABEL (select_label), TRUE);
- gtk_misc_set_alignment (GTK_MISC (select_label), 0.0, 0.5);
+ gtk_widget_set_halign (select_label, GTK_ALIGN_START);
scrolledwindow = gtk_scrolled_window_new (NULL, NULL);
gtk_box_pack_start (GTK_BOX (vbox2), scrolledwindow, TRUE, TRUE, 0);
@@ -673,7 +673,7 @@ build_multiple_imgs_dialog (EogCloseConfirmationDialog *dlg)
gtk_box_pack_start (GTK_BOX (vbox2), secondary_label, FALSE, FALSE, 0);
gtk_label_set_line_wrap (GTK_LABEL (secondary_label), TRUE);
- gtk_misc_set_alignment (GTK_MISC (secondary_label), 0, 0.5);
+ gtk_widget_set_halign (secondary_label, GTK_ALIGN_START);
gtk_label_set_selectable (GTK_LABEL (secondary_label), TRUE);
gtk_label_set_mnemonic_widget (GTK_LABEL (select_label), treeview);
diff --git a/src/eog-error-message-area.c b/src/eog-error-message-area.c
index 17fbb6b..cdbeda7 100644
--- a/src/eog-error-message-area.c
+++ b/src/eog-error-message-area.c
@@ -61,7 +61,7 @@ set_message_area_text_and_icon (GtkInfoBar *message_area,
image = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_DIALOG);
gtk_widget_show (image);
gtk_box_pack_start (GTK_BOX (hbox_content), image, FALSE, FALSE, 0);
- gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0);
+ gtk_widget_set_valign (image, GTK_ALIGN_START);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_widget_show (vbox);
@@ -76,7 +76,7 @@ set_message_area_text_and_icon (GtkInfoBar *message_area,
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), FALSE);
- gtk_misc_set_alignment (GTK_MISC (primary_label), 0, 0.5);
+ gtk_widget_set_halign (primary_label, GTK_ALIGN_START);
gtk_widget_set_can_focus (primary_label, TRUE);
@@ -97,7 +97,7 @@ set_message_area_text_and_icon (GtkInfoBar *message_area,
gtk_label_set_use_markup (GTK_LABEL (secondary_label), TRUE);
gtk_label_set_line_wrap (GTK_LABEL (secondary_label), TRUE);
gtk_label_set_selectable (GTK_LABEL (secondary_label), TRUE);
- gtk_misc_set_alignment (GTK_MISC (secondary_label), 0, 0.5);
+ gtk_widget_set_halign (secondary_label, GTK_ALIGN_START);
}
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (message_area))),
hbox_content, TRUE, TRUE, 0);
diff --git a/src/eog-metadata-sidebar.c b/src/eog-metadata-sidebar.c
index 0fe5cac..9bcacbe 100644
--- a/src/eog-metadata-sidebar.c
+++ b/src/eog-metadata-sidebar.c
@@ -132,14 +132,16 @@ _gtk_grid_append_prop_line (GtkGrid *grid, GtkWidget *sibling,
gtk_label_set_markup (GTK_LABEL(label), markup);
g_free (markup);
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 1.0);
+ gtk_widget_set_halign (label, GTK_ALIGN_START);
+ gtk_widget_set_valign (label, GTK_ALIGN_END);
gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0);
if (G_LIKELY (data_label != NULL)) {
*data_label = gtk_label_new (NULL);
gtk_label_set_selectable (GTK_LABEL (*data_label), TRUE);
gtk_label_set_line_wrap (GTK_LABEL(*data_label), TRUE);
- gtk_misc_set_alignment (GTK_MISC (*data_label), 0.0, 0.0);
+ gtk_widget_set_halign (*data_label, GTK_ALIGN_START);
+ gtk_widget_set_valign (*data_label, GTK_ALIGN_START);
// Add a small margin to make it a sublabel to the first label
gtk_widget_set_margin_left (*data_label, 12);
gtk_box_pack_end (GTK_BOX(box), *data_label, FALSE, FALSE, 0);
diff --git a/src/eog-print-image-setup.c b/src/eog-print-image-setup.c
index 265da25..cf341ef 100644
--- a/src/eog-print-image-setup.c
+++ b/src/eog-print-image-setup.c
@@ -703,11 +703,11 @@ static GtkWidget *
wrap_in_frame (const gchar *label,
GtkWidget *child)
{
- GtkWidget *frame, *alignment, *label_widget;
+ GtkWidget *frame, *label_widget;
gchar *bold_text;
label_widget = gtk_label_new ("");
- gtk_misc_set_alignment (GTK_MISC (label_widget), 0.0, 0.5);
+ gtk_widget_set_halign (label_widget, GTK_ALIGN_START);
gtk_widget_show (label_widget);
bold_text = g_markup_printf_escaped ("<b>%s</b>", label);
@@ -716,16 +716,11 @@ wrap_in_frame (const gchar *label,
frame = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_box_pack_start (GTK_BOX (frame), label_widget, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (frame), child, FALSE, FALSE, 0);
- alignment = gtk_alignment_new (0.0, 0.0, 1.0, 1.0);
- gtk_alignment_set_padding (GTK_ALIGNMENT (alignment),
- 0, 0, 12, 0);
- gtk_box_pack_start (GTK_BOX (frame), alignment, FALSE, FALSE, 0);
-
- gtk_container_add (GTK_CONTAINER (alignment), child);
+ gtk_widget_set_margin_start (child, 12);
gtk_widget_show (frame);
- gtk_widget_show (alignment);
return frame;
}
@@ -738,7 +733,7 @@ grid_attach_spin_button_with_label (GtkWidget *grid,
GtkWidget *label, *spin_button;
label = gtk_label_new_with_mnemonic (text_label);
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_widget_set_halign (label, GTK_ALIGN_START);
spin_button = gtk_spin_button_new_with_range (0, 100, 0.01);
gtk_spin_button_set_digits (GTK_SPIN_BUTTON (spin_button), 2);
gtk_entry_set_width_chars (GTK_ENTRY (spin_button), 6);
@@ -945,7 +940,7 @@ eog_print_image_setup_init (EogPrintImageSetup *setup)
2, 1);
label = gtk_label_new_with_mnemonic (_("C_enter:"));
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_widget_set_halign (label, GTK_ALIGN_START);
combobox = gtk_combo_box_text_new ();
gtk_combo_box_text_insert_text (GTK_COMBO_BOX_TEXT (combobox),
@@ -991,7 +986,7 @@ eog_print_image_setup_init (EogPrintImageSetup *setup)
priv->scaling = hscale;
label = gtk_label_new_with_mnemonic (_("_Unit:"));
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_widget_set_halign (label, GTK_ALIGN_START);
combobox = gtk_combo_box_text_new ();
gtk_combo_box_text_insert_text (GTK_COMBO_BOX_TEXT (combobox), UNIT_MM,
diff --git a/src/eog-window.c b/src/eog-window.c
index 5c0a12a..52b0027 100644
--- a/src/eog-window.c
+++ b/src/eog-window.c
@@ -865,9 +865,9 @@ image_file_changed_cb (EogImage *img, EogWindow *window)
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8);
gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
- gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0);
+ gtk_widget_set_valign (image, GTK_ALIGN_START);
gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
- gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
+ gtk_widget_set_halign (label, GTK_ALIGN_START);
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (info_bar))), hbox, TRUE,
TRUE, 0);
gtk_widget_show_all (hbox);
gtk_widget_show (info_bar);
@@ -2807,9 +2807,9 @@ eog_window_set_wallpaper (EogWindow *window, const gchar *filename, const gchar
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8);
gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
- gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0);
+ gtk_widget_set_valign (image, GTK_ALIGN_START);
gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
- gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
+ gtk_widget_set_halign (label, GTK_ALIGN_START);
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (info_bar))), hbox, TRUE,
TRUE, 0);
gtk_widget_show_all (hbox);
gtk_widget_show (info_bar);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]