tisfeng / Easydict

一个简洁优雅的词典翻译 macOS App。开箱即用,支持离线 OCR 识别,支持有道词典,🍎 苹果系统词典,🍎 苹果系统翻译,OpenAI,Gemini,DeepL,Google,Bing,腾讯,百度,阿里,小牛,彩云和火山翻译。A concise and elegant Dictionary and Translator macOS App for looking up words and translating text.
GNU General Public License v3.0
6.45k stars 328 forks source link

Switch model in query window #457

Closed phlpsong closed 3 months ago

phlpsong commented 4 months ago

close https://github.com/tisfeng/Easydict/issues/456

tisfeng commented 3 months ago

Please review this PR.

phlpsong commented 3 months ago

Could you share some examples here? I'm not quite sure what you meant by the fixed position.

Jerry23011 commented 3 months ago

Certainly, the popups in settings have a fixed position no matter where I click on them. Please see recording below

https://github.com/tisfeng/Easydict/assets/89069957/06b75f98-cf8f-4839-9e5b-321616abcd9c

tisfeng commented 3 months ago

Yes, the NSMenu should be displayed in a fixed position, e.g. clicking on the bottom left corner of the view, which looks best.

image
tisfeng commented 3 months ago

I didn't look at the detailed reason why the atLocation coordinates would be drifting, it seems a little strange.

Also, I noticed that NSMenu is used in other places, such as EZSelectLanguageButton, we can write a Category for NSMenu, making it convenient to use to show NSMenu at the bottom left of a view.

phlpsong commented 3 months ago

Thanks, I got you. 👍

But personally, I think the Picker-like component is not suitable in this case, popup the menu from the left corner looks better.

Please try the latest changes and let me know what you think.

tisfeng commented 3 months ago

ok, we don't need to change the system Picker, just the NSMenu.