Commit d0c7f5e4 authored by dmMaze's avatar dmMaze
Browse files

fix widgets size in text advanced format panel

parent 960a0d40
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -1006,6 +1006,19 @@ TextStyleLabel {
    border-radius: 7px;
}

SmallParamLabel {
    font-size: 12px;
    height: 20px;
}

SmallComboBox {
    height: 20px;
    font-size: 12px;
    /* padding-left: 8px; */
    border: 1px solid @borderColor;
    background-color: @transtexteditBackgroundColor;
}

ArrowLeftButton {
    image: url(icons/arrow-left.svg);
    border: none;
+2 −2
Original line number Diff line number Diff line
from .scrollbar import ScrollBar
from .combobox import ComboBox, ConfigComboBox, ParamComboBox, SizeComboBox
from .combobox import ComboBox, ConfigComboBox, ParamComboBox, SizeComboBox, SmallComboBox
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, ColorPickerLabel, ClickableLabel, CheckableLabel, TextCheckerLabel
from .label import FadeLabel, ColorPickerLabel, ClickableLabel, CheckableLabel, TextCheckerLabel, ParamNameLabel, SmallParamLabel
from .slider import PaintQSlider
from .helper import isDarkTheme, themeColor
from .push_button import NoBorderPushBtn
+4 −0
Original line number Diff line number Diff line
@@ -27,6 +27,10 @@ class ComboBox(QComboBox):
            return self.scrollWidget.wheelEvent(*args, **kwargs)
        

class SmallComboBox(ComboBox):
    pass


class ConfigComboBox(ComboBox):

    def __init__(self, fix_size=True, scrollWidget: QWidget = None, *args, **kwargs) -> None:
+31 −0
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@ from qtpy.QtCore import Qt, QPropertyAnimation, QEasingCurve, Signal
from qtpy.QtGui import QMouseEvent, QWheelEvent, QColor


from utils.shared import CONFIG_FONTSIZE_CONTENT

class FadeLabel(QLabel):
    def __init__(self, *args, **kwargs):
@@ -141,3 +142,33 @@ class TextCheckerLabel(QLabel):
            self.checkStateChanged.emit(self.checked)


class ParamNameLabel(QLabel):
    def __init__(self, param_name: str, alignment = None, *args, **kwargs) -> None:
        super().__init__(*args, **kwargs)

        if alignment is None:
            self.setAlignment(Qt.AlignmentFlag.AlignLeft | Qt.AlignmentFlag.AlignVCenter)
        else:
            self.setAlignment(alignment)

        font = self.font()
        font.setPointSizeF(CONFIG_FONTSIZE_CONTENT-2)
        self.setFont(font)
        self.setText(param_name)
        self.setAttribute(Qt.WidgetAttribute.WA_TranslucentBackground, True)


class SmallParamLabel(QLabel):
    def __init__(self, param_name: str, alignment = None, *args, **kwargs) -> None:
        super().__init__(*args, **kwargs)

        if alignment is None:
            self.setAlignment(Qt.AlignmentFlag.AlignLeft | Qt.AlignmentFlag.AlignVCenter)
        else:
            self.setAlignment(alignment)

        # font = self.font()
        # font.setPointSizeF(CONFIG_FONTSIZE_CONTENT-2)
        # self.setFont(font)
        self.setText(param_name)
        self.setAttribute(Qt.WidgetAttribute.WA_TranslucentBackground, True)
 No newline at end of file
+1 −16
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@ from typing import List, Callable
from modules import GET_VALID_INPAINTERS, GET_VALID_TEXTDETECTORS, GET_VALID_TRANSLATORS, GET_VALID_OCR, \
    BaseTranslator, DEFAULT_DEVICE, GPUINTENSIVE_SET
from utils.logger import logger as LOGGER
from .custom_widget import ConfigComboBox, ParamComboBox, NoBorderPushBtn
from .custom_widget import ConfigComboBox, ParamComboBox, NoBorderPushBtn, ParamNameLabel
from utils.shared import CONFIG_FONTSIZE_CONTENT, CONFIG_COMBOBOX_MIDEAN, CONFIG_COMBOBOX_LONG, CONFIG_COMBOBOX_SHORT, CONFIG_COMBOBOX_HEIGHT
from utils.config import pcfg

@@ -12,21 +12,6 @@ from qtpy.QtCore import Qt, Signal
from qtpy.QtGui import QDoubleValidator


class ParamNameLabel(QLabel):
    def __init__(self, param_name: str, alignment = None, *args, **kwargs) -> None:
        super().__init__(*args, **kwargs)

        if alignment is None:
            self.setAlignment(Qt.AlignmentFlag.AlignLeft | Qt.AlignmentFlag.AlignVCenter)
        else:
            self.setAlignment(alignment)

        font = self.font()
        font.setPointSizeF(CONFIG_FONTSIZE_CONTENT-2)
        self.setFont(font)
        self.setText(param_name)
        self.setAttribute(Qt.WidgetAttribute.WA_TranslucentBackground, True)

class ParamLineEditor(QLineEdit):
    
    paramwidget_edited = Signal(str, str)
Loading