Commit 40f8bcb3 authored by dmMaze's avatar dmMaze
Browse files

allow select modules in bottom bar, fix alignment issue for ysgdetector

parent be8480ef
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -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%);
}
@@ -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;
+5 −0
Original line number Diff line number Diff line
@@ -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)
+10 −0
Original line number Diff line number Diff line
@@ -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)
+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
+4 −0
Original line number Diff line number Diff line
@@ -105,6 +105,10 @@ class ClickableLabel(QLabel):
        return super().mousePressEvent(e)
    

class ConfigClickableLabel(ClickableLabel):
    pass

    
class CheckableLabel(QLabel):

    checkStateChanged = Signal(bool)
Loading