UI: only show chapter button when chapter info available
This commit is contained in:
@ -61,6 +61,7 @@ MainWindow::MainWindow(QWidget *parent)
|
|||||||
m_mediaPlayer->setLoops(QMediaPlayer::Infinite);
|
m_mediaPlayer->setLoops(QMediaPlayer::Infinite);
|
||||||
ui->playlistView->setModel(m_playlistManager->model());
|
ui->playlistView->setModel(m_playlistManager->model());
|
||||||
|
|
||||||
|
ui->chapterNameBtn->setVisible(false);
|
||||||
ui->chapterlistView->setModel(ui->playbackProgressIndicator->chapterModel());
|
ui->chapterlistView->setModel(ui->playbackProgressIndicator->chapterModel());
|
||||||
ui->chapterlistView->setRootIsDecorated(false);
|
ui->chapterlistView->setRootIsDecorated(false);
|
||||||
|
|
||||||
@ -527,9 +528,13 @@ void MainWindow::initConnections()
|
|||||||
ui->chapterNameBtn->setText(currentChapterName);
|
ui->chapterNameBtn->setText(currentChapterName);
|
||||||
lastChapterName = currentChapterName;
|
lastChapterName = currentChapterName;
|
||||||
}
|
}
|
||||||
} else if (!lastChapterName.isEmpty()) {
|
ui->chapterNameBtn->setVisible(true);
|
||||||
ui->chapterNameBtn->setText("");
|
} else {
|
||||||
lastChapterName.clear();
|
if (!lastChapterName.isEmpty()) {
|
||||||
|
ui->chapterNameBtn->setText("");
|
||||||
|
lastChapterName.clear();
|
||||||
|
}
|
||||||
|
ui->chapterNameBtn->setVisible(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -714,7 +714,7 @@ QHeaderView {
|
|||||||
<string>About</string>
|
<string>About</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="shortcut">
|
<property name="shortcut">
|
||||||
<string>F1</string>
|
<string notr="true">F1</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="menuRole">
|
<property name="menuRole">
|
||||||
<enum>QAction::AboutRole</enum>
|
<enum>QAction::AboutRole</enum>
|
||||||
@ -728,7 +728,7 @@ QHeaderView {
|
|||||||
<string>Open</string>
|
<string>Open</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="shortcut">
|
<property name="shortcut">
|
||||||
<string>Ctrl+O</string>
|
<string notr="true">Ctrl+O</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="menuRole">
|
<property name="menuRole">
|
||||||
<enum>QAction::NoRole</enum>
|
<enum>QAction::NoRole</enum>
|
||||||
|
Reference in New Issue
Block a user