Skip to content

Adding preference to enable vertical layout mode #1872#1902

Merged
glushchenko merged 2 commits intoglushchenko:masterfrom
afaden:vertical_layout
Mar 15, 2026
Merged

Adding preference to enable vertical layout mode #1872#1902
glushchenko merged 2 commits intoglushchenko:masterfrom
afaden:vertical_layout

Conversation

@afaden
Copy link
Contributor

@afaden afaden commented Mar 7, 2026

Adding "Vertical Layout (applies after quit)" checkbox to the Layout preferences, to switch to a layout with the note list above the note editor.
Screenshot 2026-03-07 at 1 46 48 AM
Screenshot 2026-03-07 at 1 43 30 AM

@afaden afaden mentioned this pull request Mar 7, 2026
@glushchenko
Copy link
Owner

It looks definitely good, I'll try to test it, and if everything goes well, we'll release it in the next update.

@glushchenko
Copy link
Owner

After restarting, in the case of vertical orientation, you need to restore the width of the list of notes and the height of a single note so that one preview line is visible. That is, in the same position in which the program was after installation.

And if you switch to horizontal mode, it should look like the screenshot.

- Changed preference label to "Arrange note list above editor (applies after quit)"
- When user changes horizontalOrientation, reset note list width/height to default
- When changing to horizontalOrientation=true, set note list cell height to 0
- When changing to horizontalOrientation=false, reset note list cell height to default
@afaden
Copy link
Contributor Author

afaden commented Mar 8, 2026

It looks definitely good, I'll try to test it, and if everything goes well, we'll release it in the next update.

Thanks, I really appreciate it!

Before getting into the below details, I wanted to make sure I'm on the same page as you on the horizontal vs vertical terminology. Here's what I wrote in the issue #1872 thread:

A side note, I've noticed that you've called this "horizontal mode", and I think I see why now – NSSplitView.isVertical = true means "use vertical dividers, so lay out the items horizontally side-by-side" and NSSplitView.isVertical = false means "use horizontal dividers, so lay out the items vertically top-to-bottom". But for users I think it would make more sense to call it a "vertical layout" when it has items laid out vertically top-to-bottom. That's why I proposed calling the checkbox "Vertical Layout", and when it's on it would set horizontalOrientation = true and NSSplitView.isVertical = false.

To just avoid the ambiguous horizontal/vertical terminology altogether, I changed the preference label to "Arrange note list above editor (applies after quit)". Does that sound good to you? Here's what that preference looks like now:

Screenshot 2026-03-08 at 3 51 07 AM

After restarting, in the case of vertical orientation, you need to restore the width of the list of notes and the height of a single note so that one preview line is visible. That is, in the same position in which the program was after installation.

I'm assuming here by "vertical orientation" you mean horizontalOrientation = false and NSSplitView.isVertical = true (side-by-side).

So I understand this to mean that when the user switches to horizontalOrientation = false, it should set the cellSpacing to 33 (the default value in UserDefaultsManagement). I've made it just set the preference value but not actually call setTableRowHeight, so this change won't appear until the user restarts the app.

And you also want to set the note list width to the default. This was a little trickier. At first I thought it was the notesTableWidth preference, but it looks like that's only used when doing toggleNoteList. Otherwise it's using splitView.autosaveName "EditorSplitView" so that the system automatically saves the divider position. It turns out this is saved in a UserDefault key "NSSplitView Subview Frames EditorSplitView". So my approach here was to simply remove that, so that it would fall back to the default. Here's what the window looks like after switching to horizontalOrientation = false and restarting the app:

Screenshot 2026-03-08 at 3 28 30 AM

And if you switch to horizontal mode, it should look like the screenshot.

I take this to mean that when you switch to horizontalOrientation = true (top-to-bottom), it should set the note list spacing to 0. And also that it should set a reasonable note list height – for that I tried just removing the "NSSplitView Subview Frames EditorSplitView" preference in this case as well, and that seemed to work well. Here's what the window looks like after switching to horizontalOrientation = true and restarting the app:

Screenshot 2026-03-08 at 3 28 44 AM

@glushchenko glushchenko merged commit 4b10125 into glushchenko:master Mar 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants