2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

alt-up and alt-down scroll through dialogs, fixed compile on windows

This commit is contained in:
John Preston
2015-01-28 16:29:01 +03:00
parent 89ce0ce1e2
commit 1c2289f2ce
3 changed files with 23 additions and 9 deletions

View File

@@ -3384,9 +3384,23 @@ void HistoryWidget::keyPressEvent(QKeyEvent *e) {
_scroll.scrollToY(_scroll.scrollTop() - _scroll.height());
}
} else if (e->key() == Qt::Key_Down) {
_scroll.scrollToY(_scroll.scrollTop() + _scroll.height() / 10);
if (e->modifiers() & Qt::AltModifier) {
PeerData *after = 0;
MsgId afterMsgId = 0;
App::main()->peerAfter(histPeer, hist ? hist->activeMsgId : 0, after, afterMsgId);
if (after) App::main()->showPeer(after->id, afterMsgId);
} else if (!(e->modifiers() & (Qt::ShiftModifier | Qt::MetaModifier | Qt::ControlModifier))) {
_scroll.scrollToY(_scroll.scrollTop() + _scroll.height() / 10);
}
} else if (e->key() == Qt::Key_Up) {
_scroll.scrollToY(_scroll.scrollTop() - _scroll.height() / 10);
if (e->modifiers() & Qt::AltModifier) {
PeerData *before = 0;
MsgId beforeMsgId = 0;
App::main()->peerBefore(histPeer, hist ? hist->activeMsgId : 0, before, beforeMsgId);
if (before) App::main()->showPeer(before->id, beforeMsgId);
} else if (!(e->modifiers() & (Qt::ShiftModifier | Qt::MetaModifier | Qt::ControlModifier))) {
_scroll.scrollToY(_scroll.scrollTop() - _scroll.height() / 10);
}
} else if ((e->key() == Qt::Key_Tab || e->key() == Qt::Key_Backtab) && ((e->modifiers() & Qt::ControlModifier) || (e->modifiers() & Qt::MetaModifier))) {
PeerData *p = 0;
MsgId m = 0;