From 422dc034f49f9cc71f8e70b9cf45baee053e468c Mon Sep 17 00:00:00 2001 From: JosephMcc Date: Fri, 13 Jan 2017 02:44:53 -0800 Subject: [PATCH] Clean up uses of deprecated GtkMisc --- xed/dialogs/xed-close-confirmation-dialog.c | 5 ++--- xed/xed-file-chooser-dialog.c | 4 ++-- xed/xed-io-error-message-area.c | 20 ++++++++++---------- xed/xed-panel.c | 4 ++-- xed/xed-progress-message-area.c | 2 +- xed/xed-tab-label.c | 2 +- 6 files changed, 18 insertions(+), 19 deletions(-) diff --git a/xed/dialogs/xed-close-confirmation-dialog.c b/xed/dialogs/xed-close-confirmation-dialog.c index 6de1101..e667ad5 100755 --- a/xed/dialogs/xed-close-confirmation-dialog.c +++ b/xed/dialogs/xed-close-confirmation-dialog.c @@ -471,7 +471,6 @@ build_single_doc_dialog (XedCloseConfirmationDialog *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_label_set_selectable (GTK_LABEL (primary_label), TRUE); gtk_widget_set_can_focus (GTK_WIDGET (primary_label), FALSE); @@ -639,7 +638,7 @@ build_multiple_docs_dialog (XedCloseConfirmationDialog *dlg) gtk_label_set_line_wrap (GTK_LABEL (primary_label), TRUE); gtk_label_set_use_markup (GTK_LABEL (primary_label), TRUE); gtk_widget_set_halign (GTK_WIDGET (primary_label), GTK_ALIGN_START); - 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 (ngettext ("There is %d document with unsaved changes. " @@ -663,7 +662,7 @@ build_multiple_docs_dialog (XedCloseConfirmationDialog *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); diff --git a/xed/xed-file-chooser-dialog.c b/xed/xed-file-chooser-dialog.c index 8c906f4..d7c0aa1 100644 --- a/xed/xed-file-chooser-dialog.c +++ b/xed/xed-file-chooser-dialog.c @@ -80,7 +80,7 @@ create_option_menu (XedFileChooserDialog *dialog) GtkWidget *menu; label = gtk_label_new_with_mnemonic (_("C_haracter Encoding:")); - gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + gtk_widget_set_halign (label, GTK_ALIGN_START); menu = xed_encodings_combo_box_new ( gtk_file_chooser_get_action (GTK_FILE_CHOOSER (dialog)) == GTK_FILE_CHOOSER_ACTION_SAVE); @@ -145,7 +145,7 @@ create_newline_combo (XedFileChooserDialog *dialog) GtkTreeIter iter; label = gtk_label_new_with_mnemonic (_("L_ine Ending:")); - gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + gtk_widget_set_halign (label, GTK_ALIGN_START); store = gtk_list_store_new (2, G_TYPE_STRING, XED_TYPE_DOCUMENT_NEWLINE_TYPE); combo = gtk_combo_box_new_with_model (GTK_TREE_MODEL (store)); diff --git a/xed/xed-io-error-message-area.c b/xed/xed-io-error-message-area.c index f11f17a..876f6d2 100644 --- a/xed/xed-io-error-message-area.c +++ b/xed/xed-io-error-message-area.c @@ -134,7 +134,7 @@ set_message_area_text_and_icon (GtkWidget *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), TRUE); - gtk_misc_set_alignment (GTK_MISC (primary_label), 0.0, 0.5); + gtk_widget_set_halign (primary_label, GTK_ALIGN_START); gtk_widget_set_can_focus (primary_label, TRUE); gtk_label_set_selectable (GTK_LABEL (primary_label), TRUE); @@ -148,7 +148,7 @@ set_message_area_text_and_icon (GtkWidget *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, 0.5); + gtk_widget_set_halign (secondary_label, GTK_ALIGN_START); } gtk_widget_show_all (hbox_content); @@ -466,7 +466,7 @@ create_conversion_error_message_area (const gchar *primary_text, 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); - gtk_misc_set_alignment (GTK_MISC (primary_label), 0.0, 0.5); + gtk_widget_set_halign (primary_label, GTK_ALIGN_START); gtk_widget_set_can_focus (primary_label, TRUE); gtk_label_set_selectable (GTK_LABEL (primary_label), TRUE); @@ -480,7 +480,7 @@ create_conversion_error_message_area (const gchar *primary_text, 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, 0.5); + gtk_widget_set_halign (secondary_label, GTK_ALIGN_START); } create_combo_box (message_area, vbox); @@ -724,7 +724,7 @@ xed_file_already_open_warning_message_area_new (const gchar *uri) 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); - gtk_misc_set_alignment (GTK_MISC (primary_label), 0.0, 0.5); + gtk_widget_set_halign (primary_label, GTK_ALIGN_START); gtk_widget_set_can_focus (primary_label, TRUE); gtk_label_set_selectable (GTK_LABEL (primary_label), TRUE); @@ -738,7 +738,7 @@ xed_file_already_open_warning_message_area_new (const gchar *uri) 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, 0.5); + gtk_widget_set_halign (secondary_label, GTK_ALIGN_START); gtk_widget_show_all (hbox_content); set_contents (message_area, hbox_content); @@ -811,7 +811,7 @@ xed_externally_modified_saving_error_message_area_new (const gchar *uri, 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); - gtk_misc_set_alignment (GTK_MISC (primary_label), 0.0, 0.5); + gtk_widget_set_halign (primary_label, GTK_ALIGN_START); gtk_widget_set_can_focus (primary_label, TRUE); gtk_label_set_selectable (GTK_LABEL (primary_label), TRUE); @@ -824,7 +824,7 @@ xed_externally_modified_saving_error_message_area_new (const gchar *uri, 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, 0.5); + gtk_widget_set_halign (secondary_label, GTK_ALIGN_START); gtk_widget_show_all (hbox_content); set_contents (message_area, hbox_content); @@ -906,7 +906,7 @@ xed_no_backup_saving_error_message_area_new (const gchar *uri, 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); - gtk_misc_set_alignment (GTK_MISC (primary_label), 0.0, 0.5); + gtk_widget_set_halign (primary_label, GTK_ALIGN_START); gtk_widget_set_can_focus (primary_label, TRUE); gtk_label_set_selectable (GTK_LABEL (primary_label), TRUE); @@ -921,7 +921,7 @@ xed_no_backup_saving_error_message_area_new (const gchar *uri, 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, 0.5); + gtk_widget_set_halign (secondary_label, GTK_ALIGN_START); gtk_widget_show_all (hbox_content); set_contents (message_area, hbox_content); diff --git a/xed/xed-panel.c b/xed/xed-panel.c index 81cab98..785cca8 100644 --- a/xed/xed-panel.c +++ b/xed/xed-panel.c @@ -422,7 +422,7 @@ build_tab_label (XedPanel *panel, /* setup label */ label = gtk_label_new (name); - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_widget_set_halign (label, GTK_ALIGN_START); gtk_widget_set_margin_left (label, 0); gtk_widget_set_margin_right (label, 0); gtk_widget_set_margin_top (label, 0); @@ -496,7 +496,7 @@ xed_panel_add_item (XedPanel *panel, menu_label = gtk_label_new (name); - gtk_misc_set_alignment (GTK_MISC (menu_label), 0.0, 0.5); + gtk_widget_set_halign (menu_label, GTK_ALIGN_START); if (!gtk_widget_get_visible (item)) { diff --git a/xed/xed-progress-message-area.c b/xed/xed-progress-message-area.c index cbb86e0..f915702 100644 --- a/xed/xed-progress-message-area.c +++ b/xed/xed-progress-message-area.c @@ -151,7 +151,7 @@ xed_progress_message_area_init (XedProgressMessageArea *area) gtk_widget_show (area->priv->label); gtk_box_pack_start (GTK_BOX (hbox), area->priv->label, TRUE, TRUE, 0); gtk_label_set_use_markup (GTK_LABEL (area->priv->label), TRUE); - gtk_misc_set_alignment (GTK_MISC (area->priv->label), 0.0, 0.5); + gtk_widget_set_halign (area->priv->label, GTK_ALIGN_START); gtk_label_set_ellipsize (GTK_LABEL (area->priv->label), PANGO_ELLIPSIZE_END); area->priv->progress = gtk_progress_bar_new (); diff --git a/xed/xed-tab-label.c b/xed/xed-tab-label.c index 47d36e9..bd01717 100644 --- a/xed/xed-tab-label.c +++ b/xed/xed-tab-label.c @@ -297,7 +297,7 @@ xed_tab_label_init (XedTabLabel *tab_label) label = gtk_label_new (""); - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_widget_set_halign (label, GTK_ALIGN_START); gtk_widget_set_margin_left (label, 0); gtk_widget_set_margin_right (label, 0); gtk_widget_set_margin_top (label, 0);