From 4f0a2515f8ac511ae91307d8ab3e8bcb74ae6358 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Fri, 5 Jul 2019 01:07:19 +0200 Subject: [PATCH] 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 --- src/settings/appearancesettingspage.cpp | 8 ++++---- src/settings/appearancesettingspage.ui | 25 +++++++++++++++++++------ 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/src/settings/appearancesettingspage.cpp b/src/settings/appearancesettingspage.cpp index 0d1cad45c..15c213f83 100644 --- a/src/settings/appearancesettingspage.cpp +++ b/src/settings/appearancesettingspage.cpp @@ -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_->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(); } @@ -159,10 +161,8 @@ void AppearanceSettingsPage::Load() { ui_->opacity_slider->setValue(s.value(kOpacityLevel, kDefaultOpacityLevel).toInt()); ui_->checkbox_system_icons->setChecked(s.value(kSystemThemeIcons, false).toBool()); - if (!ui_->checkbox_background_image_stretch->isChecked()) { - ui_->checkbox_background_image_do_not_cut->setDisabled(true); - ui_->checkbox_background_image_keep_aspect_ratio->setDisabled(true); - } + ui_->checkbox_background_image_keep_aspect_ratio->setEnabled(ui_->checkbox_background_image_stretch->isChecked()); + ui_->checkbox_background_image_do_not_cut->setEnabled(ui_->checkbox_background_image_stretch->isChecked() && ui_->checkbox_background_image_keep_aspect_ratio->isChecked()); s.endGroup(); diff --git a/src/settings/appearancesettingspage.ui b/src/settings/appearancesettingspage.ui index 88c554ed2..a6d2b1905 100644 --- a/src/settings/appearancesettingspage.ui +++ b/src/settings/appearancesettingspage.ui @@ -6,7 +6,7 @@ 0 0 - 596 + 674 627 @@ -264,7 +264,14 @@ - Stretch background image to fill playlist background + Stretch image to fill playlist + + + + + + + Keep aspect ratio @@ -276,11 +283,17 @@ - - - Keep aspect ratio + + + Qt::Horizontal - + + + 40 + 20 + + +