mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-12 12:18:35 -05:00
Adding frame highlighting individual macro segments
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
#pragma once
|
||||
#include <QWidget>
|
||||
#include <QTimer>
|
||||
#include <QFrame>
|
||||
#include <QVBoxLayout>
|
||||
#include <obs.hpp>
|
||||
|
||||
class Macro;
|
||||
@@ -69,6 +71,8 @@ protected:
|
||||
Section *_section;
|
||||
QLabel *_headerInfo;
|
||||
MacroEntryControls *_controls;
|
||||
QFrame *_frame;
|
||||
QVBoxLayout *_highLightFrameLayout;
|
||||
|
||||
private:
|
||||
QTimer _enterTimer;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user