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.68k stars 338 forks source link

fix: multi screen window show #450

Open AkaShark opened 5 months ago

AkaShark commented 5 months ago

closed https://github.com/tisfeng/Easydict/issues/442

Add a picker in the general page to display the window as auto or fixed when translation finishes.

AkaShark commented 5 months ago

okay I will fix it later

AkaShark commented 5 months ago

I remove the picker from the settings page. When the user starts the query action I record the mouse-located screen and remove this record when the floating window closes.

tisfeng commented 5 months ago

This problem can be a bit complex, involving multiple screens of records and the handling of the location of the display query window.

If you're not good at solving it, I can take over later.

AkaShark commented 5 months ago

Oh, I now understand your issue. I didn't consider issue #442 earlier and only focused on the mouse move duration during query translation. To address this, I will record the screen when starting a query like this

- (void)startQueryText:(NSString *)text actionType:(EZActionType)actionType {
    // record current screen when start query
    NSScreen *current = [EZCoordinateUtils screenForPoint: [NSEvent mouseLocation]];
    EZCoordinateUtils.startQueryScreen = current;

Let me try it first. I'll ask for your help if I find it difficult for me.

AkaShark commented 5 months ago

@tisfeng My idea is to record the screen when a word is selected for translation and display a query window on this screen. For other modes of translation, the screen will still be recorded when the query is initiated. What do you think about it?

tisfeng commented 5 months ago

I'm not so sure, you can try it and then we'll test it.

AkaShark commented 5 months ago

I'm not so sure, you can try it and then we'll test it.

okk

tisfeng commented 2 months ago

@AkaShark When you have time, please continue pushing this PR.

AkaShark commented 2 months ago

@AkaShark When you have time, please continue pushing this PR.

okay, I will try to fix it in the last few days

AkaShark commented 1 month ago

I'm sorry I've been a little busy lately. I'll finish this issue as soon as possible.

tisfeng commented 1 month ago

ok, you can schedule as you see fit.