Go to Chat on Shift+Enter in Forward box (#300)

This commit is contained in:
blank X 2022-01-26 09:19:04 +00:00 committed by GitHub
parent 55e1a74d12
commit 3297441898
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -57,6 +57,7 @@ public:
std::vector<not_null<PeerData*>> selected() const;
bool hasSelected() const;
Fn<void()> goToChatRequest() const;
void peopleReceived(
const QString &query,
@ -277,6 +278,10 @@ void ShareBox::prepare() {
if ((modifiers.testFlag(Qt::ControlModifier) && !cForwardChatOnClick())
|| modifiers.testFlag(Qt::MetaModifier)) {
submit({});
} else if (modifiers.testFlag(Qt::ShiftModifier)) {
if (_inner->selected().size() == 1 && _inner->goToChatRequest()) {
_inner->goToChatRequest()();
}
} else {
_inner->selectActive();
if (!modifiers.testFlag(Qt::ControlModifier) || cForwardChatOnClick()) {
@ -1198,6 +1203,10 @@ bool ShareBox::Inner::hasSelected() const {
return _selected.size();
}
Fn<void()> ShareBox::Inner::goToChatRequest() const {
return _goToChatRequest;
}
void ShareBox::Inner::updateFilter(QString filter) {
_lastQuery = filter.toLower().trimmed();