Add a taste of Strawbs background image

This commit is contained in:
Jonas Kvinge 2020-07-07 23:02:24 +02:00
parent 24f2cfb29f
commit 4e003c12a6
7 changed files with 34 additions and 9 deletions

View File

@ -19,6 +19,7 @@
<file>html/oauthsuccess.html</file>
<file>pictures/strawberry.png</file>
<file>pictures/strawberry-faded.png</file>
<file>pictures/strawbs.png</file>
<file>pictures/nomusic.png</file>
<file>pictures/cdcase.png</file>
<file>pictures/musicbrainz.png</file>

BIN
data/pictures/strawbs.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 KiB

View File

@ -11,6 +11,14 @@
background-clip: content;
}
#playlist[strawbs_background_enabled = "true"] {
background-image: url(:pictures/strawbs.png);
background-attachment: fixed;
background-position: bottom right;
background-repeat: none;
background-clip: content;
}
QToolButton {
border: 2px solid transparent;
border-radius: 3px;

View File

@ -1128,6 +1128,7 @@ void PlaylistView::ReloadSettings() {
previous_background_image_ = QPixmap();
}
setProperty("default_background_enabled", background_image_type_ == AppearanceSettingsPage::BackgroundImageType_Default);
setProperty("strawbs_background_enabled", background_image_type_ == AppearanceSettingsPage::BackgroundImageType_Strawbs);
emit BackgroundPropertyChanged();
force_background_redraw_ = true;
}

View File

@ -105,8 +105,9 @@ AppearanceSettingsPage::AppearanceSettingsPage(SettingsDialog *dialog)
connect(ui_->use_default_background, SIGNAL(toggled(bool)), ui_->widget_custom_background_image_options, SLOT(setDisabled(bool)));
connect(ui_->use_no_background, SIGNAL(toggled(bool)), ui_->widget_custom_background_image_options, SLOT(setDisabled(bool)));
connect(ui_->use_custom_background_image, SIGNAL(toggled(bool)), ui_->widget_custom_background_image_options, SLOT(setEnabled(bool)));
connect(ui_->use_album_cover_background, SIGNAL(toggled(bool)), ui_->widget_custom_background_image_options, SLOT(setEnabled(bool)));
connect(ui_->use_strawbs_background, SIGNAL(toggled(bool)), ui_->widget_custom_background_image_options, SLOT(setDisabled(bool)));
connect(ui_->use_custom_background_image, SIGNAL(toggled(bool)), ui_->widget_custom_background_image_options, SLOT(setEnabled(bool)));
connect(ui_->select_background_image_filename_button, SIGNAL(pressed()), SLOT(SelectBackgroundImage()));
connect(ui_->use_custom_background_image, SIGNAL(toggled(bool)), ui_->background_image_filename, SLOT(setEnabled(bool)));
@ -165,18 +166,21 @@ void AppearanceSettingsPage::Load() {
ui_->use_a_custom_color_set->setChecked(original_use_a_custom_color_set_);
switch (background_image_type_) {
case BackgroundImageType_Default:
ui_->use_default_background->setChecked(true);
break;
case BackgroundImageType_None:
ui_->use_no_background->setChecked(true);
break;
case BackgroundImageType_Album:
ui_->use_album_cover_background->setChecked(true);
break;
case BackgroundImageType_Strawbs:
ui_->use_strawbs_background->setChecked(true);
break;
case BackgroundImageType_Custom:
ui_->use_custom_background_image->setChecked(true);
break;
case BackgroundImageType_Default:
default:
ui_->use_default_background->setChecked(true);
}
ui_->background_image_filename->setText(background_image_filename_);
@ -222,14 +226,17 @@ void AppearanceSettingsPage::Save() {
}
background_image_filename_ = ui_->background_image_filename->text();
if (ui_->use_no_background->isChecked()) {
if (ui_->use_default_background->isChecked()) {
background_image_type_ = BackgroundImageType_Default;
}
else if (ui_->use_no_background->isChecked()) {
background_image_type_ = BackgroundImageType_None;
}
else if (ui_->use_album_cover_background->isChecked()) {
background_image_type_ = BackgroundImageType_Album;
}
else if (ui_->use_default_background->isChecked()) {
background_image_type_ = BackgroundImageType_Default;
else if (ui_->use_strawbs_background->isChecked()) {
background_image_type_ = BackgroundImageType_Strawbs;
}
else if (ui_->use_custom_background_image->isChecked()) {
background_image_type_ = BackgroundImageType_Custom;

View File

@ -78,7 +78,8 @@ class AppearanceSettingsPage : public SettingsPage {
BackgroundImageType_Default,
BackgroundImageType_None,
BackgroundImageType_Custom,
BackgroundImageType_Album
BackgroundImageType_Album,
BackgroundImageType_Strawbs
};
enum BackgroundImagePosition {

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>674</width>
<height>865</height>
<height>896</height>
</rect>
</property>
<property name="windowTitle">
@ -169,6 +169,13 @@
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="use_strawbs_background">
<property name="text">
<string>A Taste of Strawbs</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="layout_custom_image">
<item>