mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Always show cancel search when focused.
This commit is contained in:
parent
34a7169b4f
commit
a11535806d
2 changed files with 10 additions and 1 deletions
|
@ -1109,6 +1109,7 @@ void Widget::updateHasFocus(not_null<QWidget*> focused) {
|
||||||
|
|
||||||
void Widget::processSearchFocusChange() {
|
void Widget::processSearchFocusChange() {
|
||||||
_searchSuggestionsLocked = _suggestions && _suggestions->persist();
|
_searchSuggestionsLocked = _suggestions && _suggestions->persist();
|
||||||
|
updateCancelSearch();
|
||||||
updateStoriesVisibility();
|
updateStoriesVisibility();
|
||||||
updateForceDisplayWide();
|
updateForceDisplayWide();
|
||||||
updateSuggestions(anim::type::normal);
|
updateSuggestions(anim::type::normal);
|
||||||
|
@ -2550,6 +2551,13 @@ void Widget::listScrollUpdated() {
|
||||||
_scrollToTop->update();
|
_scrollToTop->update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Widget::updateCancelSearch() {
|
||||||
|
const auto shown = _searchHasFocus
|
||||||
|
|| _searchSuggestionsLocked
|
||||||
|
|| !_search->getLastText().isEmpty();
|
||||||
|
_cancelSearch->toggle(shown, anim::type::normal);
|
||||||
|
}
|
||||||
|
|
||||||
void Widget::applySearchUpdate(bool force) {
|
void Widget::applySearchUpdate(bool force) {
|
||||||
if (_showAnimation && !force) {
|
if (_showAnimation && !force) {
|
||||||
return;
|
return;
|
||||||
|
@ -2562,7 +2570,7 @@ void Widget::applySearchUpdate(bool force) {
|
||||||
if (filterText.isEmpty() && !_searchFromAuthor && _searchTags.empty()) {
|
if (filterText.isEmpty() && !_searchFromAuthor && _searchTags.empty()) {
|
||||||
clearSearchCache();
|
clearSearchCache();
|
||||||
}
|
}
|
||||||
_cancelSearch->toggle(!filterText.isEmpty(), anim::type::normal);
|
updateCancelSearch();
|
||||||
if (!_postponeProcessSearchFocusChange) {
|
if (!_postponeProcessSearchFocusChange) {
|
||||||
updateSuggestions(anim::type::instant);
|
updateSuggestions(anim::type::instant);
|
||||||
}
|
}
|
||||||
|
|
|
@ -227,6 +227,7 @@ private:
|
||||||
void closeChildList(anim::type animated);
|
void closeChildList(anim::type animated);
|
||||||
|
|
||||||
void fullSearchRefreshOn(rpl::producer<> events);
|
void fullSearchRefreshOn(rpl::producer<> events);
|
||||||
|
void updateCancelSearch();
|
||||||
void applySearchUpdate(bool force = false);
|
void applySearchUpdate(bool force = false);
|
||||||
void refreshLoadMoreButton(bool mayBlock, bool isBlocked);
|
void refreshLoadMoreButton(bool mayBlock, bool isBlocked);
|
||||||
void loadMoreBlockedByDate();
|
void loadMoreBlockedByDate();
|
||||||
|
|
Loading…
Add table
Reference in a new issue