[dconf-editor] Allow bookmarking key paths.
- From: Arnaud Bonatti <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dconf-editor] Allow bookmarking key paths.
- Date: Fri, 8 Jul 2016 14:18:16 +0000 (UTC)
commit baa74d7da66a08e513720d7ef21e898223ee5d7b
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Fri Jul 8 16:17:19 2016 +0200
Allow bookmarking key paths.
editor/dconf-editor.ui | 2 +-
editor/dconf-window.vala | 10 +++++++++-
editor/registry-view.vala | 12 +++++++++---
3 files changed, 19 insertions(+), 5 deletions(-)
---
diff --git a/editor/dconf-editor.ui b/editor/dconf-editor.ui
index 8371456..5e902b7 100644
--- a/editor/dconf-editor.ui
+++ b/editor/dconf-editor.ui
@@ -94,7 +94,7 @@
<property name="focus-on-click">False</property>
<property name="schema-id">ca.desrt.dconf-editor.Settings</property>
<signal name="clicked" handler="on_menu_button_clicked"/>
- <signal name="bookmark_activated" handler="scroll_to_path"/>
+ <signal name="bookmark_activated" handler="scroll_to_path_without_transition"/>
<!-- <accelerator key="B" signal="activate" modifiers="GDK_CONTROL_MASK"/> TODO -->
<style>
<class name="image-button"/> <!-- TODO https://bugzilla.gnome.org/show_bug.cgi?id=756731 -->
diff --git a/editor/dconf-window.vala b/editor/dconf-window.vala
index bb76cb2..6bfda84 100644
--- a/editor/dconf-window.vala
+++ b/editor/dconf-window.vala
@@ -162,6 +162,14 @@ class DConfWindow : ApplicationWindow
}
[GtkCallback]
+ private bool scroll_to_path_without_transition (string full_name)
+ {
+ registry_view.enable_transition (false);
+ bool return_value = registry_view.scroll_to_path (full_name);
+ registry_view.enable_transition (true);
+ return return_value;
+ }
+ [GtkCallback]
private bool scroll_to_path (string full_name)
{
return registry_view.scroll_to_path (full_name);
@@ -175,7 +183,7 @@ class DConfWindow : ApplicationWindow
{
GLib.Menu section;
- bookmarks_button.current_path = stripped_path (current_path);
+ bookmarks_button.current_path = current_path;
pathbar.set_path (current_path);
GLib.Menu menu = new GLib.Menu ();
diff --git a/editor/registry-view.vala b/editor/registry-view.vala
index 20e1792..457ae03 100644
--- a/editor/registry-view.vala
+++ b/editor/registry-view.vala
@@ -73,6 +73,11 @@ class RegistryView : Grid
((DConfWindow) this.get_parent ()).update_hamburger_menu ();
}
+ public void enable_transition (bool enable)
+ {
+ stack.set_transition_type (enable ? StackTransitionType.CROSSFADE : StackTransitionType.NONE);
+ }
+
/*\
* * Dir TreeView
\*/
@@ -111,10 +116,9 @@ class RegistryView : Grid
return false;
}
- update_current_path (full_name);
-
if (full_name == folder_name)
{
+ update_current_path (full_name);
show_browse_view ();
}
else
@@ -123,12 +127,14 @@ class RegistryView : Grid
Key? key = get_key_from_name (names [names.length - 1]);
if (key == null)
{
+ update_current_path (folder_name);
empty_path_message_dialog ((Window) this.get_parent ());
return false;
}
if (!properties_view.populate_properties_list_box (revealer, (!) key))
return false;
+ update_current_path (full_name);
stack.set_visible_child (properties_view);
}
@@ -209,8 +215,8 @@ class RegistryView : Grid
if (!properties_view.populate_properties_list_box (revealer, key)) // TODO unduplicate
return;
- stack.set_visible_child (properties_view);
update_current_path (key.full_name);
+ stack.set_visible_child (properties_view);
});
// TODO bug: row is always visually activated after the dialog destruction if mouse is over at
this time
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]