diff --git a/LunaTranslator/LunaTranslator/gui/settingpage_xianshishezhi.py b/LunaTranslator/LunaTranslator/gui/settingpage_xianshishezhi.py index d13debfe..398781bd 100644 --- a/LunaTranslator/LunaTranslator/gui/settingpage_xianshishezhi.py +++ b/LunaTranslator/LunaTranslator/gui/settingpage_xianshishezhi.py @@ -245,7 +245,20 @@ def setTabThree_lazy(self): functools.partial(changeHorizontal, self) ) self.horizontal_slider_label = QLabel() - self.horizontal_slider_label.setText("{}%".format(globalconfig["transparent"])) + self.horizontal_slider_label.setText("{}%".format(globalconfig["transparent_tool"])) + self.horizontal_slider_tool = QSlider() + self.horizontal_slider_tool.setMaximum(100) + self.horizontal_slider_tool.setMinimum(1) + self.horizontal_slider_tool.setOrientation(Qt.Horizontal) + self.horizontal_slider_tool.setValue(0) + self.horizontal_slider_tool.setValue(globalconfig["transparent_tool"]) + self.horizontal_slider_tool.valueChanged.connect( + functools.partial(changeHorizontal_tool, self) + ) + self.horizontal_slider_tool_label = QLabel() + self.horizontal_slider_tool_label.setText( + "{}%".format(globalconfig["transparent_tool"]) + ) self.font_comboBox = QFontComboBox() self.font_comboBox.activated[str].connect( lambda x: globalconfig.__setitem__("fonttype", x) @@ -453,12 +466,17 @@ def setTabThree_lazy(self): ), ], [ - ("不透明度", 4), + ("不透明度_翻译窗口", 4), (self.horizontal_slider, 8), (self.horizontal_slider_label, 2), ], [ - ("翻译窗口背景颜色", 4), + ("不透明度_工具栏", 4), + (self.horizontal_slider_tool, 8), + (self.horizontal_slider_tool_label, 2), + ], + [ + ("背景颜色_翻译窗口", 4), getcolorbutton( globalconfig, "backcolor", @@ -473,6 +491,23 @@ def setTabThree_lazy(self): parent=self, ), "", + "", + ("背景颜色_工具栏", 4), + getcolorbutton( + globalconfig, + "backcolor_tool", + callback=lambda: selectcolor( + self, + globalconfig, + "backcolor_tool", + self.back_color_button_tool, + callback=gobject.baseobject.translation_ui.set_color_transparency, + ), + name="back_color_button_tool", + parent=self, + ), + ], + [ ("工具按钮颜色", 4), getcolorbutton( globalconfig, @@ -488,6 +523,7 @@ def setTabThree_lazy(self): parent=self, ), "", + "", ("工具按钮大小", 4), ( getspinbox( @@ -943,3 +979,13 @@ def changeHorizontal(self): self.horizontal_slider_label.setText("{}%".format(globalconfig["transparent"])) # gobject.baseobject.translation_ui.set_color_transparency() + + +def changeHorizontal_tool(self): + + globalconfig["transparent_tool"] = self.horizontal_slider_tool.value() + self.horizontal_slider_tool_label.setText( + "{}%".format(globalconfig["transparent_tool"]) + ) + # + gobject.baseobject.translation_ui.set_color_transparency() diff --git a/LunaTranslator/LunaTranslator/gui/translatorUI.py b/LunaTranslator/LunaTranslator/gui/translatorUI.py index 2f772716..b43e885e 100644 --- a/LunaTranslator/LunaTranslator/gui/translatorUI.py +++ b/LunaTranslator/LunaTranslator/gui/translatorUI.py @@ -704,10 +704,10 @@ class QUnFrameWindow(resizableframeless): "border-width: 0;%s;background-color: rgba(%s, %s, %s, %s)" % ( bottomr, - int(globalconfig["backcolor"][1:3], 16), - int(globalconfig["backcolor"][3:5], 16), - int(globalconfig["backcolor"][5:7], 16), - globalconfig["transparent"] / 200, + int(globalconfig["backcolor_tool"][1:3], 16), + int(globalconfig["backcolor_tool"][3:5], 16), + int(globalconfig["backcolor_tool"][5:7], 16), + globalconfig["transparent_tool"] / 100, ) ) for _type in self.stylebuttons: diff --git a/LunaTranslator/files/defaultconfig/config.json b/LunaTranslator/files/defaultconfig/config.json index c0b3ea24..beb8a8ab 100644 --- a/LunaTranslator/files/defaultconfig/config.json +++ b/LunaTranslator/files/defaultconfig/config.json @@ -148,6 +148,7 @@ "autorun": true, "usewebview": 0, "transparent": 80, + "transparent_tool": 50, "fontsize": 17.0, "localeswitchmethod": 0, "hide_not_exists": false, @@ -166,6 +167,7 @@ "kanarate": 0.5, "rawtextcolor": "#000000", "backcolor": "#3f3f3f", + "backcolor_tool": "#3f3f3f", "isshowhira": false, "locktools": true, "showfanyisource": false, diff --git a/LunaTranslator/files/lang/ar.json b/LunaTranslator/files/lang/ar.json index f521c4d2..84998c83 100644 --- a/LunaTranslator/files/lang/ar.json +++ b/LunaTranslator/files/lang/ar.json @@ -281,7 +281,6 @@ "使用正则表达式替换": "استبدال مع التعابير العادية", "有道5": "هناك طرق", "阿里": "علي .", - "翻译窗口背景颜色": "ترجمة لون خلفية النافذة", "分词器": "فاصل", "東北きりたん": "شمال شرق الصين", "鷹の爪吉田": "مخلب النسر يوشيدا", @@ -799,5 +798,8 @@ "居右": "يعيش الحق", "截图保存格式": "حفظ الشكل", "交流群": "مجموعة ميلان", - "例句中加粗单词": "على سبيل المثال كلمة جريئة" + "例句中加粗单词": "على سبيل المثال كلمة جريئة", + "工具栏": "شريط الأدوات", + "背景颜色": "لون الخلفية", + "翻译窗口": "نافذة الترجمة" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/cht.json b/LunaTranslator/files/lang/cht.json index c90e4ed5..52d8b20b 100644 --- a/LunaTranslator/files/lang/cht.json +++ b/LunaTranslator/files/lang/cht.json @@ -97,7 +97,6 @@ "显示设置": "顯示設定", "不透明度": "不透明度", "原文颜色": "原文顏色", - "翻译窗口背景颜色": "翻譯視窗背景顏色", "工具按钮颜色": "工具按鈕顏色", "显示原文": "顯示原文", "显示分词结果": "顯示分詞結果", @@ -799,5 +798,8 @@ "居右": "居右", "截图保存格式": "截圖保存格式", "交流群": "交流群", - "例句中加粗单词": "例句中加粗單詞" + "例句中加粗单词": "例句中加粗單詞", + "工具栏": "工具列", + "背景颜色": "背景顏色", + "翻译窗口": "翻譯視窗" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/en.json b/LunaTranslator/files/lang/en.json index 6543ba2a..af656a05 100644 --- a/LunaTranslator/files/lang/en.json +++ b/LunaTranslator/files/lang/en.json @@ -156,7 +156,6 @@ "感動詞": "Moving words", "字数统计": "word count", "描边字体": "Stroke font", - "翻译窗口背景颜色": "Translation window background color", "特殊字体样式填充颜色": "Special Font Style Fill Color", "字体缩小(可长按)": "Reduce font size (long press is allowed)", "不透明度": "Opacity", @@ -799,5 +798,8 @@ "居右": "be at the right", "截图保存格式": "Screenshot Save Format", "交流群": "Communication groups", - "例句中加粗单词": "Bold words in the example sentence" + "例句中加粗单词": "Bold words in the example sentence", + "工具栏": "toolbar", + "背景颜色": "background color ", + "翻译窗口": "Translation Window" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/es.json b/LunaTranslator/files/lang/es.json index d66bc2b8..05842aa9 100644 --- a/LunaTranslator/files/lang/es.json +++ b/LunaTranslator/files/lang/es.json @@ -97,7 +97,6 @@ "显示设置": "Configuración de la pantalla", "不透明度": "Opacidad", "原文颜色": "Color del texto original", - "翻译窗口背景颜色": "Color de fondo de la ventana de traducción", "工具按钮颜色": "Color del botón de la herramienta", "显示原文": "Muestra el texto original", "显示分词结果": "Mostrar los resultados de la segmentación de palabras", @@ -799,5 +798,8 @@ "居右": "A la derecha", "截图保存格式": "Formato de Guardar captura de pantalla", "交流群": "Grupo de comunicación", - "例句中加粗单词": "Palabras en negrita en oraciones de ejemplo" + "例句中加粗单词": "Palabras en negrita en oraciones de ejemplo", + "工具栏": "Barra de herramientas", + "背景颜色": "Color de fondo", + "翻译窗口": "Ventana de traducción" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/fr.json b/LunaTranslator/files/lang/fr.json index f136646c..87309166 100644 --- a/LunaTranslator/files/lang/fr.json +++ b/LunaTranslator/files/lang/fr.json @@ -97,7 +97,6 @@ "显示设置": "Paramètres d 'affichage", "不透明度": "Opacité", "原文颜色": "Couleur originale", - "翻译窗口背景颜色": "Couleur de fond de la fenêtre de traduction", "工具按钮颜色": "Couleurs des boutons d'outils", "显示原文": "Afficher le texte original", "显示分词结果": "Afficher les résultats du participant", @@ -799,5 +798,8 @@ "居右": "Vivre à droite", "截图保存格式": "Format de sauvegarde des captures d'écran", "交流群": "Groupe d'échange", - "例句中加粗单词": "Mots épaissis dans une phrase d'exemple" + "例句中加粗单词": "Mots épaissis dans une phrase d'exemple", + "工具栏": "Barre d'outils", + "背景颜色": "Couleur de fond", + "翻译窗口": "Fenêtre de traduction" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/it.json b/LunaTranslator/files/lang/it.json index 8df9a6ad..7edc1797 100644 --- a/LunaTranslator/files/lang/it.json +++ b/LunaTranslator/files/lang/it.json @@ -97,7 +97,6 @@ "显示设置": "Impostazioni di visualizzazione", "不透明度": "Opacità", "原文颜色": "Colore originale", - "翻译窗口背景颜色": "Colore di sfondo della finestra di traduzione", "工具按钮颜色": "Colore pulsante strumento", "显示原文": "Mostra testo originale", "显示分词结果": "Mostra i risultati della segmentazione", @@ -799,5 +798,8 @@ "居右": "essere a destra", "截图保存格式": "Schermata Salva formato", "交流群": "Gruppi di comunicazione", - "例句中加粗单词": "Parole grasse nella frase di esempio" + "例句中加粗单词": "Parole grasse nella frase di esempio", + "工具栏": "barra degli strumenti", + "背景颜色": "colore di sfondo", + "翻译窗口": "Finestra di traduzione" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/ja.json b/LunaTranslator/files/lang/ja.json index 200848a9..4363d693 100644 --- a/LunaTranslator/files/lang/ja.json +++ b/LunaTranslator/files/lang/ja.json @@ -97,7 +97,6 @@ "显示设置": "表示設定", "不透明度": "不透明度ふとうめいど", "原文颜色": "テキストの色", - "翻译窗口背景颜色": "翻訳ウィンドウの背景色", "工具按钮颜色": "ツールボタンの色", "显示原文": "テキストを表示", "显示分词结果": "分詞結果の表示", @@ -799,5 +798,8 @@ "居右": "右に位置する", "截图保存格式": "スクリーンショット保存形式", "交流群": "こうりゅうぐん", - "例句中加粗单词": "例文中の太字単語" + "例句中加粗单词": "例文中の太字単語", + "工具栏": "ツールバー", + "背景颜色": "背景色", + "翻译窗口": "翻訳ウィンドウ" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/ko.json b/LunaTranslator/files/lang/ko.json index d4aae973..8632841a 100644 --- a/LunaTranslator/files/lang/ko.json +++ b/LunaTranslator/files/lang/ko.json @@ -97,7 +97,6 @@ "显示设置": "디스플레이 설정", "不透明度": "불투명도", "原文颜色": "원문 색", - "翻译窗口背景颜色": "번역 창 배경색", "工具按钮颜色": "도구 버튼 색상", "显示原文": "원문 표시", "显示分词结果": "분사 결과 표시", @@ -799,5 +798,8 @@ "居右": "오른쪽", "截图保存格式": "캡처 저장 형식", "交流群": "교류군", - "例句中加粗单词": "예문에 단어를 굵게 넣다" + "例句中加粗单词": "예문에 단어를 굵게 넣다", + "工具栏": "도구 모음", + "背景颜色": "배경색", + "翻译窗口": "번역 창" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/pl.json b/LunaTranslator/files/lang/pl.json index 141b4776..fa459d64 100644 --- a/LunaTranslator/files/lang/pl.json +++ b/LunaTranslator/files/lang/pl.json @@ -97,7 +97,6 @@ "显示设置": "Ustawienia wyświetlania", "不透明度": "Nieprzezroczystość", "原文颜色": "Kolor oryginalny", - "翻译窗口背景颜色": "Kolor tła okna tłumaczenia", "工具按钮颜色": "Kolor przycisku narzędzia", "显示原文": "Pokaż oryginalny tekst", "显示分词结果": "Pokaż wyniki segmentacji", @@ -799,5 +798,8 @@ "居右": "bądź po prawej stronie", "截图保存格式": "Zrzut ekranu Zapisz format", "交流群": "Grupy ds. komunikacji", - "例句中加粗单词": "Pogrubione słowa w zdaniu przykładowym" + "例句中加粗单词": "Pogrubione słowa w zdaniu przykładowym", + "工具栏": "pasek narzędzi", + "背景颜色": "Kolor tła", + "翻译窗口": "Okno tłumaczenia" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/ru.json b/LunaTranslator/files/lang/ru.json index e1bf5932..f16ecd7a 100644 --- a/LunaTranslator/files/lang/ru.json +++ b/LunaTranslator/files/lang/ru.json @@ -97,7 +97,6 @@ "显示设置": "Настройки дисплея", "不透明度": "Непрозрачность", "原文颜色": "Цвет оригинала", - "翻译窗口背景颜色": "Цвет окна перевода", "工具按钮颜色": "Цвет кнопки инструмента", "显示原文": "Показать оригинал", "显示分词结果": "Показывать дробные результаты", @@ -799,5 +798,8 @@ "居右": "справа от дома", "截图保存格式": "Формат сохранения снимков", "交流群": "Коммутаторная группа", - "例句中加粗单词": "Добавить слово в пример" + "例句中加粗单词": "Добавить слово в пример", + "工具栏": "Панель инструментов", + "背景颜色": "Цвет фона", + "翻译窗口": "Окно перевода" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/th.json b/LunaTranslator/files/lang/th.json index 7c72ad40..9419ff0a 100644 --- a/LunaTranslator/files/lang/th.json +++ b/LunaTranslator/files/lang/th.json @@ -561,7 +561,6 @@ "東北ずん子": "โทโฮคุ", "编辑专有名词": "แก้ไขคำนามที่เป็นกรรมสิทธิ์", "目标语言": "ภาษาเป้าหมาย", - "翻译窗口背景颜色": "สีพื้นหลังหน้าต่างแปล", "乌克兰语": "ยูเครน", "打开设置": "เปิดการตั้งค่า", "西里尔(CP1251)": "ไซริล (CP1251)", @@ -799,5 +798,8 @@ "居右": "จูขวา", "截图保存格式": "รูปแบบการบันทึกภาพหน้าจอ", "交流群": "กลุ่มสื่อสาร", - "例句中加粗单词": "คำหยาบในประโยคตัวอย่าง" + "例句中加粗单词": "คำหยาบในประโยคตัวอย่าง", + "工具栏": "แถบเครื่องมือ", + "背景颜色": "สีพื้นหลัง", + "翻译窗口": "หน้าต่างการแปล" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/tr.json b/LunaTranslator/files/lang/tr.json index db1d5350..f898d92a 100644 --- a/LunaTranslator/files/lang/tr.json +++ b/LunaTranslator/files/lang/tr.json @@ -97,7 +97,6 @@ "显示设置": "Gösterim ayarları", "不透明度": "Opacity", "原文颜色": "Orijinal renk", - "翻译窗口背景颜色": "Çeviri penceresinin arkaplan rengi", "工具按钮颜色": "Araç düğmesi rengi", "显示原文": "Orijinal metni göster", "显示分词结果": "Bölümleme sonuçlarını göster", @@ -799,5 +798,8 @@ "居右": "Sağda ol.", "截图保存格式": "Ekran Görüntüsü Kaydet Format", "交流群": "İletişim grupları", - "例句中加粗单词": "Örneğin cümlelerinde kalın kelimeler" + "例句中加粗单词": "Örneğin cümlelerinde kalın kelimeler", + "工具栏": "araç çubuğu", + "背景颜色": "Arkaplan rengi", + "翻译窗口": "Çeviri Penceresi" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/uk.json b/LunaTranslator/files/lang/uk.json index aea00dc0..a9fdbb45 100644 --- a/LunaTranslator/files/lang/uk.json +++ b/LunaTranslator/files/lang/uk.json @@ -97,7 +97,6 @@ "显示设置": "Параметри показу", "不透明度": "Непрозорість", "原文颜色": "Початковий колір", - "翻译窗口背景颜色": "Колір тла вікна перекладу", "工具按钮颜色": "Колір кнопок інструментів", "显示原文": "Показати початковий текст", "显示分词结果": "Показати результати сегментації", @@ -799,5 +798,8 @@ "居右": "бути праворуч", "截图保存格式": "Формат збереження знімка екрана", "交流群": "Групи комунікації", - "例句中加粗单词": "Жирі слова у прикладному реченні" + "例句中加粗单词": "Жирі слова у прикладному реченні", + "工具栏": "панель інструментів", + "背景颜色": "колір тла", + "翻译窗口": "Вікно перекладу" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/vi.json b/LunaTranslator/files/lang/vi.json index 70161985..673da035 100644 --- a/LunaTranslator/files/lang/vi.json +++ b/LunaTranslator/files/lang/vi.json @@ -97,7 +97,6 @@ "显示设置": "Thiết lập hiển thị", "不透明度": "Độ mờ", "原文颜色": "Màu gốc", - "翻译窗口背景颜色": "Màu nền cửa sổ dịch", "工具按钮颜色": "Màu nút công cụ", "显示原文": "Hiển thị văn bản gốc", "显示分词结果": "Hiển thị kết quả phân từ", @@ -799,5 +798,8 @@ "居右": "Bên phải", "截图保存格式": "Định dạng lưu ảnh chụp màn hình", "交流群": "Nhóm trao đổi", - "例句中加粗单词": "Từ in đậm trong câu ví dụ" + "例句中加粗单词": "Từ in đậm trong câu ví dụ", + "工具栏": "Thanh công cụ", + "背景颜色": "Màu nền", + "翻译窗口": "Cửa sổ dịch" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/zh.json b/LunaTranslator/files/lang/zh.json index 9760e354..dd4c9be1 100644 --- a/LunaTranslator/files/lang/zh.json +++ b/LunaTranslator/files/lang/zh.json @@ -556,7 +556,6 @@ "東北ずん子": "", "编辑专有名词": "", "目标语言": "", - "翻译窗口背景颜色": "", "乌克兰语": "", "打开设置": "", "西里尔(CP1251)": "", @@ -799,5 +798,8 @@ "居右": "", "截图保存格式": "", "交流群": "", - "例句中加粗单词": "" + "例句中加粗单词": "", + "工具栏": "", + "背景颜色": "", + "翻译窗口": "" } \ No newline at end of file