1
0
mirror of https://github.com/strawberrymusicplayer/strawberry synced 2025-01-15 10:08:08 +01:00

Tweak the background image settings a bit

- Disable "do not cut" option when keep aspect ratio is unchecked
- Shorten text and add spacer to widget
This commit is contained in:
Jonas Kvinge 2019-07-05 01:07:19 +02:00
parent 5cde33711e
commit 4f0a2515f8
2 changed files with 23 additions and 10 deletions

View File

@ -99,6 +99,8 @@ AppearanceSettingsPage::AppearanceSettingsPage(SettingsDialog *dialog)
connect(ui_->checkbox_background_image_stretch, SIGNAL(toggled(bool)), ui_->checkbox_background_image_keep_aspect_ratio, SLOT(setEnabled(bool))); connect(ui_->checkbox_background_image_stretch, SIGNAL(toggled(bool)), ui_->checkbox_background_image_keep_aspect_ratio, SLOT(setEnabled(bool)));
connect(ui_->checkbox_background_image_stretch, SIGNAL(toggled(bool)), ui_->spinbox_background_image_maxsize, SLOT(setDisabled(bool))); connect(ui_->checkbox_background_image_stretch, SIGNAL(toggled(bool)), ui_->spinbox_background_image_maxsize, SLOT(setDisabled(bool)));
connect(ui_->checkbox_background_image_keep_aspect_ratio, SIGNAL(toggled(bool)), ui_->checkbox_background_image_do_not_cut, SLOT(setEnabled(bool)));
Load(); Load();
} }
@ -159,10 +161,8 @@ void AppearanceSettingsPage::Load() {
ui_->opacity_slider->setValue(s.value(kOpacityLevel, kDefaultOpacityLevel).toInt()); ui_->opacity_slider->setValue(s.value(kOpacityLevel, kDefaultOpacityLevel).toInt());
ui_->checkbox_system_icons->setChecked(s.value(kSystemThemeIcons, false).toBool()); ui_->checkbox_system_icons->setChecked(s.value(kSystemThemeIcons, false).toBool());
if (!ui_->checkbox_background_image_stretch->isChecked()) { ui_->checkbox_background_image_keep_aspect_ratio->setEnabled(ui_->checkbox_background_image_stretch->isChecked());
ui_->checkbox_background_image_do_not_cut->setDisabled(true); ui_->checkbox_background_image_do_not_cut->setEnabled(ui_->checkbox_background_image_stretch->isChecked() && ui_->checkbox_background_image_keep_aspect_ratio->isChecked());
ui_->checkbox_background_image_keep_aspect_ratio->setDisabled(true);
}
s.endGroup(); s.endGroup();

View File

@ -6,7 +6,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>596</width> <width>674</width>
<height>627</height> <height>627</height>
</rect> </rect>
</property> </property>
@ -264,7 +264,14 @@
<item> <item>
<widget class="QCheckBox" name="checkbox_background_image_stretch"> <widget class="QCheckBox" name="checkbox_background_image_stretch">
<property name="text"> <property name="text">
<string>Stretch background image to fill playlist background</string> <string>Stretch image to fill playlist</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkbox_background_image_keep_aspect_ratio">
<property name="text">
<string>Keep aspect ratio</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -276,11 +283,17 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QCheckBox" name="checkbox_background_image_keep_aspect_ratio"> <spacer name="spacer_background_image_stretch">
<property name="text"> <property name="orientation">
<string>Keep aspect ratio</string> <enum>Qt::Horizontal</enum>
</property> </property>
</widget> <property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item> </item>
</layout> </layout>
</widget> </widget>