diff options
author | monsta <[email protected]> | 2016-11-22 17:47:06 +0300 |
---|---|---|
committer | monsta <[email protected]> | 2016-11-22 17:47:06 +0300 |
commit | f7acf55db3ab4b97d60faae24555a07b6b08d43c (patch) | |
tree | 6feb99e63f801161642669b01c9ce0c217e60d0b /mateweather/mateweather-applet.c | |
parent | 45354a60352e05eba7e66e24a171e713876d71e9 (diff) | |
download | mate-applets-f7acf55db3ab4b97d60faae24555a07b6b08d43c.tar.bz2 mate-applets-f7acf55db3ab4b97d60faae24555a07b6b08d43c.tar.xz |
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.
Diffstat (limited to 'mateweather/mateweather-applet.c')
-rw-r--r-- | mateweather/mateweather-applet.c | 21 |
1 files changed, 4 insertions, 17 deletions
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); |