Skip to content

Instantly share code, notes, and snippets.

@raveit65
Last active December 7, 2018 13:04
Show Gist options
  • Save raveit65/4a0afb5c2e2ebc2dd1f53d726e0d8dac to your computer and use it in GitHub Desktop.
Save raveit65/4a0afb5c2e2ebc2dd1f53d726e0d8dac to your computer and use it in GitHub Desktop.
clock-applet
From 1311ab7348cfcddd657f0ceeb3c26230d2b4195e Mon Sep 17 00:00:00 2001
From: raveit65 <mate@raveit.de>
Date: Fri, 7 Dec 2018 13:07:39 +0100
Subject: [PATCH] weather icon fix
---
applets/clock/clock.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/applets/clock/clock.c b/applets/clock/clock.c
index 7490d5b..4757503 100644
--- a/applets/clock/clock.c
+++ b/applets/clock/clock.c
@@ -98,6 +98,7 @@ struct _ClockData {
GtkWidget *panel_button; /* main toggle button for the whole clock */
GtkWidget *main_obox; /* orientable box inside panel_button */
+ GtkWidget *clock_obox; /* orientable box for the clock widgets */
GtkWidget *weather_obox; /* orientable box for the weather widgets */
GtkWidget *clockw; /* main label for the date/time display */
@@ -1373,9 +1374,16 @@ create_clock_widget (ClockData *cd)
cd->panel_temperature_label = gtk_label_new (NULL);
gtk_box_pack_start (GTK_BOX (cd->weather_obox), cd->panel_temperature_label, FALSE, FALSE, 0);
+ /* Clock orientable box */
+ cd->clock_obox = g_object_new (clock_box_get_type (), NULL);
+ gtk_box_set_spacing (GTK_BOX (cd->clock_obox), 12);
+ gtk_container_add (GTK_CONTAINER (cd->panel_button), cd->clock_obox);
+ gtk_box_pack_end (GTK_BOX (cd->main_obox), cd->clock_obox, FALSE, FALSE, 0);
+ gtk_widget_show (cd->clock_obox);
+
/* Main label for time display */
cd->clockw = create_main_clock_label (cd);
- gtk_box_pack_start (GTK_BOX (cd->main_obox), cd->clockw, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (cd->clock_obox), cd->clockw, FALSE, FALSE, 0);
gtk_widget_show (cd->clockw);
/* Done! */
@@ -1461,6 +1469,7 @@ applet_change_orient (MatePanelApplet *applet,
}
gtk_orientable_set_orientation (GTK_ORIENTABLE (cd->main_obox), o);
+ gtk_orientable_set_orientation (GTK_ORIENTABLE (cd->clock_obox), o);
gtk_orientable_set_orientation (GTK_ORIENTABLE (cd->weather_obox), o);
unfix_size (cd);
--
2.17.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment