[gnome-notes/igaldino/fix-trash-note-new-window] window-base: Fixed trash note in new window



commit 44afc43f8ad3c94c1b490c7e2281dcac8e624e42
Author: Isaque Galdino <igaldino gmail com>
Date:   Fri Apr 3 00:57:03 2020 -0300

    window-base: Fixed trash note in new window
    
    If you go to trash from main view and open a note, then click the "Open
    in New Window" menu option, the main window shows the main view with
    trash notes.
    
    This fixes that by making the main window to show trash view.

 src/bjb-window-base.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/src/bjb-window-base.c b/src/bjb-window-base.c
index 9dbb288..d6c1b11 100644
--- a/src/bjb-window-base.c
+++ b/src/bjb-window-base.c
@@ -205,7 +205,11 @@ on_detach_window_cb (GSimpleAction *action,
   if (!note)
     return;
 
-  bjb_window_base_switch_to (self, BJB_WINDOW_BASE_MAIN_VIEW);
+  if (biji_note_obj_is_trashed (note))
+    bjb_window_base_switch_to (self, BJB_WINDOW_BASE_ARCHIVE_VIEW);
+  else
+    bjb_window_base_switch_to (self, BJB_WINDOW_BASE_MAIN_VIEW);
+
   bijiben_new_window_for_note (g_application_get_default (), note);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]