p0deje / Maccy

Lightweight clipboard manager for macOS
https://maccy.app
MIT License
13.11k stars 551 forks source link

Add option to position menu like spotlight #712

Closed weisJ closed 3 months ago

weisJ commented 10 months ago

Before Submitting Your Feature Request

Problem

I would like to have an option to position the menu such that its top edge aligns with the top edge default spotlight location. This would make it more predictable where the menu pops up.

Solution

This could just replace the center in window mode or be a separate setting.

I couldn't quite figure out how to add a new option in the corresponding settings combobox, so if the second option is preferable I would need some assistance in implementing this.

p0deje commented 10 months ago

I would like to have an option to position the menu such that its top edge aligns with the top edge default spotlight location. This would make it more predictable where the menu pops up.

Spotlight window is movable, so I am not sure I follow how this makes location more predictable. Can you elaborate a bit more?

weisJ commented 10 months ago

I don't intend to actually follow the spotlight position. Currently depending on the number of history items the menu is larger or taller. Because the entering modes center the whole menu window this causes the search bar to be at different positions, which feels a bit unintuitive e.g. if I have only 1 entry in the history the search bar will be close to the center of the screen while with e.g. 100 entries it will be at the top of the screen.

p0deje commented 10 months ago

Ok, I see what you mean now. This could be useful, and I wouldn't mind merging a PR.

However, right now I feel like we might need to get rid of the custom logic that adjusts menu height/position as it seems that macOS 14.3 finally fixed its issues around that and our logic is still error-prone in many cases (#29). I have a build where I removed all that custom logic and so far Maccy seems to position just fine by cursor and no longer jumping around as it used to.

Do you think we'd be able to implement this feature w/o the code for custom adjustment of menu height or enabled only for it?

p0deje commented 10 months ago

Actually, 14.3 still reports an incorrect menu height initially so the code would need remain. I will adapt it to only run when centering a menu in a screen/window.

p0deje commented 10 months ago

@weisJ Would you mind looking at https://github.com/p0deje/Maccy/commit/84422077275fc2f5e6f17b85c686e426af731e49 and see if you can spot any issues? This seems to work fine in my basic testing scenarios.