diff --git a/app/settingsdialog.cpp b/app/settingsdialog.cpp index e95c927bc..74b67a462 100644 --- a/app/settingsdialog.cpp +++ b/app/settingsdialog.cpp @@ -66,6 +66,7 @@ const int BORDERSCOLUMN = 5; const int ACTIVITYCOLUMN = 6; const int SCREENTRACKERDEFAULTVALUE = 2500; +const int THEMEDEFAULTROUNDNESS = 0; //Breeze default value is used 0px. const QChar CheckMark{0x2714}; @@ -131,6 +132,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()); //! About Menu QMenuBar *menuBar = new QMenuBar(this); @@ -184,6 +186,10 @@ SettingsDialog::SettingsDialog(QWidget *parent, DockCorona *corona) updateApplyButtonsState(); }); + connect(ui->themeRoundnessSpinBox, QOverload::of(&QSpinBox::valueChanged), [ = ](int i) { + updateApplyButtonsState(); + }); + connect(ui->autostartChkBox, &QCheckBox::stateChanged, this, &SettingsDialog::updateApplyButtonsState); connect(ui->metaChkBox, &QCheckBox::stateChanged, this, &SettingsDialog::updateApplyButtonsState); connect(ui->infoWindowChkBox, &QCheckBox::stateChanged, this, &SettingsDialog::updateApplyButtonsState); @@ -746,6 +752,7 @@ void SettingsDialog::restoreDefaults() ui->noBordersForMaximizedChkBox->setChecked(false); ui->highSensitivityBtn->setChecked(true); ui->screenTrackerSpinBox->setValue(SCREENTRACKERDEFAULTVALUE); + ui->themeRoundnessSpinBox->setValue(THEMEDEFAULTROUNDNESS); } } @@ -945,6 +952,7 @@ QList SettingsDialog::currentSettings() settings << (int)ui->noBordersForMaximizedChkBox->isChecked(); settings << m_mouseSensitivityButtons->checkedId(); settings << ui->screenTrackerSpinBox->value(); + settings << ui->themeRoundnessSpinBox->value(); settings << m_model->rowCount(); return settings; @@ -1194,9 +1202,13 @@ void SettingsDialog::updateApplyButtonsState() } else if (ui->tabWidget->currentIndex() == 1) { //! Defaults for general Latte settings - if (!ui->autostartChkBox->isChecked() || ui->metaChkBox->isChecked() - || !ui->infoWindowChkBox->isChecked() || ui->noBordersForMaximizedChkBox->isChecked() - || !ui->highSensitivityBtn->isChecked() || ui->screenTrackerSpinBox->value() != SCREENTRACKERDEFAULTVALUE) { + if (!ui->autostartChkBox->isChecked() + || ui->metaChkBox->isChecked() + || !ui->infoWindowChkBox->isChecked() + || ui->noBordersForMaximizedChkBox->isChecked() + || !ui->highSensitivityBtn->isChecked() + || ui->screenTrackerSpinBox->value() != SCREENTRACKERDEFAULTVALUE + || ui->themeRoundnessSpinBox->value() != THEMEDEFAULTROUNDNESS) { ui->buttonBox->button(QDialogButtonBox::RestoreDefaults)->setEnabled(true); } else { ui->buttonBox->button(QDialogButtonBox::RestoreDefaults)->setEnabled(false); @@ -1326,6 +1338,7 @@ 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()); //! Update Layouts QStringList knownActivities = activities(); diff --git a/app/settingsdialog.ui b/app/settingsdialog.ui index d5c954cc6..0aae141d6 100644 --- a/app/settingsdialog.ui +++ b/app/settingsdialog.ui @@ -444,8 +444,8 @@ 0 0 - 798 - 505 + 805 + 518 @@ -896,6 +896,109 @@ This tracker is used in order to not lose any screen related update. + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + 75 + true + + + + Plasma Theme + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + Roundess used from Latte elements in order to feel part of the current plasma theme. + + + Background roundness + + + + + + + + 0 + 0 + + + + + 200 + 16777215 + + + + Roundess used from Latte elements in order to feel part of the current plasma theme. + + + + + + px. + + + 24 + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + diff --git a/app/universalsettings.cpp b/app/universalsettings.cpp index 44d4a9606..d09247ad1 100644 --- a/app/universalsettings.cpp +++ b/app/universalsettings.cpp @@ -51,6 +51,7 @@ 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); @@ -158,6 +159,21 @@ 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; @@ -442,6 +458,7 @@ 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)); @@ -458,6 +475,7 @@ 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 808352c31..23d6b2745 100644 --- a/app/universalsettings.h +++ b/app/universalsettings.h @@ -42,6 +42,9 @@ class UniversalSettings : public QObject Q_OBJECT 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) @@ -68,6 +71,9 @@ public: bool showInfoWindow() const; void setShowInfoWindow(bool show); + int plasmaThemeRoundness() const; + void setPlasmaThemeRoundness(int roundness); + int version() const; void setVersion(int ver); @@ -120,6 +126,7 @@ signals: void launchersChanged(); void layoutsMemoryUsageChanged(); void mouseSensitivityChanged(); + void plasmaThemeRoundnessChanged(); void runningActivitiesModelChanged(); void screenTrackerIntervalChanged(); void showInfoWindowChanged(); @@ -148,6 +155,9 @@ 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}; diff --git a/containment/package/contents/ui/PanelBox.qml b/containment/package/contents/ui/PanelBox.qml index ba8138180..05081f5a0 100644 --- a/containment/package/contents/ui/PanelBox.qml +++ b/containment/package/contents/ui/PanelBox.qml @@ -479,7 +479,7 @@ Item{ anchors.fill: solidBackground opacity: root.forceColorizeFromActiveWindowScheme ? solidBackground.opacity : 0 backgroundColor: root.forceColorizeFromActiveWindowScheme ? dock.visibility.touchingWindowScheme.backgroundColor : "transparent" - roundness: 4 + roundness: universalSettings ? universalSettings.plasmaThemeRoundness : 0 } PlasmaCore.FrameSvgItem{