diff --git a/bauh/api/abstract/view.py b/bauh/api/abstract/view.py index 8a0263f3..25f976bb 100644 --- a/bauh/api/abstract/view.py +++ b/bauh/api/abstract/view.py @@ -129,9 +129,11 @@ class MultipleSelectComponent(InputViewComponent): class TextComponent(ViewComponent): - def __init__(self, html: str, max_width: int = -1, tooltip: str = None, id_: str = None, size: int = None): + def __init__(self, html: str, min_width: Optional[int] = None, max_width: int = -1, + tooltip: str = None, id_: str = None, size: int = None): super(TextComponent, self).__init__(id_=id_) self.value = html + self.min_width = min_width self.max_width = max_width self.tooltip = tooltip self.size = size diff --git a/bauh/view/qt/components.py b/bauh/view/qt/components.py index 6c0cec62..ba455867 100644 --- a/bauh/view/qt/components.py +++ b/bauh/view/qt/components.py @@ -760,6 +760,9 @@ class FormQt(QGroupBox): label_comp = QLabel() label.layout().addWidget(label_comp) + if hasattr(comp, 'min_width') and comp.min_width is not None and comp.min_width > 0: + label_comp.setMinimumWidth(comp.min_width) + if hasattr(comp, 'size') and comp.size is not None: label_comp.setStyleSheet("QLabel { font-size: " + str(comp.size) + "px }")