From 262bb3f1eec9dfab99142a7cae956b726b66a5da Mon Sep 17 00:00:00 2001 From: WarmUpTill Date: Wed, 2 Feb 2022 20:18:23 +0100 Subject: [PATCH] Keep size of individual macro sgements consistent Previously the segments would expand if there was still room in the condition and action area. --- forms/advanced-scene-switcher.ui | 36 ++++++++++++++++++++++++++++++-- src/macro-segment.cpp | 9 +++++--- 2 files changed, 40 insertions(+), 5 deletions(-) diff --git a/forms/advanced-scene-switcher.ui b/forms/advanced-scene-switcher.ui index c740a1a2..61263129 100644 --- a/forms/advanced-scene-switcher.ui +++ b/forms/advanced-scene-switcher.ui @@ -832,7 +832,7 @@ 218 - + QLayout::SetMinAndMaxSize @@ -859,6 +859,9 @@ + + 1 + QLayout::SetFixedSize @@ -866,6 +869,19 @@ + + + + Qt::Vertical + + + + 0 + 0 + + + + @@ -931,7 +947,7 @@ 218 - + QLayout::SetMinAndMaxSize @@ -955,6 +971,9 @@ + + 1 + QLayout::SetMinAndMaxSize @@ -962,6 +981,19 @@ + + + + Qt::Vertical + + + + 0 + 0 + + + + diff --git a/src/macro-segment.cpp b/src/macro-segment.cpp index c44db482..959ca6bd 100644 --- a/src/macro-segment.cpp +++ b/src/macro-segment.cpp @@ -59,9 +59,12 @@ MacroSegmentEdit::MacroSegmentEdit(bool verticalControls, QWidget *parent) "#segmentFrame { border-radius: 4px; background-color: rgba(0,0,0,50); }"); _frame->setLayout(_highLightFrameLayout); // Set background transparent to avoid blocking highlight frame - setStyleSheet("\ - QCheckBox { background-color: rgba(0,0,0,0); }\ - QLabel { background-color: rgba(0,0,0,0); }"); + setStyleSheet("QCheckBox { background-color: rgba(0,0,0,0); }\ + QLabel { background-color: rgba(0,0,0,0); }"); + + // Keep the size of macro segments consistent, even if there is room in + // the edit areas + setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); QWidget::connect(_section, &Section::Collapsed, this, &MacroSegmentEdit::Collapsed);