mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 02:24:16 +02:00
[view] improvement: allowing to set a min height for confirmation dialogs
This commit is contained in:
@@ -34,7 +34,8 @@ class ConfirmationDialog(QDialog):
|
||||
def __init__(self, title: str, body: Optional[str], i18n: I18n, icon: QIcon = QIcon(resource.get_path('img/logo.svg')),
|
||||
widgets: Optional[List[QWidget]] = None, confirmation_button: bool = True, deny_button: bool = True,
|
||||
window_cancel: bool = False, confirmation_label: Optional[str] = None, deny_label: Optional[str] = None,
|
||||
confirmation_icon: bool = True, min_width: Optional[int] = None):
|
||||
confirmation_icon: bool = True, min_width: Optional[int] = None,
|
||||
min_height: Optional[int] = None):
|
||||
super(ConfirmationDialog, self).__init__()
|
||||
|
||||
if not window_cancel:
|
||||
@@ -44,6 +45,10 @@ class ConfirmationDialog(QDialog):
|
||||
self.setWindowTitle(title)
|
||||
self.setSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Preferred)
|
||||
self.setMinimumWidth(min_width if min_width and min_width > 0 else 250)
|
||||
|
||||
if isinstance(min_height, int) and min_height > 0:
|
||||
self.setMinimumHeight(min_height)
|
||||
|
||||
self.confirmed = False
|
||||
|
||||
if icon:
|
||||
@@ -53,6 +58,9 @@ class ConfirmationDialog(QDialog):
|
||||
container_body.setObjectName('confirm_container_body')
|
||||
container_body.setSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Preferred)
|
||||
|
||||
if isinstance(min_height, int) and min_height > 0:
|
||||
container_body.setMinimumWidth(min_height)
|
||||
|
||||
if widgets:
|
||||
container_body.setLayout(QVBoxLayout())
|
||||
scroll = QScrollArea(self)
|
||||
|
||||
Reference in New Issue
Block a user