mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Try cancelling the new search by mouse back button.
This commit is contained in:
parent
72d5a9b3e0
commit
d5a347ede7
3 changed files with 10 additions and 1 deletions
|
@ -1107,6 +1107,13 @@ void Widget::updateHasFocus(not_null<QWidget*> focused) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Widget::cancelSearchByMouseBack() {
|
||||||
|
return _searchHasFocus
|
||||||
|
&& !_searchSuggestionsLocked
|
||||||
|
&& !_searchInChat
|
||||||
|
&& cancelSearch();
|
||||||
|
}
|
||||||
|
|
||||||
void Widget::processSearchFocusChange() {
|
void Widget::processSearchFocusChange() {
|
||||||
_searchSuggestionsLocked = _suggestions && _suggestions->persist();
|
_searchSuggestionsLocked = _suggestions && _suggestions->persist();
|
||||||
updateCancelSearch();
|
updateCancelSearch();
|
||||||
|
|
|
@ -133,6 +133,7 @@ public:
|
||||||
QRect floatPlayerAvailableRect() override;
|
QRect floatPlayerAvailableRect() override;
|
||||||
|
|
||||||
bool cancelSearch();
|
bool cancelSearch();
|
||||||
|
bool cancelSearchByMouseBack();
|
||||||
|
|
||||||
~Widget();
|
~Widget();
|
||||||
|
|
||||||
|
|
|
@ -2649,7 +2649,8 @@ bool MainWidget::eventFilter(QObject *o, QEvent *e) {
|
||||||
if (widget && (widget->window() == window())) {
|
if (widget && (widget->window() == window())) {
|
||||||
const auto event = static_cast<QMouseEvent*>(e);
|
const auto event = static_cast<QMouseEvent*>(e);
|
||||||
if (event->button() == Qt::BackButton) {
|
if (event->button() == Qt::BackButton) {
|
||||||
if (!Core::App().hideMediaView()) {
|
if (!Core::App().hideMediaView()
|
||||||
|
&& (!_dialogs || !_dialogs->cancelSearchByMouseBack())) {
|
||||||
handleHistoryBack();
|
handleHistoryBack();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue