mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-09-30 23:33:42 +08:00
override mouse release events
This commit is contained in:
@@ -586,6 +586,16 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
protected:
|
||||
// Override mouse release event to handle style updates smoothly
|
||||
void mouseReleaseEvent(QMouseEvent *event) override {
|
||||
if (!key.empty()) {
|
||||
bool next_state = !params.getBool(key);
|
||||
updateStyle(next_state);
|
||||
}
|
||||
QPushButton::mouseReleaseEvent(event);
|
||||
}
|
||||
|
||||
private:
|
||||
std::string key = "";
|
||||
Params params;
|
||||
|
||||
Reference in New Issue
Block a user