nuttyartist / notes

Fast and beautiful note-taking app written in C++. Write down your thoughts.
https://notes-foss.com
Mozilla Public License 2.0
3.72k stars 326 forks source link

A couple of fixes for frameless mode #505

Closed guihkx closed 1 year ago

guihkx commented 1 year ago

1 - Don't allow resizing the window in certain states:

While in frameless mode, if the window is either maximized or in full screen, we probably shouldn't allow the user to resize it.

Bug:

https://user-images.githubusercontent.com/626206/221879465-beab71e3-ca36-4de0-9974-ea5a786d1fcd.mp4



2 - Only allow moving the window by grabbing its title bar:

Previously, while in frameless mode, we could move the window by grabbing some unusual places. Now, we copy what most window managers do and only allow moving the window by grabbing its title bar.

The height of the title bar is defined by the height of the verticalSpacer_upTreeView widget (currently 25 pixels).

Closes #494

Bug:

https://user-images.githubusercontent.com/626206/220690891-613bed70-9adf-49ed-b9c8-a5b9bb530232.mp4


3 - Don't filter out mouse click events

This filtering was added to ensure we could only drag the window by grabbing anywhere above the search widget (ui->searchEdit).

However, due to changes introduced by ef4bb7f08ea84fbb6213e9fdea4fc053c58bbb23, now the search widget can start hidden (by hiding the notes panel and quitting the app).

This scenario is now handled directly in MainWindow::mousePressEvent and MainWindow::mouseDoubleClickEvent, so we can remove this entirely.

Fixes #508

nuttyartist commented 1 year ago

Looks good 👍

While in frameless mode, if the window is either maximized or in full screen, we probably shouldn't allow the user to resize it.

👍

guihkx commented 1 year ago

Sorry guys, I've made a couple of additional changes, mainly to help fix #508. So it'd be great to have your approval on this new code again.

Thanks!