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.4k stars 325 forks source link

perf: do not hide model button when loading #516

Closed tisfeng closed 2 months ago

tisfeng commented 2 months ago

https://github.com/tisfeng/Easydict/assets/25194972/9d09e48d-c5da-4c73-babd-c7aed26eafa0

phlpsong commented 2 months ago

Looks good, but I found some layout problems need to take a look:

  1. Model text switched to some other model name when pointer hover on it

https://github.com/tisfeng/Easydict/assets/103433299/b1bb18cc-4628-482a-8516-0a1982102ecb

  1. The warning image has an overlap issue with the model selection button

    Screenshot 2024-04-18 at 23 01 46
  2. The loading icon is out of the bounds of the area and overlaps with the arrow image, it could be more obvious if service name is longer

https://github.com/tisfeng/Easydict/assets/103433299/e0d24ff0-f8c8-40a0-be05-0b877f6f4967

tisfeng commented 2 months ago

All the issues have been resolved.

I increased the minimum width of the window a bit, limited the length of custom OpenAI names, and also limited the maximum length of the service name label and model button.

image
tisfeng commented 2 months ago

Show service name label and model button width based on window width ratio, if window has enough width, they can be shown fully.

image
phlpsong commented 2 months ago

https://github.com/tisfeng/Easydict/assets/103433299/c5d9b56d-5587-493e-85c8-f9124b1cc581

This issue still exists if you press the modal name instead of hovering over it.

tisfeng commented 2 months ago

ok, fixed.

EZButton is a control I wrote casually at that time. This is my first time writing a macOS application, and many codes were not very good 😥

Although the code is bad, there is no need to optimize it. Let's rewrite it with SwiftUI later.