mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-09-07 17:16:00 -05:00
Prevent accidental edits of actions and conditions when scrolling
This commit is contained in:
@@ -34,7 +34,7 @@ private:
|
||||
static std::map<std::string, MacroActionInfo> _methods;
|
||||
};
|
||||
|
||||
class MacroActionEdit : public QWidget {
|
||||
class MacroActionEdit : public MacroSegmentEdit {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
||||
@@ -35,7 +35,7 @@ private:
|
||||
static std::map<std::string, MacroConditionInfo> _methods;
|
||||
};
|
||||
|
||||
class MacroConditionEdit : public QWidget {
|
||||
class MacroConditionEdit : public MacroSegmentEdit {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
||||
@@ -159,3 +159,23 @@ public:
|
||||
void ResolveMacroRef();
|
||||
MacroRef _macro;
|
||||
};
|
||||
|
||||
// TODO: Rework macro condition and action edit to allow moving control
|
||||
// handling to MacroSegmentEdit
|
||||
class MacroSegmentEdit : public QWidget {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MacroSegmentEdit(QWidget *parent = nullptr);
|
||||
// Use this function to avoid accidental edits when scrolling through
|
||||
// list of actions and conditions
|
||||
void SetFocusPolicyOfWidgets();
|
||||
};
|
||||
|
||||
class MouseWheelWidgetAdjustmentGuard : public QObject {
|
||||
public:
|
||||
explicit MouseWheelWidgetAdjustmentGuard(QObject *parent);
|
||||
|
||||
protected:
|
||||
bool eventFilter(QObject *o, QEvent *e) override;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user