2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Pass modifiers inside InputField submitted signal.

Also use non-MOC connections for all InputFields.
Also use Ctrl/Cmd + Enter to submit fast share box.
Fixes #4769.
This commit is contained in:
John Preston
2018-05-31 15:20:28 +03:00
parent b3059248d4
commit bfc748cd31
36 changed files with 272 additions and 332 deletions

View File

@@ -61,7 +61,14 @@ void ShareBox::prepare() {
}
});
_select->setResizedCallback([this] { updateScrollSkips(); });
_select->setSubmittedCallback([this](bool) { _inner->onSelectActive(); });
_select->setSubmittedCallback([this](Qt::KeyboardModifiers modifiers) {
if (modifiers.testFlag(Qt::ControlModifier)
|| modifiers.testFlag(Qt::MetaModifier)) {
onSubmit();
} else {
_inner->onSelectActive();
}
});
connect(_inner, SIGNAL(searchByUsername()), this, SLOT(onNeedSearchByUsername()));
_inner->setPeerSelectedChangedCallback([this](PeerData *peer, bool checked) {
onPeerSelectedChanged(peer, checked);