summaryrefslogtreecommitdiff
path: root/applets
diff options
context:
space:
mode:
authormonsta <[email protected]>2016-06-30 14:39:23 +0300
committermonsta <[email protected]>2016-06-30 14:40:29 +0300
commit29a2534c7f5de5a8dc06d48b2e7c52d7416d6a6e (patch)
treeee78c9b70306b269aee0259c89692a8030ecbd5b /applets
parent882f8f4d9959b6b27f08d2ddb525c7347df1797c (diff)
downloadmate-panel-29a2534c7f5de5a8dc06d48b2e7c52d7416d6a6e.tar.bz2
mate-panel-29a2534c7f5de5a8dc06d48b2e7c52d7416d6a6e.tar.xz
clock: fix UI issues introduced in 882f8f4
Diffstat (limited to 'applets')
-rw-r--r--applets/clock/calendar-window.c19
-rw-r--r--applets/clock/clock-location-tile.c20
2 files changed, 24 insertions, 15 deletions
diff --git a/applets/clock/calendar-window.c b/applets/clock/calendar-window.c
index ceb3a38d..db14fb80 100644
--- a/applets/clock/calendar-window.c
+++ b/applets/clock/calendar-window.c
@@ -43,11 +43,6 @@
#define KEY_LOCATIONS_EXPANDED "expand-locations"
-#if !GTK_CHECK_VERSION (3, 0, 0)
-#define gtk_box_new(GTK_ORIENTATION_HORIZONTAL, b) gtk_hbox_new(FALSE, b)
-#define gtk_box_new(GTK_ORIENTATION_VERTICAL, b) gtk_vbox_new(FALSE, b)
-#endif
-
enum {
EDIT_LOCATIONS,
LAST_SIGNAL
@@ -166,14 +161,23 @@ create_hig_frame (CalendarWindow *calwin,
char *text;
GtkWidget *expander;
+#if GTK_CHECK_VERSION (3, 0, 0)
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
+#else
+ vbox = gtk_vbox_new (FALSE, 6);
+#endif
bold_title = g_strdup_printf ("<b>%s</b>", title);
expander = gtk_expander_new (bold_title);
g_free (bold_title);
gtk_expander_set_use_markup (GTK_EXPANDER (expander), TRUE);
+#if GTK_CHECK_VERSION (3, 0, 0)
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+#else
+ hbox = gtk_hbox_new (FALSE, 0);
+#endif
+
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), expander, FALSE, FALSE, 0);
gtk_widget_show_all (vbox);
@@ -252,7 +256,12 @@ calendar_window_fill (CalendarWindow *calwin)
gtk_container_add (GTK_CONTAINER (calwin), frame);
gtk_widget_show (frame);
+#if GTK_CHECK_VERSION (3, 0, 0)
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
+#else
+ vbox = gtk_vbox_new (FALSE, 6);
+#endif
+
gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
gtk_container_add (GTK_CONTAINER (frame), vbox);
gtk_widget_show (vbox);
diff --git a/applets/clock/clock-location-tile.c b/applets/clock/clock-location-tile.c
index d34b8aba..55ce68b3 100644
--- a/applets/clock/clock-location-tile.c
+++ b/applets/clock/clock-location-tile.c
@@ -21,8 +21,6 @@
#if GTK_CHECK_VERSION (3, 0, 0)
G_DEFINE_TYPE (ClockLocationTile, clock_location_tile, GTK_TYPE_BIN)
#else
-#define gtk_box_new(GTK_ORIENTATION_HORIZONTAL, b) gtk_hbox_new(FALSE, b)
-#define gtk_box_new(GTK_ORIENTATION_VERTICAL, b) gtk_vbox_new(FALSE, b)
G_DEFINE_TYPE (ClockLocationTile, clock_location_tile, GTK_TYPE_ALIGNMENT)
#endif
@@ -283,18 +281,16 @@ 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)
- alignment = gtk_alignment_new (0, 0, 1, 0);
- gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 3, 3, 3, 0);
-#endif
-
- tile = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
#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
- head_section = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
priv->city_label = gtk_label_new (NULL);
#if GTK_CHECK_VERSION (3, 0, 0)
@@ -308,8 +304,10 @@ clock_location_tile_fill (ClockLocationTile *this)
#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);
@@ -335,11 +333,13 @@ clock_location_tile_fill (ClockLocationTile *this)
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);
-#if GTK_CHECK_VERSION (3, 0, 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);