summaryrefslogtreecommitdiff
path: root/applets/clock/clock-location-tile.c
diff options
context:
space:
mode:
Diffstat (limited to 'applets/clock/clock-location-tile.c')
-rw-r--r--applets/clock/clock-location-tile.c53
1 files changed, 0 insertions, 53 deletions
diff --git a/applets/clock/clock-location-tile.c b/applets/clock/clock-location-tile.c
index ab860101..fd1ea82c 100644
--- a/applets/clock/clock-location-tile.c
+++ b/applets/clock/clock-location-tile.c
@@ -17,12 +17,7 @@
#include "clock-marshallers.h"
#include "set-timezone.h"
-
-#if GTK_CHECK_VERSION (3, 0, 0)
G_DEFINE_TYPE (ClockLocationTile, clock_location_tile, GTK_TYPE_BIN)
-#else
-G_DEFINE_TYPE (ClockLocationTile, clock_location_tile, GTK_TYPE_ALIGNMENT)
-#endif
enum {
TILE_PRESSED,
@@ -260,14 +255,8 @@ static void
clock_location_tile_fill (ClockLocationTile *this)
{
ClockLocationTilePrivate *priv = PRIVATE (this);
-#if !GTK_CHECK_VERSION (3, 0, 0)
- GtkWidget *align;
-#endif
GtkWidget *strut;
GtkWidget *box;
-#if !GTK_CHECK_VERSION (3, 0, 0)
- GtkWidget *alignment;
-#endif
GtkWidget *tile;
GtkWidget *head_section;
@@ -281,21 +270,13 @@ clock_location_tile_fill (ClockLocationTile *this)
g_signal_connect (priv->box, "leave-notify-event",
G_CALLBACK (enter_or_leave_tile), this);
-#if GTK_CHECK_VERSION (3, 0, 0)
tile = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
gtk_widget_set_margin_top (tile, 3);
gtk_widget_set_margin_bottom (tile, 3);
gtk_widget_set_margin_start (tile, 3);
-#else
- tile = gtk_hbox_new (FALSE, 6);
- alignment = gtk_alignment_new (0, 0, 1, 0);
- gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 3, 3, 3, 0);
-#endif
priv->city_label = gtk_label_new (NULL);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_set_margin_end (priv->city_label, 3);
-#endif
#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);
@@ -303,21 +284,11 @@ clock_location_tile_fill (ClockLocationTile *this)
gtk_misc_set_alignment (GTK_MISC (priv->city_label), 0, 0);
#endif
-#if GTK_CHECK_VERSION (3, 0, 0)
head_section = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_box_pack_start (GTK_BOX (head_section), priv->city_label, FALSE, FALSE, 0);
-#else
- head_section = gtk_vbox_new (FALSE, 0);
- align = gtk_alignment_new (0, 0, 0, 0);
- gtk_alignment_set_padding (GTK_ALIGNMENT (align), 0, 0, 0, 3);
- gtk_container_add (GTK_CONTAINER (align), priv->city_label);
- gtk_box_pack_start (GTK_BOX (head_section), align, FALSE, FALSE, 0);
-#endif
priv->time_label = gtk_label_new (NULL);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_set_margin_end (priv->time_label, 3);
-#endif
#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);
@@ -326,22 +297,11 @@ clock_location_tile_fill (ClockLocationTile *this)
#endif
priv->weather_icon = gtk_image_new ();
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_set_valign (priv->weather_icon, GTK_ALIGN_START);
-#else
- align = gtk_alignment_new (0, 0, 0, 0);
- gtk_container_add (GTK_CONTAINER (align), priv->weather_icon);
-#endif
-#if GTK_CHECK_VERSION (3, 0, 0)
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_box_pack_start (GTK_BOX (head_section), box, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (box), priv->weather_icon, FALSE, FALSE, 0);
-#else
- box = gtk_hbox_new (FALSE, 0);
- gtk_box_pack_start (GTK_BOX (head_section), box, FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX (box), align, FALSE, FALSE, 0);
-#endif
gtk_box_pack_start (GTK_BOX (box), priv->time_label, FALSE, FALSE, 0);
priv->current_button = gtk_button_new ();
@@ -354,12 +314,8 @@ 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 ();
@@ -403,12 +359,7 @@ clock_location_tile_fill (ClockLocationTile *this)
gtk_box_pack_start (GTK_BOX (tile), priv->clock_face, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (tile), head_section, TRUE, TRUE, 0);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_container_add (GTK_CONTAINER (priv->box), tile);
-#else
- gtk_container_add (GTK_CONTAINER (alignment), tile);
- gtk_container_add (GTK_CONTAINER (priv->box), alignment);
-#endif
gtk_container_add (GTK_CONTAINER (this), priv->box);
}
@@ -753,11 +704,7 @@ update_weather_icon (ClockLocation *loc, WeatherInfo *info, gpointer data)
if (pixbuf) {
gtk_image_set_from_pixbuf (GTK_IMAGE (priv->weather_icon), pixbuf);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_set_margin_end (priv->weather_icon, 6);
-#else
- gtk_alignment_set_padding (GTK_ALIGNMENT (gtk_widget_get_parent (priv->weather_icon)), 0, 0, 0, 6);
-#endif
}
}