feat: able to show file name in window title

This commit is contained in:
2023-05-29 23:59:45 +08:00
parent 5aeb0f821f
commit 6a992f4c1f
3 changed files with 14 additions and 0 deletions

View File

@ -140,6 +140,15 @@ MainWindow::MainWindow(QWidget *parent)
m_nextButton->setVisible(galleryFileCount > 1);
});
connect(m_pm, &PlaylistManager::currentIndexChanged, this, [this]() {
int index;
QUrl url;
std::tie(index, url) = m_pm->currentFileUrl();
if (index != -1) {
this->setWindowTitle(url.fileName());
}
});
QShortcut * fullscreenShorucut = new QShortcut(QKeySequence(QKeySequence::FullScreen), this);
connect(fullscreenShorucut, &QShortcut::activated,
this, &MainWindow::toggleFullscreen);