From 6016147ccdf1335dc6d285d50938446c42e1ce95 Mon Sep 17 00:00:00 2001 From: Wolfgang Ulbrich Date: Mon, 16 Nov 2015 13:52:32 +0100 Subject: Gtk-+3.14: don't use deprecated GtkMisc --- plugins/housekeeping/msd-ldsm-dialog.c | 14 ++++++++++++++ plugins/housekeeping/msd-ldsm-trash-empty.c | 16 ++++++++++++++++ plugins/xrandr/msd-xrandr-manager.c | 4 ++++ 3 files changed, 34 insertions(+) (limited to 'plugins') diff --git a/plugins/housekeeping/msd-ldsm-dialog.c b/plugins/housekeeping/msd-ldsm-dialog.c index 597e687..32fe1a7 100644 --- a/plugins/housekeeping/msd-ldsm-dialog.c +++ b/plugins/housekeeping/msd-ldsm-dialog.c @@ -221,18 +221,32 @@ msd_ldsm_dialog_init (MsdLdsmDialog *dialog) /* Create the image */ image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_DIALOG); +#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.0); +#endif /* Create the labels */ dialog->priv->primary_label = gtk_label_new (NULL); gtk_label_set_line_wrap (GTK_LABEL (dialog->priv->primary_label), TRUE); gtk_label_set_single_line_mode (GTK_LABEL (dialog->priv->primary_label), FALSE); +#if GTK_CHECK_VERSION (3, 14, 0) + gtk_widget_set_halign (dialog->priv->primary_label, GTK_ALIGN_START); + gtk_widget_set_valign (dialog->priv->primary_label, GTK_ALIGN_START); +#else gtk_misc_set_alignment (GTK_MISC (dialog->priv->primary_label), 0.0, 0.0); +#endif dialog->priv->secondary_label = gtk_label_new (NULL); gtk_label_set_line_wrap (GTK_LABEL (dialog->priv->secondary_label), TRUE); gtk_label_set_single_line_mode (GTK_LABEL (dialog->priv->secondary_label), FALSE); +#if GTK_CHECK_VERSION (3, 14, 0) + gtk_widget_set_halign (dialog->priv->secondary_label, GTK_ALIGN_START); + gtk_widget_set_valign (dialog->priv->secondary_label, GTK_ALIGN_START); +#else gtk_misc_set_alignment (GTK_MISC (dialog->priv->secondary_label), 0.0, 0.0); +#endif /* Create the check button to ignore future warnings */ dialog->priv->ignore_check_button = gtk_check_button_new (); diff --git a/plugins/housekeeping/msd-ldsm-trash-empty.c b/plugins/housekeeping/msd-ldsm-trash-empty.c index e0fe554..132c9b7 100644 --- a/plugins/housekeeping/msd-ldsm-trash-empty.c +++ b/plugins/housekeeping/msd-ldsm-trash-empty.c @@ -257,20 +257,36 @@ trash_empty_start () label1 = gtk_label_new (NULL); gtk_label_set_line_wrap (GTK_LABEL (label1), TRUE); +#if GTK_CHECK_VERSION (3, 14, 0) + gtk_widget_set_halign (label1, GTK_ALIGN_START); +#else gtk_misc_set_alignment (GTK_MISC (label1), 0.0, 0.5); +#endif label3 = gtk_label_new (NULL); gtk_label_set_line_wrap (GTK_LABEL (label3), TRUE); +#if GTK_CHECK_VERSION (3, 14, 0) + gtk_widget_set_halign (label3, GTK_ALIGN_START); +#else gtk_misc_set_alignment (GTK_MISC (label3), 0.0, 0.5); +#endif gtk_widget_hide (label3); location_label = gtk_label_new (NULL); gtk_label_set_line_wrap (GTK_LABEL (location_label), TRUE); +#if GTK_CHECK_VERSION (3, 14, 0) + gtk_widget_set_halign (location_label, GTK_ALIGN_START); +#else gtk_misc_set_alignment (GTK_MISC (location_label), 0.0, 0.5); +#endif file_label = gtk_label_new (NULL); gtk_label_set_line_wrap (GTK_LABEL (file_label), TRUE); +#if GTK_CHECK_VERSION (3, 14, 0) + gtk_widget_set_halign (file_label, GTK_ALIGN_START); +#else gtk_misc_set_alignment (GTK_MISC (file_label), 0.0, 0.5); +#endif progressbar = gtk_progress_bar_new (); gtk_progress_bar_set_pulse_step (GTK_PROGRESS_BAR (progressbar), 0.1); diff --git a/plugins/xrandr/msd-xrandr-manager.c b/plugins/xrandr/msd-xrandr-manager.c index b79e666..45b243f 100644 --- a/plugins/xrandr/msd-xrandr-manager.c +++ b/plugins/xrandr/msd-xrandr-manager.c @@ -1830,7 +1830,11 @@ make_menu_item_for_output_title (MsdXrandrManager *manager, MateRROutputInfo *ou gtk_widget_modify_fg (label, gtk_widget_get_state (label), &black); /* Add padding around the label to fit the box that we'll draw for color-coding */ +#if GTK_CHECK_VERSION (3, 14, 0) + gtk_widget_set_halign (label, GTK_ALIGN_START); +#else gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); +#endif gtk_misc_set_padding (GTK_MISC (label), OUTPUT_TITLE_ITEM_BORDER + OUTPUT_TITLE_ITEM_PADDING, OUTPUT_TITLE_ITEM_BORDER + OUTPUT_TITLE_ITEM_PADDING); -- cgit v1.2.1