[recipes/inline-editing] Only allow one row at a time to be edited
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [recipes/inline-editing] Only allow one row at a time to be edited
- Date: Tue, 25 Apr 2017 19:47:05 +0000 (UTC)
commit 4e9eb93353b0c7540f8751b9542f527afadf3fd8
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Apr 25 15:45:59 2017 -0400
Only allow one row at a time to be edited
We already have code to enforce that only one row at
a time can be "active". We just need to translate this
into showing or hiding the entries.
src/gr-ingredients-viewer-row.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/src/gr-ingredients-viewer-row.c b/src/gr-ingredients-viewer-row.c
index 99d9601..77cf607 100644
--- a/src/gr-ingredients-viewer-row.c
+++ b/src/gr-ingredients-viewer-row.c
@@ -183,19 +183,24 @@ gr_ingredients_viewer_row_set_editable (GrIngredientsViewerRow *row,
gtk_list_box_row_set_activatable (GTK_LIST_BOX_ROW (row), editable);
}
+static void save_row (GrIngredientsViewerRow *row);
+
static void
gr_ingredients_viewer_row_set_active (GrIngredientsViewerRow *row,
gboolean active)
{
+ if (row->active && !active)
+ save_row (row);
+
row->active = active;
gtk_stack_set_visible_child_name (GTK_STACK (row->buttons_stack), active ? "buttons" : "empty");
}
static void
gr_ingredients_viewer_row_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
GrIngredientsViewerRow *self = GR_INGREDIENTS_VIEWER_ROW (object);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]