[gimp] app: fix #6724 When creating keyboard shortcut the section being edited disappears
- From: Jacob Boerema <jboerema src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: fix #6724 When creating keyboard shortcut the section being edited disappears
- Date: Thu, 29 Jul 2021 22:03:48 +0000 (UTC)
commit af909b82b279a9991f44ece5752c0c5cae05e454
Author: Jacob Boerema <jgboerema gmail com>
Date: Thu Jul 29 17:59:03 2021 -0400
app: fix #6724 When creating keyboard shortcut the section being edited disappears
After updating a keyboard shortcut in the Configure Keyboard Shortcuts
Dialog, the section containing the changed shortcut disappeared.
Apparently a changed shortcut makes its parent invisible so we make the
parent visible again.
We also store a text version of the selected path in the tree to the
shortcut and then use that to restore the path after making the parent
visible again.
app/widgets/gimpactionview.c | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
---
diff --git a/app/widgets/gimpactionview.c b/app/widgets/gimpactionview.c
index 4702f9e0b5..211ec44d44 100644
--- a/app/widgets/gimpactionview.c
+++ b/app/widgets/gimpactionview.c
@@ -470,9 +470,10 @@ gimp_action_view_accel_changed (GtkAccelGroup *accel_group,
GClosure *accel_closure,
GimpActionView *view)
{
- GtkTreeModel *model;
+ GtkTreeModel *model, *tmpmodel;
GtkTreeIter iter;
gboolean iter_valid;
+ gchar *pathstr = NULL;
model = gtk_tree_view_get_model (GTK_TREE_VIEW (view));
if (! model)
@@ -482,6 +483,14 @@ gimp_action_view_accel_changed (GtkAccelGroup *accel_group,
if (! model)
return;
+ if (gtk_tree_selection_get_selected (gtk_tree_view_get_selection (GTK_TREE_VIEW (view)),
+ &tmpmodel, &iter))
+ {
+ GtkTreePath *path = gtk_tree_model_get_path (tmpmodel, &iter);
+
+ pathstr = gtk_tree_path_to_string(path);
+ }
+
for (iter_valid = gtk_tree_model_get_iter_first (model, &iter);
iter_valid;
iter_valid = gtk_tree_model_iter_next (model, &iter))
@@ -525,11 +534,23 @@ gimp_action_view_accel_changed (GtkAccelGroup *accel_group,
GIMP_ACTION_VIEW_COLUMN_ACCEL_KEY, accel_key,
GIMP_ACTION_VIEW_COLUMN_ACCEL_MASK, accel_mask,
-1);
+ gtk_tree_store_set (GTK_TREE_STORE (model), &iter,
+ GIMP_ACTION_VIEW_COLUMN_VISIBLE, TRUE,
+ -1);
+
+ if (pathstr)
+ {
+ GtkTreePath *path = gtk_tree_path_new_from_string (pathstr);
+ gimp_action_view_select_path (view, path);
+ gtk_tree_path_free (path);
+ }
+ g_free (pathstr);
return;
}
}
}
+ g_free (pathstr);
}
typedef struct
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]