Loading config/stylesheet.css +16 −0 Original line number Diff line number Diff line Loading @@ -760,6 +760,14 @@ QLabel#angleLabel { background-color: rgba(30, 147, 229, 20%); } .ConfigClickableLabel { font-size: 12px; } .ConfigClickableLabel::hover { background-color: rgba(30, 147, 229, 20%); } .ExpandLabel::hover { background-color: rgba(30, 147, 229, 20%); } Loading Loading @@ -1049,6 +1057,14 @@ SmallComboBox { background-color: @transtexteditBackgroundColor; } SmallConfigPutton { height: 20px; width: 20px; border: none; border-width: 0px; background-color: rgba(0, 0, 0, 0); } SmallSizeComboBox { height: 20px; font-size: 12px; Loading modules/textdetector/detector_ysg.py +5 −0 Original line number Diff line number Diff line Loading @@ -169,6 +169,11 @@ class YSGYoloDetector(TextDetectorBase): blk = TextBlock(xyxy=xyxy, lines=np.array(lines), src_is_vertical=is_vertical) blk.font_size = font_sz blk._detected_font_size = font_sz if is_vertical: blk.alignment = 1 else: blk.recalulate_alignment() blk_list.append(blk) # cv2.imwrite('mask.jpg', mask) Loading ui/configpanel.py +10 −0 Original line number Diff line number Diff line Loading @@ -599,6 +599,16 @@ class ConfigPanel(Widget): self.configTable.setCurrentItem(idx0, idx1) self.configTable.tableitem_pressed.emit(idx0, idx1) def focusOnDetect(self): idx0, idx1 = self.detect_sub_block.idx0, self.detect_sub_block.idx1 self.configTable.setCurrentItem(idx0, idx1) self.configTable.tableitem_pressed.emit(idx0, idx1) def focusOnOCR(self): idx0, idx1 = self.ocr_sub_block.idx0, self.ocr_sub_block.idx1 self.configTable.setCurrentItem(idx0, idx1) self.configTable.tableitem_pressed.emit(idx0, idx1) def hideEvent(self, e) -> None: self.save_config.emit() return super().hideEvent(e) Loading ui/custom_widget/__init__.py +20 −2 Original line number Diff line number Diff line from qtpy.QtWidgets import QVBoxLayout, QHBoxLayout from .scrollbar import ScrollBar from .combobox import ComboBox, ConfigComboBox, ParamComboBox, SizeComboBox, SmallComboBox, SmallSizeComboBox from .widget import Widget, SeparatorWidget from .view_panel import PanelGroupBox, PanelArea, PanelAreaContent, ViewWidget, ExpandLabel from .message import MessageBox, TaskProgressBar, FrameLessMessageBox, ProgressMessageBox, ImgtransProgressMessageBox from .flow_layout import FlowLayout from .label import FadeLabel, SmallColorPickerLabel, ColorPickerLabel, ClickableLabel, CheckableLabel, TextCheckerLabel, ParamNameLabel, SmallParamLabel, SizeControlLabel, SmallSizeControlLabel from .label import FadeLabel, SmallColorPickerLabel, ColorPickerLabel, ConfigClickableLabel, ClickableLabel, CheckableLabel, TextCheckerLabel, ParamNameLabel, SmallParamLabel, SizeControlLabel, SmallSizeControlLabel from .slider import PaintQSlider from .helper import isDarkTheme, themeColor from .push_button import NoBorderPushBtn from .checkbox import QFontChecker, AlignmentChecker def combobox_with_label(param_name: str = None, size='small', options=None, parent=None, scrollWidget=None, label_alignment=None, vertical_layout=False, editable=False, label=False): combobox_cls = SmallComboBox if size == 'small' else ComboBox combobox = combobox_cls(options=options, parent=parent, scrollWidget=scrollWidget) combobox.setEditable(editable) if label is None: label_cls = SmallParamLabel if size == 'small' else ParamNameLabel label = label_cls(param_name=param_name, alignment=label_alignment) if vertical_layout: layout = QVBoxLayout() else: layout = QHBoxLayout() layout.addWidget(label) layout.addWidget(combobox) return combobox, label, layout No newline at end of file ui/custom_widget/label.py +4 −0 Original line number Diff line number Diff line Loading @@ -105,6 +105,10 @@ class ClickableLabel(QLabel): return super().mousePressEvent(e) class ConfigClickableLabel(ClickableLabel): pass class CheckableLabel(QLabel): checkStateChanged = Signal(bool) Loading Loading
config/stylesheet.css +16 −0 Original line number Diff line number Diff line Loading @@ -760,6 +760,14 @@ QLabel#angleLabel { background-color: rgba(30, 147, 229, 20%); } .ConfigClickableLabel { font-size: 12px; } .ConfigClickableLabel::hover { background-color: rgba(30, 147, 229, 20%); } .ExpandLabel::hover { background-color: rgba(30, 147, 229, 20%); } Loading Loading @@ -1049,6 +1057,14 @@ SmallComboBox { background-color: @transtexteditBackgroundColor; } SmallConfigPutton { height: 20px; width: 20px; border: none; border-width: 0px; background-color: rgba(0, 0, 0, 0); } SmallSizeComboBox { height: 20px; font-size: 12px; Loading
modules/textdetector/detector_ysg.py +5 −0 Original line number Diff line number Diff line Loading @@ -169,6 +169,11 @@ class YSGYoloDetector(TextDetectorBase): blk = TextBlock(xyxy=xyxy, lines=np.array(lines), src_is_vertical=is_vertical) blk.font_size = font_sz blk._detected_font_size = font_sz if is_vertical: blk.alignment = 1 else: blk.recalulate_alignment() blk_list.append(blk) # cv2.imwrite('mask.jpg', mask) Loading
ui/configpanel.py +10 −0 Original line number Diff line number Diff line Loading @@ -599,6 +599,16 @@ class ConfigPanel(Widget): self.configTable.setCurrentItem(idx0, idx1) self.configTable.tableitem_pressed.emit(idx0, idx1) def focusOnDetect(self): idx0, idx1 = self.detect_sub_block.idx0, self.detect_sub_block.idx1 self.configTable.setCurrentItem(idx0, idx1) self.configTable.tableitem_pressed.emit(idx0, idx1) def focusOnOCR(self): idx0, idx1 = self.ocr_sub_block.idx0, self.ocr_sub_block.idx1 self.configTable.setCurrentItem(idx0, idx1) self.configTable.tableitem_pressed.emit(idx0, idx1) def hideEvent(self, e) -> None: self.save_config.emit() return super().hideEvent(e) Loading
ui/custom_widget/__init__.py +20 −2 Original line number Diff line number Diff line from qtpy.QtWidgets import QVBoxLayout, QHBoxLayout from .scrollbar import ScrollBar from .combobox import ComboBox, ConfigComboBox, ParamComboBox, SizeComboBox, SmallComboBox, SmallSizeComboBox from .widget import Widget, SeparatorWidget from .view_panel import PanelGroupBox, PanelArea, PanelAreaContent, ViewWidget, ExpandLabel from .message import MessageBox, TaskProgressBar, FrameLessMessageBox, ProgressMessageBox, ImgtransProgressMessageBox from .flow_layout import FlowLayout from .label import FadeLabel, SmallColorPickerLabel, ColorPickerLabel, ClickableLabel, CheckableLabel, TextCheckerLabel, ParamNameLabel, SmallParamLabel, SizeControlLabel, SmallSizeControlLabel from .label import FadeLabel, SmallColorPickerLabel, ColorPickerLabel, ConfigClickableLabel, ClickableLabel, CheckableLabel, TextCheckerLabel, ParamNameLabel, SmallParamLabel, SizeControlLabel, SmallSizeControlLabel from .slider import PaintQSlider from .helper import isDarkTheme, themeColor from .push_button import NoBorderPushBtn from .checkbox import QFontChecker, AlignmentChecker def combobox_with_label(param_name: str = None, size='small', options=None, parent=None, scrollWidget=None, label_alignment=None, vertical_layout=False, editable=False, label=False): combobox_cls = SmallComboBox if size == 'small' else ComboBox combobox = combobox_cls(options=options, parent=parent, scrollWidget=scrollWidget) combobox.setEditable(editable) if label is None: label_cls = SmallParamLabel if size == 'small' else ParamNameLabel label = label_cls(param_name=param_name, alignment=label_alignment) if vertical_layout: layout = QVBoxLayout() else: layout = QHBoxLayout() layout.addWidget(label) layout.addWidget(combobox) return combobox, label, layout No newline at end of file
ui/custom_widget/label.py +4 −0 Original line number Diff line number Diff line Loading @@ -105,6 +105,10 @@ class ClickableLabel(QLabel): return super().mousePressEvent(e) class ConfigClickableLabel(ClickableLabel): pass class CheckableLabel(QLabel): checkStateChanged = Signal(bool) Loading