mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 14:38:15 +00:00
Using square rounded photos in native notifications (Win, OS X).
When updating local online status from user action events we use action timestamp, and ignoring events from getDifference, if no timestamp is available for the specific action. Couple of hidden actions added in Settings. Alpha version 0.9.54.
This commit is contained in:
@@ -493,14 +493,24 @@ bool FieldAutocomplete::chooseSelected(ChooseMethod method) const {
|
||||
}
|
||||
|
||||
bool FieldAutocomplete::eventFilter(QObject *obj, QEvent *e) {
|
||||
if (isHidden()) return QWidget::eventFilter(obj, e);
|
||||
auto hidden = isHidden();
|
||||
auto moderate = Global::ModerateModeEnabled();
|
||||
if (hidden && !moderate) return QWidget::eventFilter(obj, e);
|
||||
|
||||
if (e->type() == QEvent::KeyPress) {
|
||||
QKeyEvent *ev = static_cast<QKeyEvent*>(e);
|
||||
if (!(ev->modifiers() & (Qt::AltModifier | Qt::ControlModifier | Qt::ShiftModifier | Qt::MetaModifier))) {
|
||||
if (ev->key() == Qt::Key_Up || ev->key() == Qt::Key_Down || (!_srows.isEmpty() && (ev->key() == Qt::Key_Left || ev->key() == Qt::Key_Right))) {
|
||||
return _inner->moveSel(ev->key());
|
||||
} else if (ev->key() == Qt::Key_Enter || ev->key() == Qt::Key_Return) {
|
||||
return _inner->chooseSelected(ChooseMethod::ByEnter);
|
||||
if (!hidden) {
|
||||
if (ev->key() == Qt::Key_Up || ev->key() == Qt::Key_Down || (!_srows.isEmpty() && (ev->key() == Qt::Key_Left || ev->key() == Qt::Key_Right))) {
|
||||
return _inner->moveSel(ev->key());
|
||||
} else if (ev->key() == Qt::Key_Enter || ev->key() == Qt::Key_Return) {
|
||||
return _inner->chooseSelected(ChooseMethod::ByEnter);
|
||||
}
|
||||
}
|
||||
if (moderate && ev->key() >= Qt::Key_1 && ev->key() <= Qt::Key_9) {
|
||||
bool handled = false;
|
||||
emit moderateKeyActivate(ev->key() - Qt::Key_1, &handled);
|
||||
return handled;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user