toolstack / Folio

A beautiful markdown note-taking app for GNOME (forked from Paper)
GNU General Public License v3.0
185 stars 22 forks source link

Move to more modern widgets #183

Closed turtlegarden closed 1 month ago

turtlegarden commented 1 month ago

This pull request contains a refreshing of widgets to move to modern widgets… among other things. I got distracted. :P

An oversight of the features is as follows:

1) New AdwDialogs throughout the app:

Skjermbilde fra 2024-10-12 16-55-59

2) Notification after moving note to trash

Skjermbilde fra 2024-10-12 16-59-54

3) AdwBreakpoints and AdwNavigationView: see screen recording of the changing sizes here

There's still things to do here, such as figuring out the click gestures.

toolstack commented 1 month ago

Thanks for the PR, I'll take a look at it.

turtlegarden commented 1 month ago

It would probably be best to not calculate in the .po files as part of the difference, as those were automatically updated by Meson. They really make that diff look overwhelming… but the changes are mostly very small.

toolstack commented 1 month ago

It would probably be best to not calculate in the .po files as part of the difference, as those were automatically updated by Meson. They really make that diff look overwhelming… but the changes are mostly very small.

Agreed, I'll update the POs before I do a release, individual PR's don't need to be bothered.

Feel free to revert the commit and then squash everything down if you like.

toolstack commented 1 month ago

I found a few issues:

diff --git a/src/ui/window/window.blp b/src/ui/window/window.blp
index 239f981..1fb6bb2 100644
--- a/src/ui/window/window.blp
+++ b/src/ui/window/window.blp
@@ -33,12 +33,15 @@ template $FolioWindow: Adw.ApplicationWindow {

             child: Adw.ToolbarView {
               content: Box {
-                $FolioNotebooksBar notebooks_bar {}
+                $FolioNotebooksBar notebooks_bar {
+                  width-request: 160;
+                }

                 Box {
                   orientation: vertical;
                   hexpand: true;
                   vexpand: true;
+                  width-request: 225;

                   styles [
                     "notebook-sidebar"

Everything else looks good so far.

turtlegarden commented 1 month ago

OK, those changes are done. Please tell if the button dissapears again.

toolstack commented 1 month ago

Looks good so far, one minor point I noticed, when collapsing the sidebar it's animated with a wipe, but when opening it again it seems to not have the animation, but instead just instantly appear.

turtlegarden commented 1 month ago

That's just an Adwaita thing, but I wonder how to avoid that. Maybe by keeping everything navigated to the notes when a note is open would work. I run that function currently connected to the toggle button, but it may be a good idea to remove the Blueprint binding and run the collapse immediately after. (AdwBreakpoints do not have animated transitions like leaflets, so there's unfortunately no way to make the sidebar dissapear to the side with an animation and have the proper note navigation view at the same time.)

toolstack commented 1 month ago

Weird because the collapse animation seemed to work fine, it was the expand that didn't animate.

turtlegarden commented 1 month ago

Intriguing. Either way, the wipe as it came on was… a little bit clunky, especially because it hints at the user can swipe away the content if the sidebar is hidden (which they still can). To add back the animate, a very complex solution would be needed, or an AdwOverlaySplitView, but the UI when the window is small and not just sidebar collapsed at large size would not be quite right.

toolstack commented 1 month ago

Ok, sounds good, I'll take a final review and merge it.