Add settings to enable/disable playlist toolbar

This commit is contained in:
buckmelanoma 2021-10-23 13:48:02 -07:00 committed by Jonas Kvinge
parent 496ae42d72
commit 0d408055b2
3 changed files with 16 additions and 2 deletions

View File

@ -261,6 +261,9 @@ void PlaylistContainer::ReloadSettings() {
ui_->clear->hide();
}
bool show_toolbar = settings_.value("show_toolbar", true).toBool();
ui_->toolbar->setVisible(show_toolbar);
}
bool PlaylistContainer::SearchFieldHasFocus() const {
@ -268,7 +271,9 @@ bool PlaylistContainer::SearchFieldHasFocus() const {
}
void PlaylistContainer::FocusSearchField() {
ui_->filter->setFocus();
if (ui_->toolbar->isVisible()) {
ui_->filter->setFocus();
}
}
void PlaylistContainer::ActivePlaying() {

View File

@ -68,6 +68,7 @@ void PlaylistSettingsPage::Load() {
ui_->checkbox_greyout_songs_startup->setChecked(s.value("greyout_songs_startup", true).toBool());
ui_->checkbox_greyout_songs_play->setChecked(s.value("greyout_songs_play", true).toBool());
ui_->checkbox_select_track->setChecked(s.value("select_track", false).toBool());
ui_->checkbox_show_toolbar->setChecked(s.value("show_toolbar", true).toBool());
ui_->checkbox_playlist_clear->setChecked(s.value("playlist_clear", true).toBool());
ui_->checkbox_auto_sort->setChecked(s.value("auto_sort", false).toBool());
@ -129,6 +130,7 @@ void PlaylistSettingsPage::Save() {
s.setValue("greyout_songs_startup", ui_->checkbox_greyout_songs_startup->isChecked());
s.setValue("greyout_songs_play", ui_->checkbox_greyout_songs_play->isChecked());
s.setValue("select_track", ui_->checkbox_select_track->isChecked());
s.setValue("show_toolbar", ui_->checkbox_show_toolbar->isChecked());
s.setValue("playlist_clear", ui_->checkbox_playlist_clear->isChecked());
s.setValue(Playlist::kPathType, static_cast<int>(path));
s.setValue("editmetadatainline", ui_->checkbox_editmetadatainline->isChecked());

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>517</width>
<height>562</height>
<height>673</height>
</rect>
</property>
<property name="windowTitle">
@ -63,6 +63,13 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkbox_show_toolbar">
<property name="text">
<string>Enable playlist toolbar</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkbox_playlist_clear">
<property name="text">