diff --git a/bauh/api/abstract/view.py b/bauh/api/abstract/view.py index 25f976bb..e851d332 100644 --- a/bauh/api/abstract/view.py +++ b/bauh/api/abstract/view.py @@ -104,7 +104,7 @@ class MultipleSelectComponent(InputViewComponent): def __init__(self, label: Optional[str], options: List[InputOption], default_options: Set[InputOption] = None, max_per_line: int = 1, tooltip: str = None, spaces: bool = True, max_width: int = -1, - max_height: int = -1, id_: str = None): + max_height: int = -1, id_: str = None, min_width: Optional[int] = None): super(MultipleSelectComponent, self).__init__(id_=id_) if not options: @@ -116,6 +116,7 @@ class MultipleSelectComponent(InputViewComponent): self.tooltip = tooltip self.values = default_options if default_options else set() self.max_per_line = max_per_line + self.min_width = min_width self.max_width = max_width self.max_height = max_height diff --git a/bauh/view/qt/components.py b/bauh/view/qt/components.py index ba455867..dc09834a 100644 --- a/bauh/view/qt/components.py +++ b/bauh/view/qt/components.py @@ -521,6 +521,9 @@ class MultipleSelectQt(QGroupBox): self._layout = QGridLayout() self.setLayout(self._layout) + if model.min_width and model.min_width > 0: + self.setMinimumWidth(int(model.min_width)) + if model.max_width > 0: self.setMaximumWidth(int(model.max_width)) @@ -579,6 +582,9 @@ class FormMultipleSelectQt(QWidget): self.model = model self.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Preferred) + if model.min_width and model.min_width > 0: + self.setMinimumWidth(int(model.min_width)) + if model.max_width > 0: self.setMaximumWidth(int(model.max_width))