diff --git a/src/headers/macro-segment.hpp b/src/headers/macro-segment.hpp index 3f0bb4b5..cc534f05 100644 --- a/src/headers/macro-segment.hpp +++ b/src/headers/macro-segment.hpp @@ -1,6 +1,8 @@ #pragma once #include #include +#include +#include #include class Macro; @@ -69,6 +71,8 @@ protected: Section *_section; QLabel *_headerInfo; MacroEntryControls *_controls; + QFrame *_frame; + QVBoxLayout *_highLightFrameLayout; private: QTimer _enterTimer; diff --git a/src/macro-action-edit.cpp b/src/macro-action-edit.cpp index 93a94442..9ff47c40 100644 --- a/src/macro-action-edit.cpp +++ b/src/macro-action-edit.cpp @@ -78,18 +78,9 @@ MacroActionEdit::MacroActionEdit(QWidget *parent, _section->AddHeaderWidget(_actionSelection); _section->AddHeaderWidget(_headerInfo); - auto frame = new QFrame; - frame->setObjectName("actionFrame"); - frame->setStyleSheet( - "#actionFrame { border-radius: 4px; background-color: rgba(0,0,0,50); }"); - setStyleSheet("QCheckBox { background-color: rgba(0,0,0,0); }\ - QLabel { background-color: rgba(0,0,0,0); }"); - QVBoxLayout *frameLayout = new QVBoxLayout; - frame->setLayout(frameLayout); - frameLayout->addWidget(_section); - QVBoxLayout *actionLayout = new QVBoxLayout; - actionLayout->addWidget(frame); + actionLayout->addWidget(_frame); + _highLightFrameLayout->addWidget(_section); QHBoxLayout *mainLayout = new QHBoxLayout; if (switcher->useVerticalMacroControls) { diff --git a/src/macro-condition-edit.cpp b/src/macro-condition-edit.cpp index 24dae78f..c4bea6ef 100644 --- a/src/macro-condition-edit.cpp +++ b/src/macro-condition-edit.cpp @@ -123,7 +123,8 @@ MacroConditionEdit::MacroConditionEdit( _section->AddHeaderWidget(_dur); QVBoxLayout *conditionLayout = new QVBoxLayout; - conditionLayout->addWidget(_section); + conditionLayout->addWidget(_frame); + _highLightFrameLayout->addWidget(_section); QHBoxLayout *mainLayout = new QHBoxLayout; if (switcher->useVerticalMacroControls) { diff --git a/src/macro-segment.cpp b/src/macro-segment.cpp index cc0cd2bc..c44db482 100644 --- a/src/macro-segment.cpp +++ b/src/macro-segment.cpp @@ -52,6 +52,17 @@ MacroSegmentEdit::MacroSegmentEdit(bool verticalControls, QWidget *parent) _leaveTimer.setSingleShot(true); _leaveTimer.setInterval(1000); + _frame = new QFrame; + _frame->setObjectName("segmentFrame"); + _highLightFrameLayout = new QVBoxLayout; + _frame->setStyleSheet( + "#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); }"); + QWidget::connect(_section, &Section::Collapsed, this, &MacroSegmentEdit::Collapsed); diff --git a/src/section.cpp b/src/section.cpp index dfd648f7..efc980fd 100644 --- a/src/section.cpp +++ b/src/section.cpp @@ -12,7 +12,8 @@ Section::Section(const int animationDuration, QWidget *parent) _mainLayout = new QGridLayout(this); _headerWidgetLayout = new QHBoxLayout(); - _toggleButton->setStyleSheet("QToolButton {border: none;}"); + _toggleButton->setStyleSheet( + "QToolButton {border: none; background-color: rgba(0,0,0,0);}"); _toggleButton->setToolButtonStyle(Qt::ToolButtonIconOnly); _toggleButton->setArrowType(Qt::ArrowType::RightArrow); _toggleButton->setCheckable(true);