[recipes] ingredients: Make clicking the placeholder add a row
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [recipes] ingredients: Make clicking the placeholder add a row
- Date: Mon, 8 May 2017 01:41:56 +0000 (UTC)
commit 1cdae3d8b8f1477835efa82a041c077c01d17542
Author: Matthias Clasen <mclasen redhat com>
Date: Sun May 7 21:41:13 2017 -0400
ingredients: Make clicking the placeholder add a row
We do the same in the image viewer. And it just makes sense.
src/gr-ingredients-viewer.c | 3 +--
src/gr-ingredients-viewer.ui | 30 ++++++++++++++++++------------
2 files changed, 19 insertions(+), 14 deletions(-)
---
diff --git a/src/gr-ingredients-viewer.c b/src/gr-ingredients-viewer.c
index 8ab74f2..e5006ea 100644
--- a/src/gr-ingredients-viewer.c
+++ b/src/gr-ingredients-viewer.c
@@ -237,8 +237,7 @@ edit_ingredient_row (GrIngredientsViewerRow *row,
}
static void
-add_row (GtkButton *button,
- GrIngredientsViewer *viewer)
+add_row (GrIngredientsViewer *viewer)
{
GtkWidget *row;
diff --git a/src/gr-ingredients-viewer.ui b/src/gr-ingredients-viewer.ui
index 2c05655..f3413be 100644
--- a/src/gr-ingredients-viewer.ui
+++ b/src/gr-ingredients-viewer.ui
@@ -61,18 +61,24 @@
<class name="frame"/>
</style>
<child type="placeholder">
- <object class="GtkLabel">
+ <object class="GtkEventBox">
<property name="visible">1</property>
- <property name="xalign">0.5</property>
- <property name="halign">fill</property>
- <property name="margin-start">20</property>
- <property name="margin-end">20</property>
- <property name="margin-top">10</property>
- <property name="margin-bottom">10</property>
- <property name="label" translatable="yes">No ingredients added yet</property>
- <style>
- <class name="dim-label"/>
- </style>
+ <signal name="button-press-event" handler="add_row" swapped="yes"/>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">1</property>
+ <property name="xalign">0.5</property>
+ <property name="halign">fill</property>
+ <property name="margin-start">20</property>
+ <property name="margin-end">20</property>
+ <property name="margin-top">10</property>
+ <property name="margin-bottom">10</property>
+ <property name="label" translatable="yes">No ingredients added yet</property>
+ <style>
+ <class name="dim-label"/>
+ </style>
+ </object>
+ </child>
</object>
</child>
</object>
@@ -82,7 +88,7 @@
<property name="visible">1</property>
<property name="halign">start</property>
<property name="margin-top">10</property>
- <signal name="clicked" handler="add_row"/>
+ <signal name="clicked" handler="add_row" swapped="yes"/>
<style>
<class name="dim-label"/>
</style>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]