diff --git a/LunaTranslator/LunaTranslator/gui/rangeselect.py b/LunaTranslator/LunaTranslator/gui/rangeselect.py index 75e47b36..a2d8641b 100644 --- a/LunaTranslator/LunaTranslator/gui/rangeselect.py +++ b/LunaTranslator/LunaTranslator/gui/rangeselect.py @@ -75,8 +75,8 @@ class rangeadjust(Mainw): def setstyle(self): self.label.setStyleSheet( - " border:%spx solid %s; background-color: rgba(0,0,0, 0.01)" - % (globalconfig["ocrrangewidth"], globalconfig["ocrrangecolor"]) + " border:%spx solid %s; background-color: rgba(0,0,0, %s)" + % (globalconfig["ocrrangewidth"], globalconfig["ocrrangecolor"], 1 / 255) ) def mouseMoveEvent(self, e): @@ -165,7 +165,7 @@ class rangeselect(QMainWindow): ) self.rectlabel = QLabel(self) # self.setAttribute(Qt.WidgetAttribute.WA_TranslucentBackground) - self.setWindowOpacity(0.5) + # self.setWindowOpacity(0.5) self.setMouseTracking(True) self.setCursor(Qt.CursorShape.CrossCursor) self.reset() @@ -184,9 +184,12 @@ class rangeselect(QMainWindow): self.clickrelease = False self.rectlabel.resize(0, 0) self.rectlabel.setStyleSheet( - " border:%spx solid %s; background-color: rgba(0,0,0, 0.01)" + " border:%spx solid %s" % (globalconfig["ocrrangewidth"], globalconfig["ocrrangecolor"]) ) + self.setStyleSheet( + "background-color: rgba(255,255,255, %s)" % globalconfig["ocrselectalpha"] + ) def immediateend(self): try: diff --git a/LunaTranslator/LunaTranslator/gui/setting_textinput_ocr.py b/LunaTranslator/LunaTranslator/gui/setting_textinput_ocr.py index 718a2f25..2e20d166 100644 --- a/LunaTranslator/LunaTranslator/gui/setting_textinput_ocr.py +++ b/LunaTranslator/LunaTranslator/gui/setting_textinput_ocr.py @@ -538,6 +538,20 @@ def getocrgrid(self): "选取OCR范围后自动绑定窗口", D_getsimpleswitch(globalconfig, "ocrautobindhwnd"), ], + [ + "选取OCR范围时不透明度", + ( + D_getspinbox( + 0, + 1, + globalconfig, + "ocrselectalpha", + double=True, + step=0.01, + ), + 2, + ), + ], ], ), 0, diff --git a/LunaTranslator/files/defaultconfig/config.json b/LunaTranslator/files/defaultconfig/config.json index ee253198..6b064a52 100644 --- a/LunaTranslator/files/defaultconfig/config.json +++ b/LunaTranslator/files/defaultconfig/config.json @@ -17,6 +17,7 @@ "disappear_delay": 5, "network": 1, "useextrahtml": true, + "ocrselectalpha": 0.3, "network_websocket": 1, "webview_textbrowser": false, "imagewrapmode": 0, diff --git a/LunaTranslator/files/lang/ar.json b/LunaTranslator/files/lang/ar.json index cc69e23b..2394c372 100644 --- a/LunaTranslator/files/lang/ar.json +++ b/LunaTranslator/files/lang/ar.json @@ -851,5 +851,6 @@ "使用/跳过翻译": "استخدام / تخطي الترجمة", "prompt格式(需要根据模型版本决定)": "Prompt الشكل ( يجب أن تكون مصممة على أساس نموذج الإصدار )", "v0.10pre1(支持gpt词典)": "v0.10pre1 ( دعم GPT القاموس )", - "输出的内容": "المحتوى الناتج" + "输出的内容": "المحتوى الناتج", + "选取OCR范围时不透明度": "التعتيم عند اختيار مجموعة التعرف الضوئي على الحروف" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/cht.json b/LunaTranslator/files/lang/cht.json index fae2a14b..6fd526b3 100644 --- a/LunaTranslator/files/lang/cht.json +++ b/LunaTranslator/files/lang/cht.json @@ -851,5 +851,6 @@ "使用/跳过翻译": "使用/跳過翻譯", "prompt格式(需要根据模型版本决定)": "prompt 格式(需要根據模型版本決定)", "v0.10pre1(支持gpt词典)": "v0.10pre1(支援 gpt 詞典)", - "输出的内容": "輸出的內容" + "输出的内容": "輸出的內容", + "选取OCR范围时不透明度": "選取OCR範圍時不透明度" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/cs.json b/LunaTranslator/files/lang/cs.json index cca89ef5..80b01b11 100644 --- a/LunaTranslator/files/lang/cs.json +++ b/LunaTranslator/files/lang/cs.json @@ -851,5 +851,6 @@ "使用/跳过翻译": "Použít/přeskočit překlad", "prompt格式(需要根据模型版本决定)": "Formát výzvy (v závislosti na verzi modelu)", "v0.10pre1(支持gpt词典)": "V0.10 pre1 (podporuje GPT slovník)", - "输出的内容": "Výstupní obsah" + "输出的内容": "Výstupní obsah", + "选取OCR范围时不透明度": "Krytí při výběru rozsahu OCR" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/de.json b/LunaTranslator/files/lang/de.json index 998ed148..d45af154 100644 --- a/LunaTranslator/files/lang/de.json +++ b/LunaTranslator/files/lang/de.json @@ -851,5 +851,6 @@ "使用/跳过翻译": "Übersetzung verwenden/überspringen", "prompt格式(需要根据模型版本决定)": "Aufforderungsformat (abhängig von der Modellversion)", "v0.10pre1(支持gpt词典)": "V0.10 pre1 (unterstützt GPT Wörterbuch)", - "输出的内容": "Ausgabeinhalt" + "输出的内容": "Ausgabeinhalt", + "选取OCR范围时不透明度": "Deckkraft bei Auswahl des OCR-Bereichs" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/en.json b/LunaTranslator/files/lang/en.json index efa95308..0cf82831 100644 --- a/LunaTranslator/files/lang/en.json +++ b/LunaTranslator/files/lang/en.json @@ -851,5 +851,6 @@ "使用/跳过翻译": "Use/skip translation", "prompt格式(需要根据模型版本决定)": "Prompt format (depending on the model version)", "v0.10pre1(支持gpt词典)": "V0.10 pre1 (supports GPT dictionary)", - "输出的内容": "Output content" + "输出的内容": "Output content", + "选取OCR范围时不透明度": "Opacity when selecting OCR range" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/es.json b/LunaTranslator/files/lang/es.json index d3f072cd..ae9cb538 100644 --- a/LunaTranslator/files/lang/es.json +++ b/LunaTranslator/files/lang/es.json @@ -851,5 +851,6 @@ "使用/跳过翻译": "Usar / saltar la traducción", "prompt格式(需要根据模型版本决定)": "Formato prompt (debe decidirse en función de la versión del modelo)", "v0.10pre1(支持gpt词典)": "V0.10pre1 (admite diccionario gpt)", - "输出的内容": "Contenido exportado" + "输出的内容": "Contenido exportado", + "选取OCR范围时不透明度": "Opacidad al seleccionar el rango OCR" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/fr.json b/LunaTranslator/files/lang/fr.json index 351f9f1f..7dd940b7 100644 --- a/LunaTranslator/files/lang/fr.json +++ b/LunaTranslator/files/lang/fr.json @@ -851,5 +851,6 @@ "使用/跳过翻译": "Utiliser / sauter la traduction", "prompt格式(需要根据模型版本决定)": "Format prompt (à décider en fonction de la version du modèle)", "v0.10pre1(支持gpt词典)": "V0.10pre1 (support du dictionnaire GPT)", - "输出的内容": "Contenu de la sortie" + "输出的内容": "Contenu de la sortie", + "选取OCR范围时不透明度": "Opacité lorsque la plage OCR est sélectionnée" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/it.json b/LunaTranslator/files/lang/it.json index 8600b216..d1299718 100644 --- a/LunaTranslator/files/lang/it.json +++ b/LunaTranslator/files/lang/it.json @@ -851,5 +851,6 @@ "使用/跳过翻译": "Usa/salta traduzione", "prompt格式(需要根据模型版本决定)": "Formato di richiesta (a seconda della versione del modello)", "v0.10pre1(支持gpt词典)": "V0.10 pre1 (supporta il dizionario GPT)", - "输出的内容": "Contenuto di output" + "输出的内容": "Contenuto di output", + "选取OCR范围时不透明度": "Opacità durante la selezione dell'intervallo OCR" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/ja.json b/LunaTranslator/files/lang/ja.json index 8ac56c5d..48399b3b 100644 --- a/LunaTranslator/files/lang/ja.json +++ b/LunaTranslator/files/lang/ja.json @@ -851,5 +851,6 @@ "使用/跳过翻译": "翻訳の使用/スキップ", "prompt格式(需要根据模型版本决定)": "promptフォーマット(モデルバージョンに基づいて決定する必要がある)", "v0.10pre1(支持gpt词典)": "v 0.10 pre 1(gpt辞書対応)", - "输出的内容": "出力の内容" + "输出的内容": "出力の内容", + "选取OCR范围时不透明度": "OCR範囲選択時の不透明度" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/ko.json b/LunaTranslator/files/lang/ko.json index db45f25b..350d80fa 100644 --- a/LunaTranslator/files/lang/ko.json +++ b/LunaTranslator/files/lang/ko.json @@ -851,5 +851,6 @@ "使用/跳过翻译": "번역 사용 / 건너뛰기", "prompt格式(需要根据模型版本决定)": "prompt 형식 (모델 버전에 따라 결정)", "v0.10pre1(支持gpt词典)": "v0.10pre1(gpt 사전 지원)", - "输出的内容": "내보낸 내용" + "输出的内容": "내보낸 내용", + "选取OCR范围时不透明度": "OCR 범위 선택 시 불투명도" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/nl.json b/LunaTranslator/files/lang/nl.json index 20c7264b..328ac25e 100644 --- a/LunaTranslator/files/lang/nl.json +++ b/LunaTranslator/files/lang/nl.json @@ -851,5 +851,6 @@ "使用/跳过翻译": "Vertaling gebruiken/overslaan", "prompt格式(需要根据模型版本决定)": "Prompt formaat (afhankelijk van de modelversie)", "v0.10pre1(支持gpt词典)": "V0.10 pre1 (ondersteunt GPT woordenboek)", - "输出的内容": "Uitvoerinhoud" + "输出的内容": "Uitvoerinhoud", + "选取OCR范围时不透明度": "Opaciteit bij het selecteren van OCR-bereik" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/pl.json b/LunaTranslator/files/lang/pl.json index f549e718..3ecb2a20 100644 --- a/LunaTranslator/files/lang/pl.json +++ b/LunaTranslator/files/lang/pl.json @@ -851,5 +851,6 @@ "使用/跳过翻译": "Użyj/pominąć tłumaczenie", "prompt格式(需要根据模型版本决定)": "Format pytania (w zależności od wersji modelu)", "v0.10pre1(支持gpt词典)": "V0.10 pre1 (obsługuje słownik GPT)", - "输出的内容": "Zawartość wyjściowa" + "输出的内容": "Zawartość wyjściowa", + "选取OCR范围时不透明度": "Przezroczystość przy wyborze zakresu OCR" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/pt.json b/LunaTranslator/files/lang/pt.json index 61c15174..e16b84b2 100644 --- a/LunaTranslator/files/lang/pt.json +++ b/LunaTranslator/files/lang/pt.json @@ -851,5 +851,6 @@ "使用/跳过翻译": "Usar/ignorar a tradução", "prompt格式(需要根据模型版本决定)": "Formato do pedido (dependendo da versão do modelo)", "v0.10pre1(支持gpt词典)": "V0. 10 pre1 (suporta dicionário GPT)", - "输出的内容": "Conteúdo de saída" + "输出的内容": "Conteúdo de saída", + "选取OCR范围时不透明度": "Opacidade ao seleccionar o intervalo OCR" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/ru.json b/LunaTranslator/files/lang/ru.json index d8c7b8f5..a691ad5b 100644 --- a/LunaTranslator/files/lang/ru.json +++ b/LunaTranslator/files/lang/ru.json @@ -851,5 +851,6 @@ "使用/跳过翻译": "Использовать / пропустить перевод", "prompt格式(需要根据模型版本决定)": "Формат prompt (должен быть определен в соответствии с версией модели)", "v0.10pre1(支持gpt词典)": "v0.10pre1 (Поддержка словаря gpt)", - "输出的内容": "Экспорт содержимого" + "输出的内容": "Экспорт содержимого", + "选取OCR范围时不透明度": "Непрозрачность выбора диапазона OCR" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/sv.json b/LunaTranslator/files/lang/sv.json index c7f24cc5..3bdb3e08 100644 --- a/LunaTranslator/files/lang/sv.json +++ b/LunaTranslator/files/lang/sv.json @@ -851,5 +851,6 @@ "使用/跳过翻译": "Använd/hoppa över översättning", "prompt格式(需要根据模型版本决定)": "Frågaformat (beroende på modellversion)", "v0.10pre1(支持gpt词典)": "V0. 10 pre1 (stöder GPT ordbok)", - "输出的内容": "Utdatainnehåll" + "输出的内容": "Utdatainnehåll", + "选取OCR范围时不透明度": "Opacitet vid val av OCR-område" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/th.json b/LunaTranslator/files/lang/th.json index 0bf7bf93..4fd8a5cb 100644 --- a/LunaTranslator/files/lang/th.json +++ b/LunaTranslator/files/lang/th.json @@ -851,5 +851,6 @@ "使用/跳过翻译": "ใช้ / ข้ามการแปล", "prompt格式(需要根据模型版本决定)": "รูปแบบ prompt (ต้องตัดสินใจตามรุ่น)", "v0.10pre1(支持gpt词典)": "v0.10pre1 (สนับสนุนพจนานุกรม gpt)", - "输出的内容": "เนื้อหาที่ส่งออก" + "输出的内容": "เนื้อหาที่ส่งออก", + "选取OCR范围时不透明度": "ความทึบเมื่อเลือกช่วง OCR" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/tr.json b/LunaTranslator/files/lang/tr.json index 8888f76b..59a68264 100644 --- a/LunaTranslator/files/lang/tr.json +++ b/LunaTranslator/files/lang/tr.json @@ -851,5 +851,6 @@ "使用/跳过翻译": "Çeviri kullan/atla", "prompt格式(需要根据模型版本决定)": "Soru format ı (model versiyonuna bağlı)", "v0.10pre1(支持gpt词典)": "V0. 10 pre1 (GPT sözlük destekliyor)", - "输出的内容": "Çıkış içeriği" + "输出的内容": "Çıkış içeriği", + "选取OCR范围时不透明度": "OCR menzilini seçerken meşgullük" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/uk.json b/LunaTranslator/files/lang/uk.json index fc2075bf..5a3481cd 100644 --- a/LunaTranslator/files/lang/uk.json +++ b/LunaTranslator/files/lang/uk.json @@ -851,5 +851,6 @@ "使用/跳过翻译": "Використовувати/пропустити переклад", "prompt格式(需要根据模型版本决定)": "Формат запиту (залежно від версії моделі)", "v0.10pre1(支持gpt词典)": "V0. 10 pre1 (підтримує словник GPT)", - "输出的内容": "Вміст виводу" + "输出的内容": "Вміст виводу", + "选取OCR范围时不透明度": "Непрозорість під час вибору діапазону OCR" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/vi.json b/LunaTranslator/files/lang/vi.json index 9da56d15..e3fd9575 100644 --- a/LunaTranslator/files/lang/vi.json +++ b/LunaTranslator/files/lang/vi.json @@ -851,5 +851,6 @@ "使用/跳过翻译": "Sử dụng/bỏ qua bản dịch", "prompt格式(需要根据模型版本决定)": "Định dạng prompt (cần được quyết định dựa trên phiên bản model)", "v0.10pre1(支持gpt词典)": "v0.10pre1 (hỗ trợ từ điển gpt)", - "输出的内容": "Nội dung xuất" + "输出的内容": "Nội dung xuất", + "选取OCR范围时不透明度": "Độ mờ đục khi chọn phạm vi OCR" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/zh.json b/LunaTranslator/files/lang/zh.json index 06fdf17c..43446627 100644 --- a/LunaTranslator/files/lang/zh.json +++ b/LunaTranslator/files/lang/zh.json @@ -851,5 +851,6 @@ "使用/跳过翻译": "", "prompt格式(需要根据模型版本决定)": "", "v0.10pre1(支持gpt词典)": "", - "输出的内容": "" + "输出的内容": "", + "选取OCR范围时不透明度": "" } \ No newline at end of file diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index 79c0713c..3a6eb057 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -29,7 +29,7 @@ include(generate_product_version) set(VERSION_MAJOR 5) set(VERSION_MINOR 34) -set(VERSION_PATCH 5) +set(VERSION_PATCH 6) add_library(pch pch.cpp) target_precompile_headers(pch PUBLIC pch.h)