mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-09-07 17:16:00 -05:00
Add macro condition that triggers if cursor position changed
Extend condition previously named "region"
This commit is contained in:
@@ -3,6 +3,11 @@
|
||||
#include <QWidget>
|
||||
#include <QComboBox>
|
||||
|
||||
enum class CursorCondition {
|
||||
REGION,
|
||||
MOVING,
|
||||
};
|
||||
|
||||
class MacroConditionCursor : public MacroCondition {
|
||||
public:
|
||||
bool CheckCondition();
|
||||
@@ -14,6 +19,7 @@ public:
|
||||
return std::make_shared<MacroConditionCursor>();
|
||||
}
|
||||
|
||||
CursorCondition _condition = CursorCondition::REGION;
|
||||
int _minX = 0, _minY = 0, _maxX = 0, _maxY = 0;
|
||||
|
||||
private:
|
||||
@@ -38,6 +44,7 @@ public:
|
||||
}
|
||||
|
||||
private slots:
|
||||
void ConditionChanged(int cond);
|
||||
void MinXChanged(int pos);
|
||||
void MinYChanged(int pos);
|
||||
void MaxXChanged(int pos);
|
||||
@@ -48,8 +55,10 @@ protected:
|
||||
QSpinBox *_minY;
|
||||
QSpinBox *_maxX;
|
||||
QSpinBox *_maxY;
|
||||
QComboBox *_conditions;
|
||||
std::shared_ptr<MacroConditionCursor> _entryData;
|
||||
|
||||
private:
|
||||
void SetRegionSelectionVisible(bool);
|
||||
bool _loading = true;
|
||||
};
|
||||
|
||||
@@ -101,6 +101,8 @@ struct SwitcherData {
|
||||
std::string currentTitle;
|
||||
|
||||
std::deque<ScreenRegionSwitch> screenRegionSwitches;
|
||||
std::pair<int, int> lastCursorPos = {0, 0};
|
||||
bool cursorPosChanged = false;
|
||||
|
||||
std::vector<std::string> ignoreWindowsSwitches;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user