Loading config/stylesheet.css +13 −0 Original line number Diff line number Diff line Loading @@ -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; Loading ui/custom_widget/__init__.py +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 Loading ui/custom_widget/combobox.py +4 −0 Original line number Diff line number Diff line Loading @@ -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: Loading ui/custom_widget/label.py +31 −0 Original line number Diff line number Diff line Loading @@ -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): Loading Loading @@ -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 ui/module_parse_widgets.py +1 −16 Original line number Diff line number Diff line Loading @@ -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 Loading @@ -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 Loading
config/stylesheet.css +13 −0 Original line number Diff line number Diff line Loading @@ -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; Loading
ui/custom_widget/__init__.py +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 Loading
ui/custom_widget/combobox.py +4 −0 Original line number Diff line number Diff line Loading @@ -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: Loading
ui/custom_widget/label.py +31 −0 Original line number Diff line number Diff line Loading @@ -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): Loading Loading @@ -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
ui/module_parse_widgets.py +1 −16 Original line number Diff line number Diff line Loading @@ -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 Loading @@ -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