From f7acf55db3ab4b97d60faae24555a07b6b08d43c Mon Sep 17 00:00:00 2001 From: monsta Date: Tue, 22 Nov 2016 17:47:06 +0300 Subject: move to GTK+3 (>= 3.14), drop GTK+2 code and --with-gtk build option and require mate-panel >= 1.17 WARNING: use GTK+3 build of libmateweather for this build. that lib is not migrated to GTK+3 only as we will possibly use libgweather instead of it. --- mateweather/mateweather-applet.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) (limited to 'mateweather/mateweather-applet.c') diff --git a/mateweather/mateweather-applet.c b/mateweather/mateweather-applet.c index 9d774e55..88840803 100644 --- a/mateweather/mateweather-applet.c +++ b/mateweather/mateweather-applet.c @@ -41,11 +41,6 @@ #define MAX_CONSECUTIVE_FAULTS (3) -#if GTK_CHECK_VERSION (3, 0, 0) -#define gtk_hbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_VERTICAL,Y) -#define gtk_vbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_HORIZONTAL,Y) -#endif - static void about_cb (GtkAction *action, MateWeatherApplet *gw_applet) { @@ -152,12 +147,8 @@ static void place_widgets (MateWeatherApplet *gw_applet) gw_applet->image = gtk_image_new_from_icon_name(icon_name, GTK_ICON_SIZE_BUTTON); if (icon_name != NULL) { -#if GTK_CHECK_VERSION(3, 0, 0) gtk_widget_show (gw_applet->image); gtk_widget_get_preferred_size (gw_applet->image, &req, NULL); -#else - gtk_widget_size_request(gw_applet->image, &req); -#endif if (horizontal) total_size += req.height; else @@ -173,12 +164,8 @@ static void place_widgets (MateWeatherApplet *gw_applet) gtk_label_set_text(GTK_LABEL(gw_applet->label), temp); /* Check the label size to determine box layout */ -#if GTK_CHECK_VERSION(3, 0, 0) gtk_widget_show (gw_applet->label); gtk_widget_get_preferred_size (gw_applet->label, &req, NULL); -#else - gtk_widget_size_request(gw_applet->label, &req); -#endif if (horizontal) total_size += req.height; else @@ -189,13 +176,13 @@ static void place_widgets (MateWeatherApplet *gw_applet) gtk_widget_destroy (gw_applet->box); if (horizontal && (total_size <= panel_size)) - gw_applet->box = gtk_vbox_new(FALSE, 0); + gw_applet->box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); else if (horizontal && (total_size > panel_size)) - gw_applet->box = gtk_hbox_new(FALSE, 2); + gw_applet->box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); else if (!horizontal && (total_size <= panel_size)) - gw_applet->box = gtk_hbox_new(FALSE, 2); + gw_applet->box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); else - gw_applet->box = gtk_vbox_new(FALSE, 0); + gw_applet->box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); /* Rebuild the applet it's visual area */ gtk_container_add (GTK_CONTAINER (gw_applet->container), gw_applet->box); -- cgit v1.2.1