From 0cea7e8622fcd648c6a73f5ac69b0d189e5817a0 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Fri, 26 Oct 2018 23:56:28 +0300 Subject: [PATCH] use roundness from extenededTheme in settings win --- app/plasmathemeextended.cpp | 2 ++ app/settingsdialog.cpp | 6 ++++-- app/settingsdialog.ui | 8 +++++--- app/universalsettings.cpp | 18 ------------------ app/universalsettings.h | 9 --------- 5 files changed, 11 insertions(+), 32 deletions(-) diff --git a/app/plasmathemeextended.cpp b/app/plasmathemeextended.cpp index f892bd99d..aa6e495fb 100644 --- a/app/plasmathemeextended.cpp +++ b/app/plasmathemeextended.cpp @@ -86,6 +86,8 @@ void PlasmaThemeExtended::loadConfig() void PlasmaThemeExtended::saveConfig() { m_themeGroup.writeEntry("userSetPlasmaThemeRoundness", m_userRoundness); + + m_themeGroup.sync(); } } diff --git a/app/settingsdialog.cpp b/app/settingsdialog.cpp index 74b67a462..648c7e3f5 100644 --- a/app/settingsdialog.cpp +++ b/app/settingsdialog.cpp @@ -25,6 +25,7 @@ #include "layout.h" #include "layoutmanager.h" #include "importer.h" +#include "plasmathemeextended.h" #include "universalsettings.h" #include "ui_settingsdialog.h" #include "../liblattedock/dock.h" @@ -132,7 +133,7 @@ SettingsDialog::SettingsDialog(QWidget *parent, DockCorona *corona) m_mouseSensitivityButtons->setExclusive(true); ui->screenTrackerSpinBox->setValue(m_corona->universalSettings()->screenTrackerInterval()); - ui->themeRoundnessSpinBox->setValue(m_corona->universalSettings()->plasmaThemeRoundness()); + ui->themeRoundnessSpinBox->setValue(m_corona->themeExtended()->userThemeRoundness()); //! About Menu QMenuBar *menuBar = new QMenuBar(this); @@ -1338,7 +1339,8 @@ bool SettingsDialog::saveAllChanges() m_corona->universalSettings()->setShowInfoWindow(showInfoWindow); m_corona->universalSettings()->setCanDisableBorders(noBordersForMaximized); m_corona->universalSettings()->setScreenTrackerInterval(ui->screenTrackerSpinBox->value()); - m_corona->universalSettings()->setPlasmaThemeRoundness(ui->themeRoundnessSpinBox->value()); + + m_corona->themeExtended()->setUserThemeRoundness(ui->themeRoundnessSpinBox->value()); //! Update Layouts QStringList knownActivities = activities(); diff --git a/app/settingsdialog.ui b/app/settingsdialog.ui index 7c8664580..3b521a3b4 100644 --- a/app/settingsdialog.ui +++ b/app/settingsdialog.ui @@ -946,10 +946,11 @@ This tracker is used in order to not lose any screen related update. - Roundness used from Latte elements in order to feel part of the current plasma theme. + Roundness used from Latte elements in order to feel part of the current plasma theme +when there are no other roundness information. - Background roundness + User set background roundness @@ -968,7 +969,8 @@ This tracker is used in order to not lose any screen related update. - Roundness used from Latte elements in order to feel part of the current plasma theme. + Roundness used from Latte elements in order to feel part of the current plasma theme +when there are no other roundness information. diff --git a/app/universalsettings.cpp b/app/universalsettings.cpp index d09247ad1..44d4a9606 100644 --- a/app/universalsettings.cpp +++ b/app/universalsettings.cpp @@ -51,7 +51,6 @@ UniversalSettings::UniversalSettings(KSharedConfig::Ptr config, QObject *parent) connect(this, &UniversalSettings::layoutsMemoryUsageChanged, this, &UniversalSettings::saveConfig); connect(this, &UniversalSettings::layoutsWindowSizeChanged, this, &UniversalSettings::saveConfig); connect(this, &UniversalSettings::mouseSensitivityChanged, this, &UniversalSettings::saveConfig); - connect(this, &UniversalSettings::plasmaThemeRoundnessChanged, this, &UniversalSettings::saveConfig); connect(this, &UniversalSettings::screenTrackerIntervalChanged, this, &UniversalSettings::saveConfig); connect(this, &UniversalSettings::showInfoWindowChanged, this, &UniversalSettings::saveConfig); connect(this, &UniversalSettings::versionChanged, this, &UniversalSettings::saveConfig); @@ -159,21 +158,6 @@ void UniversalSettings::load() parseGlobalShortcuts(); } -int UniversalSettings::plasmaThemeRoundness() const -{ - return m_plasmaThemeRoundness; -} - -void UniversalSettings::setPlasmaThemeRoundness(int roundness) -{ - if (m_plasmaThemeRoundness == roundness) { - return; - } - - m_plasmaThemeRoundness = roundness; - emit plasmaThemeRoundnessChanged(); -} - bool UniversalSettings::showInfoWindow() const { return m_showInfoWindow; @@ -458,7 +442,6 @@ void UniversalSettings::loadConfig() m_layoutsWindowSize = m_universalGroup.readEntry("layoutsWindowSize", QSize(700, 450)); m_layoutsColumnWidths = m_universalGroup.readEntry("layoutsColumnWidths", QStringList()); m_launchers = m_universalGroup.readEntry("launchers", QStringList()); - m_plasmaThemeRoundness = m_universalGroup.readEntry("plasmaThemeRoundness", 0); m_screenTrackerInterval = m_universalGroup.readEntry("screenTrackerInterval", 2500); m_showInfoWindow = m_universalGroup.readEntry("showInfoWindow", true); m_memoryUsage = static_cast(m_universalGroup.readEntry("memoryUsage", (int)Dock::SingleLayout)); @@ -475,7 +458,6 @@ void UniversalSettings::saveConfig() m_universalGroup.writeEntry("layoutsWindowSize", m_layoutsWindowSize); m_universalGroup.writeEntry("layoutsColumnWidths", m_layoutsColumnWidths); m_universalGroup.writeEntry("launchers", m_launchers); - m_universalGroup.writeEntry("plasmaThemeRoundness", m_plasmaThemeRoundness); m_universalGroup.writeEntry("screenTrackerInterval", m_screenTrackerInterval); m_universalGroup.writeEntry("showInfoWindow", m_showInfoWindow); m_universalGroup.writeEntry("memoryUsage", (int)m_memoryUsage); diff --git a/app/universalsettings.h b/app/universalsettings.h index 23d6b2745..89b29a488 100644 --- a/app/universalsettings.h +++ b/app/universalsettings.h @@ -43,8 +43,6 @@ class UniversalSettings : public QObject Q_PROPERTY(bool autostart READ autostart WRITE setAutostart NOTIFY autostartChanged) Q_PROPERTY(bool showInfoWindow READ showInfoWindow WRITE setShowInfoWindow NOTIFY showInfoWindowChanged) - Q_PROPERTY(int plasmaThemeRoundness READ plasmaThemeRoundness NOTIFY plasmaThemeRoundnessChanged) - Q_PROPERTY(QString currentLayoutName READ currentLayoutName WRITE setCurrentLayoutName NOTIFY currentLayoutNameChanged) Q_PROPERTY(QStringList badgesForActivate READ badgesForActivate NOTIFY badgesForActivateChanged) @@ -71,9 +69,6 @@ public: bool showInfoWindow() const; void setShowInfoWindow(bool show); - int plasmaThemeRoundness() const; - void setPlasmaThemeRoundness(int roundness); - int version() const; void setVersion(int ver); @@ -126,7 +121,6 @@ signals: void launchersChanged(); void layoutsMemoryUsageChanged(); void mouseSensitivityChanged(); - void plasmaThemeRoundnessChanged(); void runningActivitiesModelChanged(); void screenTrackerIntervalChanged(); void showInfoWindowChanged(); @@ -155,9 +149,6 @@ private: bool m_canDisableBorders{false}; bool m_showInfoWindow{true}; - //! this Breeze default value - int m_plasmaThemeRoundness{0}; - //when there isnt a version it is an old universal file int m_version{1};