Add appearance option to hide playlist filter toolbar (#5942)
Gives the user the option of a cleaner looking interface if the filter toolbar isn't used.
This commit is contained in:
parent
d9b12a5599
commit
2e4a67b8da
|
@ -19,6 +19,7 @@
|
||||||
#include "playlistmanager.h"
|
#include "playlistmanager.h"
|
||||||
#include "ui_playlistcontainer.h"
|
#include "ui_playlistcontainer.h"
|
||||||
#include "core/logging.h"
|
#include "core/logging.h"
|
||||||
|
#include "core/appearance.h"
|
||||||
#include "playlistparsers/playlistparser.h"
|
#include "playlistparsers/playlistparser.h"
|
||||||
#include "ui/iconloader.h"
|
#include "ui/iconloader.h"
|
||||||
|
|
||||||
|
@ -71,6 +72,11 @@ PlaylistContainer::PlaylistContainer(QWidget* parent)
|
||||||
// Remove QFrame border
|
// Remove QFrame border
|
||||||
ui_->toolbar->setStyleSheet("QFrame { border: 0px; }");
|
ui_->toolbar->setStyleSheet("QFrame { border: 0px; }");
|
||||||
|
|
||||||
|
QSettings settings;
|
||||||
|
settings.beginGroup(Appearance::kSettingsGroup);
|
||||||
|
bool hide_toolbar = settings.value("b_hide_filter_toolbar", false).toBool();
|
||||||
|
ui_->toolbar->setVisible(!hide_toolbar);
|
||||||
|
|
||||||
// Make it bold
|
// Make it bold
|
||||||
QFont no_matches_font = no_matches_label_->font();
|
QFont no_matches_font = no_matches_label_->font();
|
||||||
no_matches_font.setBold(true);
|
no_matches_font.setBold(true);
|
||||||
|
@ -452,3 +458,10 @@ bool PlaylistContainer::eventFilter(QObject* objectWatched, QEvent* event) {
|
||||||
}
|
}
|
||||||
return QWidget::eventFilter(objectWatched, event);
|
return QWidget::eventFilter(objectWatched, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PlaylistContainer::ReloadSettings() {
|
||||||
|
QSettings settings;
|
||||||
|
settings.beginGroup(Appearance::kSettingsGroup);
|
||||||
|
bool hide_toolbar = settings.value("b_hide_filter_toolbar", false).toBool();
|
||||||
|
ui_->toolbar->setVisible(!hide_toolbar);
|
||||||
|
}
|
||||||
|
|
|
@ -61,6 +61,9 @@ signals:
|
||||||
// QWidget
|
// QWidget
|
||||||
void resizeEvent(QResizeEvent*);
|
void resizeEvent(QResizeEvent*);
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void ReloadSettings();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void NewPlaylist();
|
void NewPlaylist();
|
||||||
void LoadPlaylist();
|
void LoadPlaylist();
|
||||||
|
|
|
@ -109,6 +109,7 @@ void AppearanceSettingsPage::Load() {
|
||||||
|
|
||||||
InitColorSelectorsColors();
|
InitColorSelectorsColors();
|
||||||
ui_->b_use_sys_icons->setChecked(s.value("b_use_sys_icons", false).toBool());
|
ui_->b_use_sys_icons->setChecked(s.value("b_use_sys_icons", false).toBool());
|
||||||
|
ui_->b_hide_filter_toolbar->setChecked(s.value("b_hide_filter_toolbar",false).toBool());
|
||||||
s.endGroup();
|
s.endGroup();
|
||||||
|
|
||||||
// Playlist settings
|
// Playlist settings
|
||||||
|
@ -171,6 +172,7 @@ void AppearanceSettingsPage::Save() {
|
||||||
dialog()->appearance()->ResetToSystemDefaultTheme();
|
dialog()->appearance()->ResetToSystemDefaultTheme();
|
||||||
}
|
}
|
||||||
s.setValue("b_use_sys_icons", ui_->b_use_sys_icons->isChecked());
|
s.setValue("b_use_sys_icons", ui_->b_use_sys_icons->isChecked());
|
||||||
|
s.setValue("b_hide_filter_toolbar", ui_->b_hide_filter_toolbar->isChecked());
|
||||||
s.endGroup();
|
s.endGroup();
|
||||||
|
|
||||||
// Playlist settings
|
// Playlist settings
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>596</width>
|
<width>596</width>
|
||||||
<height>566</height>
|
<height>666</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
@ -279,22 +279,20 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="b_hide_filter_toolbar">
|
||||||
|
<property name="text">
|
||||||
|
<string>Hide playlist filter toolbar</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<spacer name="verticalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
|
|
|
@ -1096,6 +1096,7 @@ void MainWindow::ReloadAllSettings() {
|
||||||
library_view_->ReloadSettings();
|
library_view_->ReloadSettings();
|
||||||
song_info_view_->ReloadSettings();
|
song_info_view_->ReloadSettings();
|
||||||
app_->player()->engine()->ReloadSettings();
|
app_->player()->engine()->ReloadSettings();
|
||||||
|
ui_->playlist->ReloadSettings();
|
||||||
ui_->playlist->view()->ReloadSettings();
|
ui_->playlist->view()->ReloadSettings();
|
||||||
app_->internet_model()->ReloadSettings();
|
app_->internet_model()->ReloadSettings();
|
||||||
#ifdef HAVE_WIIMOTEDEV
|
#ifdef HAVE_WIIMOTEDEV
|
||||||
|
|
Loading…
Reference in New Issue