[recipes] Some visual tweaks to readonly recipes
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [recipes] Some visual tweaks to readonly recipes
- Date: Tue, 20 Dec 2016 13:07:28 +0000 (UTC)
commit 246dfb9315b252f18daf39eecb52b387e92459f7
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Dec 20 08:06:44 2016 -0500
Some visual tweaks to readonly recipes
Hide the buttons that don't work. And mark the delete button
as destructive.
src/gr-details-page.c | 10 +++++-----
src/gr-details-page.ui | 41 ++++++++++++++++++++++++-----------------
2 files changed, 29 insertions(+), 22 deletions(-)
---
diff --git a/src/gr-details-page.c b/src/gr-details-page.c
index c1a58ff..04c70c1 100644
--- a/src/gr-details-page.c
+++ b/src/gr-details-page.c
@@ -797,7 +797,7 @@ gr_details_page_set_recipe (GrDetailsPage *page,
}
gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (page->notes_field)),
- notes, -1);
+ notes ? notes : "", -1);
if (description && description[0]) {
gtk_label_set_label (GTK_LABEL (page->description_label), description);
@@ -808,12 +808,12 @@ gr_details_page_set_recipe (GrDetailsPage *page,
}
if (gr_recipe_is_readonly (recipe)) {
- gtk_widget_set_sensitive (page->edit_button, FALSE);
- gtk_widget_set_sensitive (page->delete_button, FALSE);
+ gtk_widget_hide (page->edit_button);
+ gtk_widget_hide (page->delete_button);
}
else {
- gtk_widget_set_sensitive (page->edit_button, TRUE);
- gtk_widget_set_sensitive (page->delete_button, TRUE);
+ gtk_widget_show (page->edit_button);
+ gtk_widget_show (page->delete_button);
}
}
diff --git a/src/gr-details-page.ui b/src/gr-details-page.ui
index 2ae46e7..5a7c63f 100644
--- a/src/gr-details-page.ui
+++ b/src/gr-details-page.ui
@@ -371,52 +371,59 @@ followed</property>
<object class="GtkActionBar">
<property name="visible">1</property>
<child>
- <object class="GtkToggleButton" id="favorite_button">
+ <object class="GtkButton" id="edit_button">
<property name="visible">1</property>
<property name="use-underline">1</property>
- <property name="label" translatable="yes">_Cook it later</property>
- <signal name="toggled" handler="cook_it_later" swapped="yes"/>
+ <property name="label" translatable="yes">_Edit</property>
+ <signal name="clicked" handler="edit_recipe" swapped="true"/>
</object>
</child>
<child>
- <object class="GtkButton">
+ <object class="GtkButton" id="delete_button">
<property name="visible">1</property>
<property name="use-underline">1</property>
- <property name="label" translatable="yes">_Print</property>
- <signal name="clicked" handler="print_recipe" swapped="yes"/>
+ <property name="label" translatable="yes">_Delete</property>
+ <style> <class name="destructive-action"/> </style>
+ <signal name="clicked" handler="delete_recipe" swapped="true"/>
</object>
</child>
<child>
- <object class="GtkButton">
+ <object class="GtkToggleButton" id="favorite_button">
<property name="visible">1</property>
<property name="use-underline">1</property>
- <property name="label" translatable="yes">_Export</property>
- <signal name="clicked" handler="export_recipe" swapped="yes"/>
+ <property name="label" translatable="yes">_Cook it later</property>
+ <signal name="toggled" handler="cook_it_later" swapped="yes"/>
</object>
+ <packing>
+ <property name="pack-type">end</property>
+ </packing>
</child>
<child>
<object class="GtkButton">
+ <property name="visible">1</property>
<property name="use-underline">1</property>
- <property name="label" translatable="yes">_Share</property>
+ <property name="label" translatable="yes">_Export</property>
+ <signal name="clicked" handler="export_recipe" swapped="yes"/>
</object>
+ <packing>
+ <property name="pack-type">end</property>
+ </packing>
</child>
<child>
- <object class="GtkButton" id="delete_button">
+ <object class="GtkButton">
<property name="visible">1</property>
<property name="use-underline">1</property>
- <property name="label" translatable="yes">_Delete</property>
- <signal name="clicked" handler="delete_recipe" swapped="true"/>
+ <property name="label" translatable="yes">_Print</property>
+ <signal name="clicked" handler="print_recipe" swapped="yes"/>
</object>
<packing>
<property name="pack-type">end</property>
</packing>
</child>
<child>
- <object class="GtkButton" id="edit_button">
- <property name="visible">1</property>
+ <object class="GtkButton">
<property name="use-underline">1</property>
- <property name="label" translatable="yes">_Edit</property>
- <signal name="clicked" handler="edit_recipe" swapped="true"/>
+ <property name="label" translatable="yes">_Share</property>
</object>
<packing>
<property name="pack-type">end</property>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]