mirror of https://github.com/procxx/kepka.git
parent
0659822ac9
commit
63fc552636
|
@ -385,20 +385,7 @@ MainWidget::MainWidget(
|
|||
|
||||
connect(_dialogs, SIGNAL(cancelled()), this, SLOT(dialogsCancelled()));
|
||||
connect(this, SIGNAL(dialogsUpdated()), _dialogs, SLOT(onListScroll()));
|
||||
connect(_history, &HistoryWidget::cancelled, [=] {
|
||||
const auto historyFromFolder = _history->history()
|
||||
? _history->history()->folder()
|
||||
: nullptr;
|
||||
const auto openedFolder = controller->openedFolder().current();
|
||||
if (!openedFolder
|
||||
|| historyFromFolder == openedFolder
|
||||
|| Adaptive::OneColumn()) {
|
||||
controller->showBackFromStack();
|
||||
_dialogs->setInnerFocus();
|
||||
} else {
|
||||
controller->closeFolder();
|
||||
}
|
||||
});
|
||||
connect(_history, &HistoryWidget::cancelled, [=] { handleHistoryBack(); });
|
||||
subscribe(
|
||||
Media::Player::instance()->updatedNotifier(),
|
||||
[=](const Media::Player::TrackState &state) { handleAudioUpdate(state); });
|
||||
|
@ -2717,7 +2704,7 @@ bool MainWidget::eventFilter(QObject *o, QEvent *e) {
|
|||
}
|
||||
} else if (e->type() == QEvent::MouseButtonPress) {
|
||||
if (static_cast<QMouseEvent*>(e)->button() == Qt::BackButton) {
|
||||
_controller->showBackFromStack();
|
||||
handleHistoryBack();
|
||||
return true;
|
||||
}
|
||||
} else if (e->type() == QEvent::Wheel) {
|
||||
|
@ -2736,6 +2723,21 @@ void MainWidget::handleAdaptiveLayoutUpdate() {
|
|||
}
|
||||
}
|
||||
|
||||
void MainWidget::handleHistoryBack() {
|
||||
const auto historyFromFolder = _history->history()
|
||||
? _history->history()->folder()
|
||||
: nullptr;
|
||||
const auto openedFolder = _controller->openedFolder().current();
|
||||
if (!openedFolder
|
||||
|| historyFromFolder == openedFolder
|
||||
|| _dialogs->isHidden()) {
|
||||
_controller->showBackFromStack();
|
||||
_dialogs->setInnerFocus();
|
||||
} else {
|
||||
_controller->closeFolder();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWidget::updateWindowAdaptiveLayout() {
|
||||
auto layout = _controller->computeColumnLayout();
|
||||
auto dialogsWidthRatio = session().settings().dialogsWidthRatio();
|
||||
|
|
|
@ -443,6 +443,8 @@ private:
|
|||
const Data::WallPaper &background,
|
||||
QImage &&image);
|
||||
|
||||
void handleHistoryBack();
|
||||
|
||||
not_null<Window::Controller*> _controller;
|
||||
bool _started = false;
|
||||
|
||||
|
|
Loading…
Reference in New Issue