Loading ballontranslator/data/config/stylesheet.css +10 −0 Original line number Diff line number Diff line Loading @@ -893,4 +893,14 @@ TitleBarToolBtn::menu-indicator width:0px; } QProgressBar { border: 0px; text-align: center; max-height: 3px; background-color: @borderColor; } QProgressBar::chunk { background-color: rgb(30, 147, 229); } ballontranslator/data/config/themes.json +1 −1 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ "@qwidgetBackgroundColor": "#282c34", "@widgetBackgroundColor": "#282c34", "@emptyContentBackgroundColor": "#21252b", "@titleBarColor": "#8e99b1", "@titleBarColor": "#8c97af", "@pushBtnBackgroundColor": "#21252b", "@noboderPushBtnBackgroundColor": "#191d24", "@transtexteditBackgroundColor": "#191d24", Loading ballontranslator/ui/dl_manager.py +2 −4 Original line number Diff line number Diff line Loading @@ -398,16 +398,14 @@ class DLManager(QObject): self.dl_config = config.dl self.imgtrans_proj = imgtrans_proj def setupThread(self, config_panel: ConfigPanel): def setupThread(self, config_panel: ConfigPanel, imgtrans_progress_msgbox: ImgtransProgressMessageBox): dl_config = self.dl_config self.textdetect_thread = TextDetectThread(dl_config) self.textdetect_thread.finish_set_module.connect(self.on_finish_setdetector) # self.textdetect_thread.finish_detect_page.connect(self.on_finish_detect_page) self.textdetect_thread.exception_occurred.connect(self.handleRunTimeException) self.ocr_thread = OCRThread(dl_config) self.ocr_thread.finish_set_module.connect(self.on_finish_setocr) # self.ocr_thread.finish_ocr_page.connect(self.on_finish_ocr_page) self.ocr_thread.exception_occurred.connect(self.handleRunTimeException) self.translate_thread = TranslateThread(dl_config) Loading @@ -421,7 +419,7 @@ class DLManager(QObject): self.inpaint_thread.finish_inpaint.connect(self.on_finish_inpaint) self.inpaint_thread.exception_occurred.connect(self.handleRunTimeException) self.progress_msgbox = ImgtransProgressMessageBox() self.progress_msgbox = imgtrans_progress_msgbox self.imgtrans_thread = ImgtransThread(dl_config, self.textdetect_thread, self.ocr_thread, self.translate_thread, self.inpaint_thread) self.imgtrans_thread.update_detect_progress.connect(self.on_update_detect_progress) Loading ballontranslator/ui/mainwindow.py +8 −5 Original line number Diff line number Diff line Loading @@ -21,9 +21,9 @@ from .drawingpanel import DrawingPanel from .scenetext_manager import SceneTextManager from .mainwindowbars import TitleBar, LeftBar, BottomBar from .io_thread import ImgSaveThread, ImportDocThread, ExportDocThread from .stylewidgets import FrameLessMessageBox from .stylewidgets import FrameLessMessageBox, ImgtransProgressMessageBox from .preset_widget import PresetPanel from .constants import STYLESHEET_PATH, CONFIG_PATH from .constants import CONFIG_PATH from .global_search_widget import GlobalSearchWidget from . import constants as C from .textedit_commands import GlobalRepalceAllCommand Loading Loading @@ -64,7 +64,9 @@ class MainWindow(FramelessWindow): def setStyleSheet(self, styleSheet: str) -> None: # self.textPanel.formatpanel.familybox.setStyleSheet(styleSheet) self.imgtrans_progress_msgbox.setStyleSheet(styleSheet) self.export_doc_thread.progress_bar.setStyleSheet(styleSheet) self.import_doc_thread.progress_bar.setStyleSheet(styleSheet) return super().setStyleSheet(styleSheet) def setupThread(self): Loading @@ -83,7 +85,6 @@ class MainWindow(FramelessWindow): self.setMinimumWidth(screen_size.width() // 2) self.configPanel = ConfigPanel(self) self.config = self.configPanel.config self.resetStyleSheet() self.leftBar = LeftBar(self) self.leftBar.showPageListLabel.clicked.connect(self.pageLabelStateChanged) Loading Loading @@ -179,6 +180,8 @@ class MainWindow(FramelessWindow): self.mainvlayout = mainVBoxLayout self.comicTransSplitter.setStretchFactor(1, 10) self.imgtrans_progress_msgbox = ImgtransProgressMessageBox() self.resetStyleSheet() def setupConfig(self): Loading @@ -202,7 +205,7 @@ class MainWindow(FramelessWindow): dl_manager.finish_translate_page.connect(self.finishTranslatePage) dl_manager.imgtrans_pipeline_finished.connect(self.on_imgtrans_pipeline_finished) dl_manager.page_trans_finished.connect(self.on_pagtrans_finished) self.dl_manager.setupThread(self.configPanel) self.dl_manager.setupThread(self.configPanel, self.imgtrans_progress_msgbox) dl_manager.progress_msgbox.showed.connect(self.on_imgtrans_progressbox_showed) dl_manager.imgtrans_thread.mask_postprocess = self.drawingPanel.rectPanel.post_process_mask Loading ballontranslator/ui/stylewidgets.py +0 −22 Original line number Diff line number Diff line Loading @@ -100,28 +100,6 @@ class ProgressMessageBox(QDialog): self.task_progress_bar = TaskProgressBar(task_name) layout.addWidget(self.task_progress_bar) self.setStyleSheet(""" QWidget { font-size: 13pt; /* border-style: none; */ color: #5d5d5f; background-color: #ebeef5; } Widget { background-color: #ebeef5; } QProgressBar { border: 0px; text-align: center; max-height: 3px; background-color: #e1e4eb; } QProgressBar::chunk { background-color: rgb(30, 147, 229); } """) def updateTaskProgress(self, value: int, msg: str = ''): if self.task_progress_bar is not None: self.task_progress_bar.updateProgress(value, msg) Loading Loading
ballontranslator/data/config/stylesheet.css +10 −0 Original line number Diff line number Diff line Loading @@ -893,4 +893,14 @@ TitleBarToolBtn::menu-indicator width:0px; } QProgressBar { border: 0px; text-align: center; max-height: 3px; background-color: @borderColor; } QProgressBar::chunk { background-color: rgb(30, 147, 229); }
ballontranslator/data/config/themes.json +1 −1 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ "@qwidgetBackgroundColor": "#282c34", "@widgetBackgroundColor": "#282c34", "@emptyContentBackgroundColor": "#21252b", "@titleBarColor": "#8e99b1", "@titleBarColor": "#8c97af", "@pushBtnBackgroundColor": "#21252b", "@noboderPushBtnBackgroundColor": "#191d24", "@transtexteditBackgroundColor": "#191d24", Loading
ballontranslator/ui/dl_manager.py +2 −4 Original line number Diff line number Diff line Loading @@ -398,16 +398,14 @@ class DLManager(QObject): self.dl_config = config.dl self.imgtrans_proj = imgtrans_proj def setupThread(self, config_panel: ConfigPanel): def setupThread(self, config_panel: ConfigPanel, imgtrans_progress_msgbox: ImgtransProgressMessageBox): dl_config = self.dl_config self.textdetect_thread = TextDetectThread(dl_config) self.textdetect_thread.finish_set_module.connect(self.on_finish_setdetector) # self.textdetect_thread.finish_detect_page.connect(self.on_finish_detect_page) self.textdetect_thread.exception_occurred.connect(self.handleRunTimeException) self.ocr_thread = OCRThread(dl_config) self.ocr_thread.finish_set_module.connect(self.on_finish_setocr) # self.ocr_thread.finish_ocr_page.connect(self.on_finish_ocr_page) self.ocr_thread.exception_occurred.connect(self.handleRunTimeException) self.translate_thread = TranslateThread(dl_config) Loading @@ -421,7 +419,7 @@ class DLManager(QObject): self.inpaint_thread.finish_inpaint.connect(self.on_finish_inpaint) self.inpaint_thread.exception_occurred.connect(self.handleRunTimeException) self.progress_msgbox = ImgtransProgressMessageBox() self.progress_msgbox = imgtrans_progress_msgbox self.imgtrans_thread = ImgtransThread(dl_config, self.textdetect_thread, self.ocr_thread, self.translate_thread, self.inpaint_thread) self.imgtrans_thread.update_detect_progress.connect(self.on_update_detect_progress) Loading
ballontranslator/ui/mainwindow.py +8 −5 Original line number Diff line number Diff line Loading @@ -21,9 +21,9 @@ from .drawingpanel import DrawingPanel from .scenetext_manager import SceneTextManager from .mainwindowbars import TitleBar, LeftBar, BottomBar from .io_thread import ImgSaveThread, ImportDocThread, ExportDocThread from .stylewidgets import FrameLessMessageBox from .stylewidgets import FrameLessMessageBox, ImgtransProgressMessageBox from .preset_widget import PresetPanel from .constants import STYLESHEET_PATH, CONFIG_PATH from .constants import CONFIG_PATH from .global_search_widget import GlobalSearchWidget from . import constants as C from .textedit_commands import GlobalRepalceAllCommand Loading Loading @@ -64,7 +64,9 @@ class MainWindow(FramelessWindow): def setStyleSheet(self, styleSheet: str) -> None: # self.textPanel.formatpanel.familybox.setStyleSheet(styleSheet) self.imgtrans_progress_msgbox.setStyleSheet(styleSheet) self.export_doc_thread.progress_bar.setStyleSheet(styleSheet) self.import_doc_thread.progress_bar.setStyleSheet(styleSheet) return super().setStyleSheet(styleSheet) def setupThread(self): Loading @@ -83,7 +85,6 @@ class MainWindow(FramelessWindow): self.setMinimumWidth(screen_size.width() // 2) self.configPanel = ConfigPanel(self) self.config = self.configPanel.config self.resetStyleSheet() self.leftBar = LeftBar(self) self.leftBar.showPageListLabel.clicked.connect(self.pageLabelStateChanged) Loading Loading @@ -179,6 +180,8 @@ class MainWindow(FramelessWindow): self.mainvlayout = mainVBoxLayout self.comicTransSplitter.setStretchFactor(1, 10) self.imgtrans_progress_msgbox = ImgtransProgressMessageBox() self.resetStyleSheet() def setupConfig(self): Loading @@ -202,7 +205,7 @@ class MainWindow(FramelessWindow): dl_manager.finish_translate_page.connect(self.finishTranslatePage) dl_manager.imgtrans_pipeline_finished.connect(self.on_imgtrans_pipeline_finished) dl_manager.page_trans_finished.connect(self.on_pagtrans_finished) self.dl_manager.setupThread(self.configPanel) self.dl_manager.setupThread(self.configPanel, self.imgtrans_progress_msgbox) dl_manager.progress_msgbox.showed.connect(self.on_imgtrans_progressbox_showed) dl_manager.imgtrans_thread.mask_postprocess = self.drawingPanel.rectPanel.post_process_mask Loading
ballontranslator/ui/stylewidgets.py +0 −22 Original line number Diff line number Diff line Loading @@ -100,28 +100,6 @@ class ProgressMessageBox(QDialog): self.task_progress_bar = TaskProgressBar(task_name) layout.addWidget(self.task_progress_bar) self.setStyleSheet(""" QWidget { font-size: 13pt; /* border-style: none; */ color: #5d5d5f; background-color: #ebeef5; } Widget { background-color: #ebeef5; } QProgressBar { border: 0px; text-align: center; max-height: 3px; background-color: #e1e4eb; } QProgressBar::chunk { background-color: rgb(30, 147, 229); } """) def updateTaskProgress(self, value: int, msg: str = ''): if self.task_progress_bar is not None: self.task_progress_bar.updateProgress(value, msg) Loading