mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-08-02 18:21:53 +00:00
Alpha version 0.10.22: critical bug fixes.
This commit is contained in:
@@ -83,8 +83,14 @@ void AbstractButton::mouseReleaseEvent(QMouseEvent *e) {
|
||||
}
|
||||
}
|
||||
|
||||
void AbstractButton::setPointerCursor(bool enablePointerCursor) {
|
||||
if (_enablePointerCursor != enablePointerCursor) {
|
||||
_enablePointerCursor = enablePointerCursor;
|
||||
updateCursor();
|
||||
}
|
||||
}
|
||||
|
||||
void AbstractButton::setOver(bool over, StateChangeSource source) {
|
||||
setCursor(over ? style::cur_pointer : style::cur_default);
|
||||
if (over && !(_state & StateFlag::Over)) {
|
||||
auto was = _state;
|
||||
_state |= StateFlag::Over;
|
||||
@@ -94,6 +100,12 @@ void AbstractButton::setOver(bool over, StateChangeSource source) {
|
||||
_state &= ~State(StateFlag::Over);
|
||||
onStateChanged(was, source);
|
||||
}
|
||||
updateCursor();
|
||||
}
|
||||
|
||||
void AbstractButton::updateCursor() {
|
||||
auto pointerCursor = _enablePointerCursor && (_state & StateFlag::Over);
|
||||
setCursor(pointerCursor ? style::cur_pointer : style::cur_default);
|
||||
}
|
||||
|
||||
void AbstractButton::setDisabled(bool disabled) {
|
||||
|
||||
Reference in New Issue
Block a user