Add another glass with the remaining water
This commit is contained in:
parent
1503eea2d2
commit
8ddaa8c5a2
@ -6,9 +6,33 @@
|
|||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="default_width">600</property>
|
<property name="default_width">600</property>
|
||||||
<property name="default_height">300</property>
|
<property name="default_height">300</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="homogeneous">True</property>
|
||||||
|
<child>
|
||||||
|
<object class="GwrWaterLevel" id="remaining">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="level">1.0</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GwrWaterLevel" id="level">
|
<object class="GwrWaterLevel" id="level">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
|
<property name="level">0.0</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child type="titlebar">
|
<child type="titlebar">
|
||||||
|
@ -27,6 +27,7 @@ struct _GwrWindow
|
|||||||
/* Template widgets */
|
/* Template widgets */
|
||||||
GtkHeaderBar *header_bar;
|
GtkHeaderBar *header_bar;
|
||||||
GwrWaterLevel *level;
|
GwrWaterLevel *level;
|
||||||
|
GwrWaterLevel *remaining;
|
||||||
};
|
};
|
||||||
|
|
||||||
G_DEFINE_TYPE (GwrWindow, gwr_window, GTK_TYPE_APPLICATION_WINDOW)
|
G_DEFINE_TYPE (GwrWindow, gwr_window, GTK_TYPE_APPLICATION_WINDOW)
|
||||||
@ -47,6 +48,7 @@ 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_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, header_bar);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GwrWindow, level);
|
gtk_widget_class_bind_template_child (widget_class, GwrWindow, level);
|
||||||
|
gtk_widget_class_bind_template_child (widget_class, GwrWindow, remaining);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -66,5 +68,6 @@ static void
|
|||||||
{
|
{
|
||||||
GwrWindow *self = GWR_WINDOW(user_data);
|
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);
|
gwr_water_level_set_level (self->level, gwr_water_level_get_level (self->level) + 0.1);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user