[dconf-editor] Make escape work on small screens.
- From: Arnaud B. <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dconf-editor] Make escape work on small screens.
- Date: Wed, 14 Nov 2018 13:49:03 +0000 (UTC)
commit 6b692d0d7f87c76c0768fe8da5212eb66ed58876
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Mon Oct 22 16:58:10 2018 +0200
Make escape work on small screens.
editor/browser-view.vala | 7 ++++++-
editor/dconf-window.vala | 16 ++++++++++++++--
2 files changed, 20 insertions(+), 3 deletions(-)
---
diff --git a/editor/browser-view.vala b/editor/browser-view.vala
index b53e186..d91b8d4 100644
--- a/editor/browser-view.vala
+++ b/editor/browser-view.vala
@@ -202,7 +202,8 @@ private class BrowserView : Stack, AdaptativeWidget
* * bookmarks
\*/
- internal bool in_window_bookmarks { internal get; private set; default = false; }
+ internal bool in_window_bookmarks { internal get; private set; default = false; }
+ internal bool in_window_bookmarks_edit_mode { internal get; private set; default = false; }
[GtkChild] private BookmarksList bookmarks_list;
[GtkChild] private Grid current_child_grid;
@@ -229,6 +230,8 @@ private class BrowserView : Stack, AdaptativeWidget
internal void hide_in_window_bookmarks ()
{
+ if (in_window_bookmarks_edit_mode)
+ leave_bookmarks_edit_mode ();
in_window_bookmarks = false;
set_visible_child (current_child_grid);
}
@@ -237,11 +240,13 @@ private class BrowserView : Stack, AdaptativeWidget
requires (in_window_bookmarks == true)
{
bookmarks_list.enter_edit_mode ();
+ in_window_bookmarks_edit_mode = true;
}
internal bool leave_bookmarks_edit_mode ()
requires (in_window_bookmarks == true)
{
+ in_window_bookmarks_edit_mode = false;
return bookmarks_list.leave_edit_mode ();
}
diff --git a/editor/dconf-window.vala b/editor/dconf-window.vala
index e8a4e2e..55d0f94 100644
--- a/editor/dconf-window.vala
+++ b/editor/dconf-window.vala
@@ -812,6 +812,8 @@ private class DConfWindow : ApplicationWindow
private void hide_in_window_bookmarks (/* SimpleAction action, Variant? path_variant */)
{
+ if (browser_view.in_window_bookmarks_edit_mode)
+ leave_edit_mode (); // TODO place after
headerbar.hide_in_window_bookmarks ();
browser_view.hide_in_window_bookmarks ();
}
@@ -959,7 +961,7 @@ private class DConfWindow : ApplicationWindow
private void enter_edit_mode ()
{
- edit_mode_state_action.set_state (true);
+ // edit_mode_state_action.change_state (true);
update_actions ();
@@ -1175,7 +1177,14 @@ private class DConfWindow : ApplicationWindow
private void escape_pressed (/* SimpleAction action, Variant? variant */)
{
- if (headerbar.search_mode_enabled)
+ if (browser_view.in_window_bookmarks)
+ {
+ if (browser_view.in_window_bookmarks_edit_mode)
+ leave_edit_mode ();
+ else
+ hide_in_window_bookmarks ();
+ }
+ else if (headerbar.search_mode_enabled)
stop_search ();
else if (current_type == ViewType.CONFIG)
request_folder (current_path);
@@ -1434,6 +1443,9 @@ private class DConfWindow : ApplicationWindow
[GtkCallback]
private bool on_key_press_event (Widget widget, Gdk.EventKey event)
{
+ if (browser_view.in_window_bookmarks)
+ return false;
+
uint keyval = event.keyval;
string name = (!) (Gdk.keyval_name (keyval) ?? "");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]