mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-15 21:57:10 +02:00
Better folder / chat closing by escape.
This commit is contained in:
parent
4a8b5c3015
commit
66435d5269
1 changed files with 8 additions and 4 deletions
|
@ -2653,12 +2653,16 @@ void MainWidget::handleHistoryBack() {
|
|||
if (!_dialogs) {
|
||||
return;
|
||||
}
|
||||
const auto historyFromFolder = _history->history()
|
||||
? _history->history()->folder()
|
||||
: nullptr;
|
||||
const auto openedFolder = _controller->openedFolder().current();
|
||||
const auto rootPeer = _stack.empty()
|
||||
? _history->peer()
|
||||
: _stack.front()->peer();
|
||||
const auto rootHistory = rootPeer
|
||||
? rootPeer->owner().historyLoaded(rootPeer)
|
||||
: nullptr;
|
||||
const auto rootFolder = rootHistory ? rootHistory->folder() : nullptr;
|
||||
if (!openedFolder
|
||||
|| historyFromFolder == openedFolder
|
||||
|| rootFolder == openedFolder
|
||||
|| _dialogs->isHidden()) {
|
||||
_controller->showBackFromStack();
|
||||
_dialogs->setInnerFocus();
|
||||
|
|
Loading…
Add table
Reference in a new issue