diff --git a/data/gwr-window.ui b/data/gwr-window.ui
index f9eddca..c6c10e6 100644
--- a/data/gwr-window.ui
+++ b/data/gwr-window.ui
@@ -7,8 +7,32 @@
600
300
-
diff --git a/src/gwr-window.c b/src/gwr-window.c
index 042aae8..da6a0b0 100644
--- a/src/gwr-window.c
+++ b/src/gwr-window.c
@@ -22,11 +22,12 @@
struct _GwrWindow
{
- GtkApplicationWindow parent_instance;
+ GtkApplicationWindow parent_instance;
- /* Template widgets */
- GtkHeaderBar *header_bar;
- GwrWaterLevel *level;
+ /* Template widgets */
+ GtkHeaderBar *header_bar;
+ GwrWaterLevel *level;
+ GwrWaterLevel *remaining;
};
G_DEFINE_TYPE (GwrWindow, gwr_window, GTK_TYPE_APPLICATION_WINDOW)
@@ -47,14 +48,15 @@ gwr_window_class_init (GwrWindowClass *klass)
gtk_widget_class_set_template_from_resource (widget_class, "/eu/polonkai/gergely/GnomeWaterReminder/gwr-window.ui");
gtk_widget_class_bind_template_child (widget_class, GwrWindow, header_bar);
gtk_widget_class_bind_template_child (widget_class, GwrWindow, level);
+ gtk_widget_class_bind_template_child (widget_class, GwrWindow, remaining);
}
static void
gwr_window_init (GwrWindow *self)
{
- g_type_ensure(GWR_TYPE_WATER_LEVEL);
+ g_type_ensure(GWR_TYPE_WATER_LEVEL);
- gtk_widget_init_template (GTK_WIDGET (self));
+ gtk_widget_init_template (GTK_WIDGET (self));
g_action_map_add_action_entries(G_ACTION_MAP(self), win_entries, G_N_ELEMENTS(win_entries), self);
}
@@ -66,5 +68,6 @@ static void
{
GwrWindow *self = GWR_WINDOW(user_data);
+ gwr_water_level_set_level (self->remaining, gwr_water_level_get_level (self->remaining) - 0.1);
gwr_water_level_set_level (self->level, gwr_water_level_get_level (self->level) + 0.1);
}