mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-09-08 09:36:07 -05:00
Highlight recently executed action and true conditions
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include <QWidget>
|
||||
#include <QFrame>
|
||||
#include <QVBoxLayout>
|
||||
#include <QTimer>
|
||||
#include <obs.hpp>
|
||||
|
||||
class Macro;
|
||||
@@ -18,10 +19,14 @@ public:
|
||||
virtual bool Load(obs_data_t *obj) = 0;
|
||||
virtual std::string GetShortDesc();
|
||||
virtual std::string GetId() = 0;
|
||||
void SetHighlight();
|
||||
bool Highlight();
|
||||
|
||||
protected:
|
||||
int _idx = 0;
|
||||
bool _collapsed = false;
|
||||
// UI helper
|
||||
bool _highlight = false;
|
||||
|
||||
private:
|
||||
Macro *_macro = nullptr;
|
||||
@@ -34,7 +39,7 @@ class MacroSegmentEdit : public QWidget {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MacroSegmentEdit(QWidget *parent = nullptr);
|
||||
MacroSegmentEdit(bool highlight, QWidget *parent = nullptr);
|
||||
// Use this function to avoid accidental edits when scrolling through
|
||||
// list of actions and conditions
|
||||
void SetFocusPolicyOfWidgets();
|
||||
@@ -44,6 +49,8 @@ public:
|
||||
protected slots:
|
||||
void HeaderInfoChanged(const QString &);
|
||||
void Collapsed(bool);
|
||||
void Highlight();
|
||||
void EnableHighlight(bool);
|
||||
signals:
|
||||
void MacroAdded(const QString &name);
|
||||
void MacroRemoved(const QString &name);
|
||||
@@ -59,10 +66,13 @@ protected:
|
||||
Section *_section;
|
||||
QLabel *_headerInfo;
|
||||
QFrame *_frame;
|
||||
QVBoxLayout *_highLightFrameLayout;
|
||||
QVBoxLayout *_selectionFrameLayout;
|
||||
|
||||
private:
|
||||
virtual MacroSegment *Data() = 0;
|
||||
|
||||
bool _showHighlight;
|
||||
QTimer _timer;
|
||||
};
|
||||
|
||||
class MouseWheelWidgetAdjustmentGuard : public QObject {
|
||||
|
||||
@@ -110,6 +110,7 @@ public:
|
||||
|
||||
// UI helpers for the macro tab
|
||||
bool WasExecutedRecently();
|
||||
void ResetUIHelpers();
|
||||
|
||||
private:
|
||||
void SetupHotkeys();
|
||||
|
||||
Reference in New Issue
Block a user