<property name="title" translatable="yes">AWeather</property>
<property name="default_width">600</property>
<property name="default_height">400</property>
+ <signal name="configure-event" handler="on_configure" swapped="no"/>
<child>
<object class="GtkVBox" id="main_body">
<property name="visible">True</property>
//}
}
+G_MODULE_EXPORT gboolean on_configure(AWeatherGui *self, GdkEventConfigure *config)
+{
+ g_debug("AWeatherGui: on_configure - %dx%d", config->width, config->height);
+ grits_prefs_set_integer(self->prefs, "aweather/width", config->width);
+ grits_prefs_set_integer(self->prefs, "aweather/height", config->height);
+ return FALSE;
+}
+
/* Prefs callbacks */
G_MODULE_EXPORT void on_offline(GtkToggleAction *action, AWeatherGui *self)
{
prefs_setup(self);
icons_setup(self);
+ /* Default size */
+ gint width = grits_prefs_get_integer(self->prefs, "aweather/width", NULL);
+ gint height = grits_prefs_get_integer(self->prefs, "aweather/height", NULL);
+ if (width && height)
+ gtk_window_set_default_size(GTK_WINDOW(self), width, height);
+
/* Connect signals */
gtk_builder_connect_signals(self->builder, self);
g_signal_connect(self, "key-press-event",