weather: reflect panel configuration change immediately
authorMamoru TASAKA <mtasaka@fedoraproject.org>
Tue, 2 Jan 2018 14:50:22 +0000 (23:50 +0900)
committerAndriy Grytsenko <andrej@rep.kiev.ua>
Sun, 7 Jan 2018 19:37:37 +0000 (21:37 +0200)
https://bugzilla.redhat.com/show_bug.cgi?id=1261464

For example, when font color on panel configuration changes,
we should apply the change immediately.

plugins/weather/weather.c
plugins/weather/weatherwidget.c
plugins/weather/weatherwidget.h

index 0f87d7c..7c9af86 100644 (file)
@@ -298,6 +298,11 @@ weather_configuration_changed(LXPanel *pPanel, GtkWidget *pWidget)
               (panel_get_orientation(pPanel) == GTK_ORIENTATION_VERTICAL)?"VERTICAL":"NONE",
               pPanel->width, panel_get_height(pPanel), 
               panel_get_icon_size(pPanel));
+
+      WeatherPluginPrivate * pPriv = (WeatherPluginPrivate *) lxpanel_plugin_get_data(pWidget);
+      GtkWeather * weather = GTK_WEATHER(pPriv->pWeather_);
+      gtk_weather_render(weather);
+
     }
 }
 
index 3cca937..eea608d 100644 (file)
@@ -145,7 +145,6 @@ static guint gtk_weather_signals[LAST_SIGNAL] = {0};
 /* Function declarations. */
 static void gtk_weather_class_init    (GtkWeatherClass * klass);
 static void gtk_weather_init          (GtkWeather * weather);
-static void gtk_weather_render        (GtkWeather * weather);
 static void gtk_weather_size_allocate (GtkWidget * widget, GtkAllocation * allocation);
 
 static void gtk_weather_destroy       (GObject * object);
@@ -452,7 +451,7 @@ gtk_weather_size_allocate(GtkWidget * widget, GtkAllocation * allocation)
  *
  * @param weather Pointer to the instance of this widget.
  */
-static void
+void
 gtk_weather_render(GtkWeather * weather)
 {
   GtkWeatherPrivate * priv = GTK_WEATHER_GET_PRIVATE(weather);
index 8fcc2f9..61058f2 100644 (file)
@@ -69,6 +69,8 @@ void weather_save_configuration(GtkWidget * pWeather, LocationInfo * pLocation);
 void weather_set_label_text(GtkWidget * pWeather, GtkWidget * label,
                             const gchar * text);
 
+void gtk_weather_render        (GtkWeather * weather);
+
 G_END_DECLS
 
 #endif