[Xfce4-commits] [panel-plugins/xfce4-weather-plugin] 01/01: Rework scrollbox updates and resets.

noreply at xfce.org noreply at xfce.org
Sat Oct 25 14:53:11 CEST 2014


This is an automated email from the git hooks/post-receive script.

hjudt pushed a commit to branch master
in repository panel-plugins/xfce4-weather-plugin.

commit 257ab0b975a29cae78b55e2b7c592fce26d46044
Author: Harald Judt <h.judt at gmx.at>
Date:   Sat Oct 25 12:25:45 2014 +0200

    Rework scrollbox updates and resets.
---
 panel-plugin/weather-scrollbox.c |    5 ++++-
 panel-plugin/weather.c           |   11 +++++------
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/panel-plugin/weather-scrollbox.c b/panel-plugin/weather-scrollbox.c
index 119fe4a..58bf6fa 100644
--- a/panel-plugin/weather-scrollbox.c
+++ b/panel-plugin/weather-scrollbox.c
@@ -344,7 +344,10 @@ gtk_scrollbox_control_loop(gpointer user_data)
         self->fade = FADE_SLEEP;
         break;
     case FADE_OUT:
-        self->fade = FADE_IN;
+        if (self->animate)
+            self->fade = FADE_IN;
+        else
+            self->fade = FADE_NONE;
         gtk_scrollbox_swap_labels(self);
         break;
     case FADE_NONE:
diff --git a/panel-plugin/weather.c b/panel-plugin/weather.c
index 8ee4de0..d3c6e72 100644
--- a/panel-plugin/weather.c
+++ b/panel-plugin/weather.c
@@ -402,7 +402,7 @@ update_current_conditions(plugin_data *data,
 
     if (G_UNLIKELY(data->weatherdata == NULL)) {
         update_icon(data);
-        update_scrollbox(data, FALSE);
+        update_scrollbox(data, TRUE);
         schedule_next_wakeup(data);
         return;
     }
@@ -430,9 +430,7 @@ update_current_conditions(plugin_data *data,
 
     /* update widgets */
     update_icon(data);
-    update_scrollbox(data, FALSE);
-    if (immediately)
-        gtk_scrollbox_reset(GTK_SCROLLBOX(data->scrollbox));
+    update_scrollbox(data, immediately);
 
     /* schedule next update */
     now_tm.tm_min += 5;
@@ -568,6 +566,8 @@ cb_weather_update(SoupSession *session,
                  (GCompareFunc) xml_time_compare);
     weather_debug("Updating current conditions.");
     update_current_conditions(data, !parsing_error);
+    gtk_scrollbox_reset(GTK_SCROLLBOX(data->scrollbox));
+
     data->weather_update->finished = TRUE;
     weather_dump(weather_dump_weatherdata, data->weatherdata);
 }
@@ -589,7 +589,7 @@ update_handler(plugin_data *data)
        scrollbox and return */
     if (G_UNLIKELY(data->lat == NULL || data->lon == NULL)) {
         update_icon(data);
-        update_scrollbox(data, FALSE);
+        update_scrollbox(data, TRUE);
         return FALSE;
     }
 
@@ -1408,7 +1408,6 @@ update_weatherdata_with_reset(plugin_data *data)
 
     /* make use of previously saved data */
     read_cache_file(data);
-    update_current_conditions(data, TRUE);
 
     /* schedule downloads immediately */
     time(&now_t);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list