[recipes] Add an explicit Done button to the end of cooking mode
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [recipes] Add an explicit Done button to the end of cooking mode
- Date: Tue, 14 Feb 2017 02:35:59 +0000 (UTC)
commit 54777867f0235849bd6edb116cb0be7a33921f09
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Feb 13 21:35:17 2017 -0500
Add an explicit Done button to the end of cooking mode
src/gr-cooking-page.c | 3 +++
src/gr-cooking-page.ui | 13 +++++++++++++
src/recipes.css | 5 +++++
3 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/src/gr-cooking-page.c b/src/gr-cooking-page.c
index a630be1..dc0d08d 100644
--- a/src/gr-cooking-page.c
+++ b/src/gr-cooking-page.c
@@ -43,6 +43,7 @@ struct _GrCookingPage
GtkWidget *cooking_view;
GtkWidget *prev_step_button;
GtkWidget *next_step_button;
+ GtkWidget *done_button;
GrRecipe *recipe;
@@ -139,6 +140,7 @@ update_steppers (GrCookingPage *page)
gtk_widget_set_sensitive (page->prev_step_button, step - 1 >= 0);
gtk_widget_set_sensitive (page->next_step_button, step + 1 <= n_steps - 1);
+ gtk_widget_set_visible (page->done_button, step == n_steps - 1);
}
static void
@@ -392,6 +394,7 @@ gr_cooking_page_class_init (GrCookingPageClass *klass)
gtk_widget_class_bind_template_child (widget_class, GrCookingPage, event_box);
gtk_widget_class_bind_template_child (widget_class, GrCookingPage, prev_step_button);
gtk_widget_class_bind_template_child (widget_class, GrCookingPage, next_step_button);
+ gtk_widget_class_bind_template_child (widget_class, GrCookingPage, done_button);
gtk_widget_class_bind_template_callback (widget_class, prev_step);
gtk_widget_class_bind_template_callback (widget_class, next_step);
diff --git a/src/gr-cooking-page.ui b/src/gr-cooking-page.ui
index 262d3e7..b0d09e0 100644
--- a/src/gr-cooking-page.ui
+++ b/src/gr-cooking-page.ui
@@ -86,6 +86,19 @@
</object>
</child>
<child type="overlay">
+ <object class="GtkButton" id="done_button">
+ <property name="halign">end</property>
+ <property name="valign">end</property>
+ <property name="margin">100</property>
+ <property name="label" translatable="yes">Done</property>
+ <signal name="clicked" handler="stop_cooking" swapped="yes"/>
+ <style>
+ <class name="suggested-action"/>
+ <class name="cooking-button"/>
+ </style>
+ </object>
+ </child>
+ <child type="overlay">
<object class="GtkGrid" id="cooking_overlay">
<property name="visible">1</property>
<property name="halign">center</property>
diff --git a/src/recipes.css b/src/recipes.css
index 2e120f3..e5521c5 100644
--- a/src/recipes.css
+++ b/src/recipes.css
@@ -395,3 +395,8 @@ label.notification-label {
.image-button.osd {
margin: 16px;
}
+
+.cooking-button {
+ font-size: 30px;
+ color: #ddd;
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]