Fix note list row alignment on Windows display scaling#773
Conversation
|
@nuttyartist Can I get review on this? |
|
Can you add before & after screenshots? |
|
The windows failure looks unrelated to my changes. |
|
Indeed, I just ran the ci/cd on master and it failed with the same issues https://github.com/nuttyartist/notes/actions/runs/27494239891/job/81265236753 |
|
@nuttyartist gentle ping! |
|
Hi there @AJ0070! Thanks for contributing. Going over your PR now! |
There was a problem hiding this comment.
Thanks again for the changes. There are some issues.
1. Animation rows no longer collapse/expand correctly
src/notelistdelegate.cpp
First, this PR breaks the some of the animations of notes list delegates:
Before:
Screen.Recording.2026-06-19.at.13.02.09.mov
After:
Screen.Recording.2026-06-19.at.13.00.46.mov
The reason
The new minimum-height clamp is applied even when sizeHint() is returning timeline-scaled heights for insert/remove/move animations. That means an animated row can be clamped back up to minimumRowHeight() instead of shrinking toward zero or growing smoothly.
How to test
Create, delete, pin, or unpin a note and watch the note-list row animation. The affected row should smoothly grow or collapse. With this change, the row can remain at least minimumRowHeight() during the animation.
2. Pinned/Notes section header height is missing from the minimum row height
src/notelistdelegate.cpp
src/notelistdelegateeditor.cpp
The painted content is shifted down by 25px for the first pinned row or first unpinned row under the Pinned / Notes section headers, but the new minimum-height calculation does not include that 25px. At higher Windows scaling, those first rows can still clip or overlap because the row floor only accounts for text/folder/tag content, not the section header above it.
How to test
On Windows, use display scaling or text scaling high enough to reproduce the original issue, ideally 150% or 175%.
Create notes so there is:
- a first pinned note
- a first unpinned note
- tagged rows
- the
All Notesview, so the folder line is visible
Then inspect the first pinned and first unpinned rows. These are the rows whose content is shifted down by the section header. If the 25px header is missing from the minimum height, they are the most likely places to see clipped text, clipped tag chips, or overlap.
nuttyartist
left a comment
There was a problem hiding this comment.
Thanks for tackling the Windows scaling issue. I left two spots where the sizing math still needs to account for existing behavior.
| } else { | ||
| result.setHeight(result.height() - 10 + note_list_constants::LAST_EL_SEP_SPACE + yOffsets); | ||
| } | ||
| result.setHeight(qMax(result.height(), minimumHeight)); |
There was a problem hiding this comment.
This clamp also runs for animated rows. In the animated branch above, result.height() is intentionally scaled by the timeline so insert/remove/move rows can grow or collapse, but the final qMax(..., minimumHeight) raises it back to at least the full minimum height.
Suggested fix: only apply the minimum-height floor when the row is not in m_animatedIndexes, or clamp the target row height before applying the timeline rate.
How to test: create, delete, pin, or unpin a note and watch the affected row. It should smoothly grow/collapse. You can also log result.height() near currentFrame == 0: it is computed near zero, then raised again by this qMax.
| } | ||
|
|
||
| int yOffsets = secondYOffset + thirdYOffset + fourthYOffset + fifthYOffset; | ||
| const int minimumHeight = minimumRowHeight() + yOffsets; |
There was a problem hiding this comment.
This minimum height does not include the 25px section header for the first pinned row / first unpinned row, even though paintLabels() shifts those rows' content down by that header. Once font metrics exceed the old fixed budget, those first rows can still clip/overlap. The same issue applies to the editor floor in NoteListDelegateEditor::recalculateSize() because tagListTop() includes the 25px header but minimumRowHeight() + tag height does not.
Suggested fix: include the same header offset in the minimum-height calculation for first pinned/first unpinned rows, preferably via a shared helper so delegate paint, tag placement, and row sizing stay in sync.
How to test: on Windows at 150% or 175% scaling, create a first pinned note and a first unpinned note, with tags, and also check All Notes so the folder line is visible. Inspect those first rows for clipped text, clipped tag chips, or overlap.
|
@nuttyartist Thank you for the comprehensive review! I've addressed both issues. |
|
I found one follow-up visual regression after the latest sizing fix: when the first pinned note is selected, the selected background now bleeds upward into the The likely cause is that bufferRect.setY(bufferRect.y() + note_list_constants::SECTION_HEADER_HEIGHT + fifthYOffset);Suggested fix: mirror that behavior in A shape like this should be close: int headerOffset = sectionHeaderHeight(index, *model);
if (headerOffset > 0 && !(m_view->isPinnedNotesCollapsed() && model->isFirstPinnedNote(index))) {
int fifthYOffset = 0;
if (!m_view->isPinnedNotesCollapsed() && model->isFirstUnpinnedNote(index)) {
fifthYOffset = note_list_constants::LAST_PINNED_TO_UNPINNED_HEADER;
}
bufferRect.setY(bufferRect.y() + headerOffset + fifthYOffset);
}How to test:
|
|
@nuttyartist I have fixed the follow-up visual regression. |
|
Let me know if any further changes are required. |
|
@nuttyartist I have addressed all of the reviews, please let me know if any further changes are required. |
|
@AJ0070 Sorry for the delay, I'll have available time to properly review your changes only at the weekend. I did find multiple issues with your changes already, so I want to make sure to test it again properly. Stay tuned. |








Changes
Why
The Windows issue appears to come from a mismatch between:
Segoe UIand non-100%display scalingWhen scaling increases text height, the old fixed values could leave the content taller than the row allocated for it, causing visible misalignment.
Tested for these settings
Built and tested locally on Windows.
Verified the note list manually at multiple display scaling levels:
100%125%150%175%Checked the following scenarios at each scaling level:
All NotesviewVerified that:
All Notesrows still leave enough room for the folder lineFixes #164