From a787567bf28b17305370a9f3db7a9aef3cb58000 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Thu, 30 Jul 2020 14:49:37 +0300 Subject: [PATCH] settings:apply new background properties properly --- .../controllers/layoutscontroller.cpp | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/app/settings/controllers/layoutscontroller.cpp b/app/settings/controllers/layoutscontroller.cpp index ab1bc796e..bfadc74e7 100644 --- a/app/settings/controllers/layoutscontroller.cpp +++ b/app/settings/controllers/layoutscontroller.cpp @@ -723,26 +723,26 @@ void Layouts::save() generic->unlock(); } - /* if (iLayoutCurrentData.color.startsWith("/")) { - //it is image file in such case - if (iLayoutCurrentData.color != generic->background()) { - generic->setBackground(iLayoutCurrentData.color); - } + //! Backgrounds + if (generic->backgroundStyle() != iLayoutCurrentData.backgroundStyle) { + generic->setBackgroundStyle(iLayoutCurrentData.backgroundStyle); + } - if (generic->textColor() != iLayoutCurrentData.textColor) { - generic->setTextColor(iLayoutCurrentData.textColor); - } - } else { - if (iLayoutCurrentData.color != generic->color()) { - generic->setColor(iLayoutCurrentData.color); - generic->setBackground(QString()); - generic->setTextColor(QString()); - } - }*/ + if (generic->color() != iLayoutCurrentData.color) { + generic->setColor(iLayoutCurrentData.color); + } + + if (generic->customBackground() != iLayoutCurrentData.background) { + generic->setCustomBackground(iLayoutCurrentData.background); + } + + if (generic->customTextColor() != iLayoutCurrentData.textColor) { + generic->setCustomTextColor(iLayoutCurrentData.textColor); + } //! update only the Central-specific layout parts CentralLayout *centralActive = isOriginalLayout ? m_handler->corona()->layoutsManager()->synchronizer()->centralLayout(iLayoutOriginalData.name) : nullptr; - CentralLayout *central = centralActive ? centralActive : m_layouts[iLayoutCurrentData.id]; + CentralLayout *central = centralActive ? centralActive : m_layouts[iLayoutCurrentData.id]; if (central->showInMenu() != iLayoutCurrentData.isShownInMenu) { central->setShowInMenu(iLayoutCurrentData.isShownInMenu);