Loading ballontranslator/data/config/stylesheet.css +16 −1 Original line number Diff line number Diff line Loading @@ -788,13 +788,28 @@ QCheckBox#CaseSensitiveToggle::indicator { } QCheckBox#CaseSensitiveToggle::indicator:hover { background-color: rgba(30, 147, 229, 20%); background-color: rgba(127, 127, 127, 20%); } QCheckBox#CaseSensitiveToggle::indicator:checked { image: url(data/icons/case-sensitive_activated.svg); } QCheckBox#WholeWordToggle::indicator { height: 28px; width: 28px; padding-top: 3px; image: url(data/icons/whole-word.svg); } QCheckBox#WholeWordToggle::indicator:checked { image: url(data/icons/whole-word_activated.svg); } QCheckBox#WholeWordToggle::indicator:hover { background-color: rgba(127, 127, 127, 20%); } SearchEditor { height: 32px; } Loading ballontranslator/data/icons/whole-word.svg 0 → 100644 +3 −0 Original line number Diff line number Diff line <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path fill-rule="evenodd" clip-rule="evenodd" d="M1.00024 2H15.0002V3H1.00024V2ZM14.0002 4H13.0002V12H14.0002V4ZM11.2722 8.387C11.1942 8.088 11.0732 7.825 10.9122 7.601C10.7512 7.377 10.5472 7.2 10.3032 7.071C10.0592 6.942 9.76924 6.878 9.43724 6.878C9.23924 6.878 9.05724 6.902 8.89024 6.951C8.72524 7 8.57424 7.068 8.43724 7.156C8.30124 7.244 8.18024 7.35 8.07224 7.474L7.89324 7.732V4.578H7.00024V12H7.89324V11.425L8.01924 11.6C8.10624 11.702 8.20824 11.79 8.32324 11.869C8.44024 11.947 8.57224 12.009 8.72124 12.055C8.87024 12.101 9.03524 12.123 9.21924 12.123C9.57224 12.123 9.88524 12.052 10.1562 11.911C10.4282 11.768 10.6552 11.573 10.8382 11.325C11.0212 11.075 11.1592 10.782 11.2522 10.446C11.3452 10.108 11.3922 9.743 11.3922 9.349C11.3912 9.007 11.3522 8.686 11.2722 8.387ZM9.79324 7.78C9.94424 7.851 10.0752 7.956 10.1832 8.094C10.2922 8.234 10.3772 8.407 10.4382 8.611C10.4892 8.785 10.5202 8.982 10.5272 9.198L10.5202 9.323C10.5202 9.65 10.4872 9.943 10.4202 10.192C10.3532 10.438 10.2592 10.645 10.1422 10.806C10.0252 10.968 9.88224 11.091 9.72124 11.172C9.39924 11.334 8.96124 11.338 8.65224 11.187C8.49924 11.112 8.36624 11.012 8.25924 10.891C8.17424 10.795 8.10324 10.675 8.04124 10.524C8.04124 10.524 7.86224 10.077 7.86224 9.577C7.86224 9.077 8.04124 8.575 8.04124 8.575C8.10324 8.398 8.17724 8.257 8.26524 8.145C8.37924 8.002 8.52124 7.886 8.68924 7.8C8.85724 7.714 9.05424 7.671 9.27624 7.671C9.46624 7.671 9.64024 7.708 9.79324 7.78ZM15.0002 13H1.00024V14H15.0002V13ZM2.81324 10L2.08524 12.031H1.00024L1.02524 11.959L3.46624 4.87305H4.40724L6.89224 12.031H5.81024L5.03224 10H2.81324ZM3.93424 6.42205H3.91224L3.00724 9.17505H4.84824L3.93424 6.42205Z" fill="#b3b6bf"/> </svg> ballontranslator/data/icons/whole-word_activated.svg 0 → 100644 +3 −0 Original line number Diff line number Diff line <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path fill-rule="evenodd" clip-rule="evenodd" d="M1.00024 2H15.0002V3H1.00024V2ZM14.0002 4H13.0002V12H14.0002V4ZM11.2722 8.387C11.1942 8.088 11.0732 7.825 10.9122 7.601C10.7512 7.377 10.5472 7.2 10.3032 7.071C10.0592 6.942 9.76924 6.878 9.43724 6.878C9.23924 6.878 9.05724 6.902 8.89024 6.951C8.72524 7 8.57424 7.068 8.43724 7.156C8.30124 7.244 8.18024 7.35 8.07224 7.474L7.89324 7.732V4.578H7.00024V12H7.89324V11.425L8.01924 11.6C8.10624 11.702 8.20824 11.79 8.32324 11.869C8.44024 11.947 8.57224 12.009 8.72124 12.055C8.87024 12.101 9.03524 12.123 9.21924 12.123C9.57224 12.123 9.88524 12.052 10.1562 11.911C10.4282 11.768 10.6552 11.573 10.8382 11.325C11.0212 11.075 11.1592 10.782 11.2522 10.446C11.3452 10.108 11.3922 9.743 11.3922 9.349C11.3912 9.007 11.3522 8.686 11.2722 8.387ZM9.79324 7.78C9.94424 7.851 10.0752 7.956 10.1832 8.094C10.2922 8.234 10.3772 8.407 10.4382 8.611C10.4892 8.785 10.5202 8.982 10.5272 9.198L10.5202 9.323C10.5202 9.65 10.4872 9.943 10.4202 10.192C10.3532 10.438 10.2592 10.645 10.1422 10.806C10.0252 10.968 9.88224 11.091 9.72124 11.172C9.39924 11.334 8.96124 11.338 8.65224 11.187C8.49924 11.112 8.36624 11.012 8.25924 10.891C8.17424 10.795 8.10324 10.675 8.04124 10.524C8.04124 10.524 7.86224 10.077 7.86224 9.577C7.86224 9.077 8.04124 8.575 8.04124 8.575C8.10324 8.398 8.17724 8.257 8.26524 8.145C8.37924 8.002 8.52124 7.886 8.68924 7.8C8.85724 7.714 9.05424 7.671 9.27624 7.671C9.46624 7.671 9.64024 7.708 9.79324 7.78ZM15.0002 13H1.00024V14H15.0002V13ZM2.81324 10L2.08524 12.031H1.00024L1.02524 11.959L3.46624 4.87305H4.40724L6.89224 12.031H5.81024L5.03224 10H2.81324ZM3.93424 6.42205H3.91224L3.00724 9.17505H4.84824L3.93424 6.42205Z" fill="#424242"/> </svg> ballontranslator/ui/imgtranspanel.py +1 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ class SourceTextEdit(QTextEdit): def __init__(self, idx, parent, *args, **kwargs): super().__init__(parent, *args, **kwargs) self.idx = idx self.pre_editing = False self.setMinimumHeight(50) self.document().contentsChanged.connect(self.on_content_changed) self.document().documentLayout().documentSizeChanged.connect(self.adjustSize) Loading ballontranslator/ui/mainwindow.py +9 −6 Original line number Diff line number Diff line Loading @@ -221,6 +221,8 @@ class MainWindow(QMainWindow): self.presetPanel.initPresets(self.config.font_presets) self.canvas.search_widget.set_config(self.config) def setupImgTransUI(self): self.centralStackWidget.setCurrentIndex(0) if self.leftBar.showPageListLabel.isChecked(): Loading Loading @@ -427,8 +429,6 @@ class MainWindow(QMainWindow): def shortcutSearch(self): if self.canvas.gv.isVisible(): if self.canvas.search_widget.isHidden(): self.canvas.search_widget.show() fo = self.app.focusObject() sel_text = '' tgt_edit = None Loading @@ -441,12 +441,15 @@ class MainWindow(QMainWindow): if isinstance(fo, SourceTextEdit): tgt_edit = fo se = self.canvas.search_widget.search_editor se.setFocus() if sel_text != '': # se.setFocus() se.setPlainText(sel_text) cursor = se.textCursor() cursor.movePosition(QTextCursor.MoveOperation.End, QTextCursor.MoveMode.KeepAnchor) se.setTextCursor(cursor) # cursor = se.textCursor() # cursor.movePosition(QTextCursor.MoveOperation.End, QTextCursor.MoveMode.KeepAnchor) # se.setTextCursor(cursor) if self.canvas.search_widget.isHidden(): self.canvas.search_widget.show() self.canvas.search_widget.setCurrentEditor(tgt_edit) def shortcutGlobalSearch(self): Loading Loading
ballontranslator/data/config/stylesheet.css +16 −1 Original line number Diff line number Diff line Loading @@ -788,13 +788,28 @@ QCheckBox#CaseSensitiveToggle::indicator { } QCheckBox#CaseSensitiveToggle::indicator:hover { background-color: rgba(30, 147, 229, 20%); background-color: rgba(127, 127, 127, 20%); } QCheckBox#CaseSensitiveToggle::indicator:checked { image: url(data/icons/case-sensitive_activated.svg); } QCheckBox#WholeWordToggle::indicator { height: 28px; width: 28px; padding-top: 3px; image: url(data/icons/whole-word.svg); } QCheckBox#WholeWordToggle::indicator:checked { image: url(data/icons/whole-word_activated.svg); } QCheckBox#WholeWordToggle::indicator:hover { background-color: rgba(127, 127, 127, 20%); } SearchEditor { height: 32px; } Loading
ballontranslator/data/icons/whole-word.svg 0 → 100644 +3 −0 Original line number Diff line number Diff line <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path fill-rule="evenodd" clip-rule="evenodd" d="M1.00024 2H15.0002V3H1.00024V2ZM14.0002 4H13.0002V12H14.0002V4ZM11.2722 8.387C11.1942 8.088 11.0732 7.825 10.9122 7.601C10.7512 7.377 10.5472 7.2 10.3032 7.071C10.0592 6.942 9.76924 6.878 9.43724 6.878C9.23924 6.878 9.05724 6.902 8.89024 6.951C8.72524 7 8.57424 7.068 8.43724 7.156C8.30124 7.244 8.18024 7.35 8.07224 7.474L7.89324 7.732V4.578H7.00024V12H7.89324V11.425L8.01924 11.6C8.10624 11.702 8.20824 11.79 8.32324 11.869C8.44024 11.947 8.57224 12.009 8.72124 12.055C8.87024 12.101 9.03524 12.123 9.21924 12.123C9.57224 12.123 9.88524 12.052 10.1562 11.911C10.4282 11.768 10.6552 11.573 10.8382 11.325C11.0212 11.075 11.1592 10.782 11.2522 10.446C11.3452 10.108 11.3922 9.743 11.3922 9.349C11.3912 9.007 11.3522 8.686 11.2722 8.387ZM9.79324 7.78C9.94424 7.851 10.0752 7.956 10.1832 8.094C10.2922 8.234 10.3772 8.407 10.4382 8.611C10.4892 8.785 10.5202 8.982 10.5272 9.198L10.5202 9.323C10.5202 9.65 10.4872 9.943 10.4202 10.192C10.3532 10.438 10.2592 10.645 10.1422 10.806C10.0252 10.968 9.88224 11.091 9.72124 11.172C9.39924 11.334 8.96124 11.338 8.65224 11.187C8.49924 11.112 8.36624 11.012 8.25924 10.891C8.17424 10.795 8.10324 10.675 8.04124 10.524C8.04124 10.524 7.86224 10.077 7.86224 9.577C7.86224 9.077 8.04124 8.575 8.04124 8.575C8.10324 8.398 8.17724 8.257 8.26524 8.145C8.37924 8.002 8.52124 7.886 8.68924 7.8C8.85724 7.714 9.05424 7.671 9.27624 7.671C9.46624 7.671 9.64024 7.708 9.79324 7.78ZM15.0002 13H1.00024V14H15.0002V13ZM2.81324 10L2.08524 12.031H1.00024L1.02524 11.959L3.46624 4.87305H4.40724L6.89224 12.031H5.81024L5.03224 10H2.81324ZM3.93424 6.42205H3.91224L3.00724 9.17505H4.84824L3.93424 6.42205Z" fill="#b3b6bf"/> </svg>
ballontranslator/data/icons/whole-word_activated.svg 0 → 100644 +3 −0 Original line number Diff line number Diff line <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path fill-rule="evenodd" clip-rule="evenodd" d="M1.00024 2H15.0002V3H1.00024V2ZM14.0002 4H13.0002V12H14.0002V4ZM11.2722 8.387C11.1942 8.088 11.0732 7.825 10.9122 7.601C10.7512 7.377 10.5472 7.2 10.3032 7.071C10.0592 6.942 9.76924 6.878 9.43724 6.878C9.23924 6.878 9.05724 6.902 8.89024 6.951C8.72524 7 8.57424 7.068 8.43724 7.156C8.30124 7.244 8.18024 7.35 8.07224 7.474L7.89324 7.732V4.578H7.00024V12H7.89324V11.425L8.01924 11.6C8.10624 11.702 8.20824 11.79 8.32324 11.869C8.44024 11.947 8.57224 12.009 8.72124 12.055C8.87024 12.101 9.03524 12.123 9.21924 12.123C9.57224 12.123 9.88524 12.052 10.1562 11.911C10.4282 11.768 10.6552 11.573 10.8382 11.325C11.0212 11.075 11.1592 10.782 11.2522 10.446C11.3452 10.108 11.3922 9.743 11.3922 9.349C11.3912 9.007 11.3522 8.686 11.2722 8.387ZM9.79324 7.78C9.94424 7.851 10.0752 7.956 10.1832 8.094C10.2922 8.234 10.3772 8.407 10.4382 8.611C10.4892 8.785 10.5202 8.982 10.5272 9.198L10.5202 9.323C10.5202 9.65 10.4872 9.943 10.4202 10.192C10.3532 10.438 10.2592 10.645 10.1422 10.806C10.0252 10.968 9.88224 11.091 9.72124 11.172C9.39924 11.334 8.96124 11.338 8.65224 11.187C8.49924 11.112 8.36624 11.012 8.25924 10.891C8.17424 10.795 8.10324 10.675 8.04124 10.524C8.04124 10.524 7.86224 10.077 7.86224 9.577C7.86224 9.077 8.04124 8.575 8.04124 8.575C8.10324 8.398 8.17724 8.257 8.26524 8.145C8.37924 8.002 8.52124 7.886 8.68924 7.8C8.85724 7.714 9.05424 7.671 9.27624 7.671C9.46624 7.671 9.64024 7.708 9.79324 7.78ZM15.0002 13H1.00024V14H15.0002V13ZM2.81324 10L2.08524 12.031H1.00024L1.02524 11.959L3.46624 4.87305H4.40724L6.89224 12.031H5.81024L5.03224 10H2.81324ZM3.93424 6.42205H3.91224L3.00724 9.17505H4.84824L3.93424 6.42205Z" fill="#424242"/> </svg>
ballontranslator/ui/imgtranspanel.py +1 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ class SourceTextEdit(QTextEdit): def __init__(self, idx, parent, *args, **kwargs): super().__init__(parent, *args, **kwargs) self.idx = idx self.pre_editing = False self.setMinimumHeight(50) self.document().contentsChanged.connect(self.on_content_changed) self.document().documentLayout().documentSizeChanged.connect(self.adjustSize) Loading
ballontranslator/ui/mainwindow.py +9 −6 Original line number Diff line number Diff line Loading @@ -221,6 +221,8 @@ class MainWindow(QMainWindow): self.presetPanel.initPresets(self.config.font_presets) self.canvas.search_widget.set_config(self.config) def setupImgTransUI(self): self.centralStackWidget.setCurrentIndex(0) if self.leftBar.showPageListLabel.isChecked(): Loading Loading @@ -427,8 +429,6 @@ class MainWindow(QMainWindow): def shortcutSearch(self): if self.canvas.gv.isVisible(): if self.canvas.search_widget.isHidden(): self.canvas.search_widget.show() fo = self.app.focusObject() sel_text = '' tgt_edit = None Loading @@ -441,12 +441,15 @@ class MainWindow(QMainWindow): if isinstance(fo, SourceTextEdit): tgt_edit = fo se = self.canvas.search_widget.search_editor se.setFocus() if sel_text != '': # se.setFocus() se.setPlainText(sel_text) cursor = se.textCursor() cursor.movePosition(QTextCursor.MoveOperation.End, QTextCursor.MoveMode.KeepAnchor) se.setTextCursor(cursor) # cursor = se.textCursor() # cursor.movePosition(QTextCursor.MoveOperation.End, QTextCursor.MoveMode.KeepAnchor) # se.setTextCursor(cursor) if self.canvas.search_widget.isHidden(): self.canvas.search_widget.show() self.canvas.search_widget.setCurrentEditor(tgt_edit) def shortcutGlobalSearch(self): Loading