From 067dbe7b68fa625ea87ef6e259539fff2baaeaf7 Mon Sep 17 00:00:00 2001 From: Roy Zhang Date: Mon, 4 Jan 2016 14:05:03 +0800 Subject: Gtk3: Don't use deprecated gtk_misc_set_alignment --- applets/clock/clock-location-tile.c | 15 +++++++++++++++ applets/fish/fish.c | 5 +++++ applets/notification_area/fixedtip.c | 5 +++++ applets/notification_area/testtray.c | 10 ++++++++++ mate-panel/menu.c | 5 +++++ mate-panel/panel-addto.c | 5 +++++ mate-panel/panel-ditem-editor.c | 5 +++++ mate-panel/panel-force-quit.c | 5 +++++ mate-panel/panel-menu-bar.c | 5 +++++ 9 files changed, 60 insertions(+) diff --git a/applets/clock/clock-location-tile.c b/applets/clock/clock-location-tile.c index b4c7c93f..173a3854 100644 --- a/applets/clock/clock-location-tile.c +++ b/applets/clock/clock-location-tile.c @@ -279,7 +279,12 @@ clock_location_tile_fill (ClockLocationTile *this) head_section = gtk_vbox_new (FALSE, 0); priv->city_label = gtk_label_new (NULL); +#if GTK_CHECK_VERSION (3, 16, 0) + gtk_label_set_xalign (GTK_LABEL (priv->city_label), 0.0); + gtk_label_set_yalign (GTK_LABEL (priv->city_label), 0.0); +#else gtk_misc_set_alignment (GTK_MISC (priv->city_label), 0, 0); +#endif align = gtk_alignment_new (0, 0, 0, 0); gtk_alignment_set_padding (GTK_ALIGNMENT (align), 0, 0, 0, 3); @@ -287,7 +292,12 @@ clock_location_tile_fill (ClockLocationTile *this) gtk_box_pack_start (GTK_BOX (head_section), align, FALSE, FALSE, 0); priv->time_label = gtk_label_new (NULL); +#if GTK_CHECK_VERSION (3, 16, 0) + gtk_label_set_xalign (GTK_LABEL (priv->time_label), 0.0); + gtk_label_set_yalign (GTK_LABEL (priv->time_label), 0.0); +#else gtk_misc_set_alignment (GTK_MISC (priv->time_label), 0, 0); +#endif priv->weather_icon = gtk_image_new (); align = gtk_alignment_new (0, 0, 0, 0); @@ -308,7 +318,12 @@ clock_location_tile_fill (ClockLocationTile *this) _("Set location as current location and use its timezone for this computer")); priv->current_marker = gtk_image_new_from_icon_name ("go-home", GTK_ICON_SIZE_BUTTON); +#if GTK_CHECK_VERSION (3, 0, 0) + gtk_widget_set_halign (priv->current_marker, GTK_ALIGN_END); + gtk_widget_set_valign (priv->current_marker, GTK_ALIGN_CENTER); +#else gtk_misc_set_alignment (GTK_MISC (priv->current_marker), 1.0, 0.5); +#endif gtk_widget_set_no_show_all (priv->current_marker, TRUE); priv->current_spacer = gtk_event_box_new (); diff --git a/applets/fish/fish.c b/applets/fish/fish.c index 4562e65e..8986e9e1 100644 --- a/applets/fish/fish.c +++ b/applets/fish/fish.c @@ -892,8 +892,13 @@ static void display_fortune_dialog(FishApplet* fish) gtk_label_set_ellipsize (GTK_LABEL (fish->fortune_label), PANGO_ELLIPSIZE_MIDDLE); fish->fortune_cmd_label = gtk_label_new (""); +#if GTK_CHECK_VERSION (3, 16, 0) + gtk_label_set_xalign (GTK_LABEL (fish->fortune_cmd_label), 0.0); + gtk_label_set_yalign (GTK_LABEL (fish->fortune_cmd_label), 0.5); +#else gtk_misc_set_alignment (GTK_MISC (fish->fortune_cmd_label), 0, 0.5); +#endif vbox = gtk_dialog_get_content_area (GTK_DIALOG (fish->fortune_dialog)); gtk_box_pack_start (GTK_BOX (vbox), diff --git a/applets/notification_area/fixedtip.c b/applets/notification_area/fixedtip.c index ded3dbb6..ce4852c9 100644 --- a/applets/notification_area/fixedtip.c +++ b/applets/notification_area/fixedtip.c @@ -136,7 +136,12 @@ na_fixed_tip_init (NaFixedTip *fixedtip) label = gtk_label_new (NULL); gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); +#if GTK_CHECK_VERSION (3, 16, 0) + gtk_label_set_xalign (GTK_LABEL (label), 0.5); + gtk_label_set_yalign (GTK_LABEL (label), 0.5); +#else gtk_misc_set_alignment (GTK_MISC (label), 0.5, 0.5); +#endif gtk_widget_show (label); gtk_container_add (GTK_CONTAINER (fixedtip), label); fixedtip->priv->label = label; diff --git a/applets/notification_area/testtray.c b/applets/notification_area/testtray.c index f19663cd..4a2d0108 100644 --- a/applets/notification_area/testtray.c +++ b/applets/notification_area/testtray.c @@ -160,7 +160,12 @@ create_tray_on_screen (GdkScreen *screen, hbox = gtk_hbox_new (FALSE, 12); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); label = gtk_label_new_with_mnemonic ("_Orientation:"); +#if GTK_CHECK_VERSION (3, 16, 0) + gtk_label_set_xalign (GTK_LABEL (label), 0.0); + gtk_label_set_yalign (GTK_LABEL (label), 0.5); +#else gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); +#endif gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); combo = gtk_combo_box_text_new (); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), "Horizontal"); @@ -171,7 +176,12 @@ create_tray_on_screen (GdkScreen *screen, label = gtk_label_new (NULL); data->count_label = GTK_LABEL (label); +#if GTK_CHECK_VERSION (3, 16, 0) + gtk_label_set_xalign (GTK_LABEL (label), 0.0); + gtk_label_set_yalign (GTK_LABEL (label), 0.5); +#else gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); +#endif gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); data->tray = na_tray_new_for_screen (screen, GTK_ORIENTATION_HORIZONTAL); diff --git a/mate-panel/menu.c b/mate-panel/menu.c index dfffce66..3d71bca2 100644 --- a/mate-panel/menu.c +++ b/mate-panel/menu.c @@ -832,7 +832,12 @@ setup_menuitem (GtkWidget *menuitem, gtk_accel_label_set_accel_widget (GTK_ACCEL_LABEL (label), menuitem); +#if GTK_CHECK_VERSION (3, 16, 0) + gtk_label_set_xalign (GTK_LABEL (label), 0.0); + gtk_label_set_yalign (GTK_LABEL (label), 0.5); +#else gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); +#endif gtk_widget_show (label); gtk_container_add (GTK_CONTAINER (menuitem), label); diff --git a/mate-panel/panel-addto.c b/mate-panel/panel-addto.c index 09d4bcd9..eac9be93 100644 --- a/mate-panel/panel-addto.c +++ b/mate-panel/panel-addto.c @@ -1260,7 +1260,12 @@ panel_addto_dialog_new (PanelWidget *panel_widget) gtk_box_pack_start (GTK_BOX (inner_vbox), find_hbox, FALSE, FALSE, 0); dialog->label = gtk_label_new_with_mnemonic (""); +#if GTK_CHECK_VERSION (3, 16, 0) + gtk_label_set_xalign (GTK_LABEL (dialog->label), 0.0); + gtk_label_set_yalign (GTK_LABEL (dialog->label), 0.5); +#else gtk_misc_set_alignment (GTK_MISC (dialog->label), 0.0, 0.5); +#endif gtk_label_set_use_markup (GTK_LABEL (dialog->label), TRUE); gtk_box_pack_start (GTK_BOX (find_hbox), dialog->label, diff --git a/mate-panel/panel-ditem-editor.c b/mate-panel/panel-ditem-editor.c index e641e4d3..c8bb3d76 100644 --- a/mate-panel/panel-ditem-editor.c +++ b/mate-panel/panel-ditem-editor.c @@ -507,7 +507,12 @@ label_new_with_mnemonic (const char *text) g_free (bold); gtk_label_set_use_markup (GTK_LABEL (label), TRUE); +#if GTK_CHECK_VERSION (3, 16, 0) + gtk_label_set_xalign (GTK_LABEL (label), 1.0); + gtk_label_set_yalign (GTK_LABEL (label), 0.5); +#else gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5); +#endif gtk_widget_show (label); diff --git a/mate-panel/panel-force-quit.c b/mate-panel/panel-force-quit.c index f0374e2f..e8832214 100644 --- a/mate-panel/panel-force-quit.c +++ b/mate-panel/panel-force-quit.c @@ -76,7 +76,12 @@ display_popup_window (GdkScreen *screen) image = gtk_image_new_from_icon_name (PANEL_ICON_FORCE_QUIT, GTK_ICON_SIZE_DIALOG); +#if GTK_CHECK_VERSION (3, 0, 0) + gtk_widget_set_halign (image, GTK_ALIGN_CENTER); + gtk_widget_set_valign (image, GTK_ALIGN_CENTER); +#else gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0.5); +#endif gtk_box_pack_start (GTK_BOX (vbox), image, TRUE, TRUE, 4); gtk_widget_show (image); diff --git a/mate-panel/panel-menu-bar.c b/mate-panel/panel-menu-bar.c index a5ca9b11..26e83c29 100644 --- a/mate-panel/panel-menu-bar.c +++ b/mate-panel/panel-menu-bar.c @@ -512,7 +512,12 @@ static void set_item_text_angle_and_alignment(GtkWidget* item, double text_angle gtk_label_set_angle (GTK_LABEL (label), text_angle); +#if GTK_CHECK_VERSION (3, 16, 0) + gtk_label_set_xalign (GTK_LABEL (label), xalign); + gtk_label_set_yalign (GTK_LABEL (label), yalign); +#else gtk_misc_set_alignment (GTK_MISC (label), xalign, yalign); +#endif } static void panel_menu_bar_update_orientation(PanelMenuBar* menubar) -- cgit v1.2.1