Move vertical / horizontal control handling to macro segment

This commit is contained in:
WarmUpTill
2022-01-30 03:06:06 +01:00
committed by WarmUpTill
parent 61d9031933
commit 48368f4bd6
6 changed files with 71 additions and 62 deletions

View File

@@ -11,16 +11,11 @@ class MacroEntryControls : public QWidget {
Q_OBJECT
public:
explicit MacroEntryControls(const int animationDuration = 300,
explicit MacroEntryControls(bool vertical = false,
const int animationDuration = 300,
QWidget *parent = 0);
void Show(bool visible = true);
QPushButton *GetUp() { return _up; }
QPushButton *GetDown() { return _down; }
QPushButton *GetAdd() { return _add; }
QPushButton *GetRemove() { return _remove; }
signals:
void Add();
void Remove();
@@ -28,6 +23,7 @@ signals:
void Down();
private:
bool _vertical = false;
bool _visible = false;
QPushButton *_add;
QPushButton *_remove;

View File

@@ -34,7 +34,8 @@ class MacroSegmentEdit : public QWidget {
Q_OBJECT
public:
MacroSegmentEdit(QWidget *parent = nullptr);
MacroSegmentEdit(bool verticalControls = true,
QWidget *parent = nullptr);
// Use this function to avoid accidental edits when scrolling through
// list of actions and conditions
void SetFocusPolicyOfWidgets();