Add various missing things for appearance customization
This commit is contained in:
parent
034d679baa
commit
f6d2306c05
@ -688,10 +688,10 @@ MainWindow::MainWindow(
|
||||
NowPlayingWidgetPositionChanged(ui_->now_playing->show_above_status_bar());
|
||||
|
||||
// Load theme
|
||||
appearance_ = new Appearance(this);
|
||||
appearance_->LoadUserTheme();
|
||||
StyleSheetLoader* css_loader = new StyleSheetLoader(this);
|
||||
css_loader->SetStyleSheet(this, ":mainwindow.css");
|
||||
appearance_ = new Appearance(this);
|
||||
appearance_->Load();
|
||||
|
||||
// Load playlists
|
||||
playlists_->Init(library_->backend(), playlist_backend_,
|
||||
@ -1944,6 +1944,7 @@ void MainWindow::EnsureSettingsDialogCreated() {
|
||||
settings_dialog_->SetGlobalShortcutManager(global_shortcuts_);
|
||||
settings_dialog_->SetGlobalSearch(global_search_);
|
||||
settings_dialog_->SetSongInfoView(song_info_view_);
|
||||
settings_dialog_->SetAppearance(appearance_);
|
||||
|
||||
// Settings
|
||||
connect(settings_dialog_.get(), SIGNAL(accepted()), SLOT(ReloadAllSettings()));
|
||||
|
@ -227,6 +227,15 @@ void SettingsDialog::accept() {
|
||||
QDialog::accept();
|
||||
}
|
||||
|
||||
void SettingsDialog::reject() {
|
||||
// Notify each page that user clicks on Cancel
|
||||
foreach (const PageData& data, pages_.values()) {
|
||||
data.page_->Cancel();
|
||||
}
|
||||
|
||||
QDialog::reject();
|
||||
}
|
||||
|
||||
void SettingsDialog::showEvent(QShowEvent* e) {
|
||||
// Load settings
|
||||
loading_settings_ = true;
|
||||
|
@ -27,6 +27,7 @@
|
||||
class QScrollArea;
|
||||
class QTreeWidgetItem;
|
||||
|
||||
class Appearance;
|
||||
class BackgroundStreams;
|
||||
class GlobalSearch;
|
||||
class GlobalShortcuts;
|
||||
@ -85,6 +86,7 @@ public:
|
||||
void SetGstEngine(const GstEngine* engine) { gst_engine_ = engine; }
|
||||
void SetSongInfoView(SongInfoView* view) { song_info_view_ = view; }
|
||||
void SetGlobalSearch(GlobalSearch* global_search) { global_search_ = global_search; }
|
||||
void SetAppearance(Appearance* appearance) { appearance_ = appearance; }
|
||||
|
||||
bool is_loading_settings() const { return loading_settings_; }
|
||||
|
||||
@ -94,11 +96,13 @@ public:
|
||||
SongInfoView* song_info_view() const { return song_info_view_; }
|
||||
BackgroundStreams* background_streams() const { return streams_; }
|
||||
GlobalSearch* global_search() const { return global_search_; }
|
||||
Appearance* appearance() const { return appearance_; }
|
||||
|
||||
void OpenAtPage(Page page);
|
||||
|
||||
// QDialog
|
||||
void accept();
|
||||
void reject();
|
||||
|
||||
// QWidget
|
||||
void showEvent(QShowEvent* e);
|
||||
@ -127,6 +131,7 @@ private:
|
||||
SongInfoView* song_info_view_;
|
||||
BackgroundStreams* streams_;
|
||||
GlobalSearch* global_search_;
|
||||
Appearance* appearance_;
|
||||
|
||||
Ui_SettingsDialog* ui_;
|
||||
bool loading_settings_;
|
||||
|
@ -33,9 +33,11 @@ public:
|
||||
// Return false to grey out the page's item in the list.
|
||||
virtual bool IsEnabled() const { return true; }
|
||||
|
||||
// Load is called when the dialog is shown, Save when the user clicks OK.
|
||||
// Load is called when the dialog is shown, Save when the user clicks OK, and
|
||||
// Cancel when the user clicks on Cancel
|
||||
virtual void Load() = 0;
|
||||
virtual void Save() = 0;
|
||||
virtual void Cancel() {}
|
||||
|
||||
// The dialog that this page belongs to.
|
||||
SettingsDialog* dialog() const { return dialog_; }
|
||||
|
Loading…
x
Reference in New Issue
Block a user