mirror of
https://github.com/KDE/latte-dock.git
synced 2024-12-24 17:33:50 +03:00
drop manual roundness setting from code
--as the new automatic mechanism works nice the old manual setting of plasma theme roundness is not needed
This commit is contained in:
parent
b6c272d6a9
commit
ff53a23cac
@ -64,8 +64,6 @@ void Package::initPackage(KPackage::Package *package)
|
||||
package->addFileDefinition("preset4", QStringLiteral("presets/Extended.layout.latte"), i18n("extended preset file"));
|
||||
package->addFileDefinition("preset10", QStringLiteral("presets/multiple-layouts_hidden.layout.latte"), i18n("multiple layouts hidden file"));
|
||||
|
||||
package->addFileDefinition("themesExtendedInfo", QStringLiteral("themes/themesExtendedInforc"), i18n("a file that contains extended information for plasma themes"));
|
||||
|
||||
package->addFileDefinition("backgroundTracer", QStringLiteral("scripting/BackgroundTracer.qml"), i18n("a qml file that is used to publish broadcasted backgrounds"));
|
||||
|
||||
package->setFallbackPackage(fallback);
|
||||
|
@ -52,9 +52,6 @@ Theme::Theme(KSharedConfig::Ptr config, QObject *parent) :
|
||||
loadConfig();
|
||||
|
||||
connect(this, &Theme::outlineWidthChanged, this, &Theme::saveConfig);
|
||||
connect(this, &Theme::userSetRoundnessChanged, this, &Theme::saveConfig);
|
||||
|
||||
connect(this, &Theme::userSetRoundnessChanged, this, &Theme::roundnessChanged);
|
||||
|
||||
connect(&m_theme, &Plasma::Theme::themeChanged, this, &Theme::hasShadowChanged);
|
||||
connect(&m_theme, &Plasma::Theme::themeChanged, this, &Theme::load);
|
||||
@ -64,8 +61,7 @@ Theme::Theme(KSharedConfig::Ptr config, QObject *parent) :
|
||||
void Theme::load()
|
||||
{
|
||||
loadThemePaths();
|
||||
// loadRoundness();
|
||||
loadRoundnessFromSvgs();
|
||||
loadRoundness();
|
||||
}
|
||||
|
||||
Theme::~Theme()
|
||||
@ -91,11 +87,6 @@ bool Theme::isDarkTheme() const
|
||||
return !m_isLightTheme;
|
||||
}
|
||||
|
||||
bool Theme::themeHasExtendedInfo() const
|
||||
{
|
||||
return m_themeHasExtendedInfo;
|
||||
}
|
||||
|
||||
int Theme::bottomEdgeRoundness() const
|
||||
{
|
||||
return m_bottomEdgeRoundness;
|
||||
@ -131,22 +122,6 @@ void Theme::setOutlineWidth(int width)
|
||||
emit outlineWidthChanged();
|
||||
}
|
||||
|
||||
int Theme::userThemeRoundness() const
|
||||
{
|
||||
return m_userRoundness;
|
||||
}
|
||||
|
||||
void Theme::setUserThemeRoundness(int roundness)
|
||||
{
|
||||
if (m_userRoundness == roundness) {
|
||||
return;
|
||||
}
|
||||
|
||||
m_userRoundness = roundness;
|
||||
|
||||
emit userSetRoundnessChanged();
|
||||
}
|
||||
|
||||
float Theme::backgroundMaxOpacity() const
|
||||
{
|
||||
return m_backgroundMaxOpacity;
|
||||
@ -343,7 +318,7 @@ int Theme::roundness(Plasma::FrameSvg *svg, Plasma::Types::Location edge)
|
||||
return round;
|
||||
}
|
||||
|
||||
void Theme::loadRoundnessFromSvgs()
|
||||
void Theme::loadRoundness()
|
||||
{
|
||||
Plasma::FrameSvg *svg = new Plasma::FrameSvg(this);
|
||||
svg->setImagePath(QStringLiteral("widgets/panel-background"));
|
||||
@ -391,6 +366,8 @@ void Theme::loadRoundnessFromSvgs()
|
||||
emit roundnessChanged();
|
||||
}
|
||||
|
||||
/*DEPRECATED CAN BE REMOVED*/
|
||||
/*
|
||||
void Theme::loadRoundness()
|
||||
{
|
||||
if (!m_corona) {
|
||||
@ -432,6 +409,7 @@ void Theme::loadRoundness()
|
||||
|
||||
emit roundnessChanged();
|
||||
}
|
||||
*/
|
||||
|
||||
void Theme::loadThemePaths()
|
||||
{
|
||||
@ -610,13 +588,11 @@ void Theme::loadThemeLightness()
|
||||
|
||||
void Theme::loadConfig()
|
||||
{
|
||||
setUserThemeRoundness(m_themeGroup.readEntry("userSetPlasmaThemeRoundness", -1));
|
||||
setOutlineWidth(m_themeGroup.readEntry("outlineWidth", 1));
|
||||
}
|
||||
|
||||
void Theme::saveConfig()
|
||||
{
|
||||
m_themeGroup.writeEntry("userSetPlasmaThemeRoundness", m_userRoundness);
|
||||
m_themeGroup.writeEntry("outlineWidth", m_outlineWidth);
|
||||
|
||||
m_themeGroup.sync();
|
||||
|
@ -82,9 +82,6 @@ public:
|
||||
int outlineWidth() const;
|
||||
void setOutlineWidth(int width);
|
||||
|
||||
int userThemeRoundness() const;
|
||||
void setUserThemeRoundness(int roundness);
|
||||
|
||||
float backgroundMaxOpacity() const;
|
||||
|
||||
SchemeColors *defaultTheme() const;
|
||||
@ -99,7 +96,6 @@ signals:
|
||||
void outlineWidthChanged();
|
||||
void roundnessChanged();
|
||||
void themeChanged();
|
||||
void userSetRoundnessChanged();
|
||||
|
||||
private slots:
|
||||
void loadConfig();
|
||||
@ -109,7 +105,6 @@ private slots:
|
||||
private:
|
||||
void loadThemePaths();
|
||||
void loadRoundness();
|
||||
void loadRoundnessFromSvgs();
|
||||
|
||||
void setOriginalSchemeFile(const QString &file);
|
||||
void parseThemeSvgFiles();
|
||||
@ -118,19 +113,15 @@ private:
|
||||
void updateReversedScheme();
|
||||
void updateReversedSchemeValues();
|
||||
|
||||
bool themeHasExtendedInfo() const;
|
||||
|
||||
int roundness(Plasma::FrameSvg *svg, Plasma::Types::Location edge);
|
||||
private:
|
||||
bool m_isLightTheme{false};
|
||||
bool m_themeHasExtendedInfo{false};
|
||||
|
||||
int m_bottomEdgeRoundness{0};
|
||||
int m_leftEdgeRoundness{0};
|
||||
int m_topEdgeRoundness{0};
|
||||
int m_rightEdgeRoundness{0};
|
||||
int m_outlineWidth{1};
|
||||
int m_userRoundness{-1};
|
||||
|
||||
float m_backgroundMaxOpacity{1};
|
||||
|
||||
|
@ -70,7 +70,6 @@ const int BORDERSCOLUMN = 5;
|
||||
const int ACTIVITYCOLUMN = 6;
|
||||
|
||||
const int SCREENTRACKERDEFAULTVALUE = 2500;
|
||||
const int THEMEDEFAULTROUNDNESS = 0; //Breeze default value is used 0px.
|
||||
const int OUTLINEDEFAULTWIDTH = 1;
|
||||
|
||||
const QChar CheckMark{0x2714};
|
||||
@ -137,8 +136,6 @@ SettingsDialog::SettingsDialog(QWidget *parent, Latte::Corona *corona)
|
||||
m_mouseSensitivityButtons->setExclusive(true);
|
||||
|
||||
ui->screenTrackerSpinBox->setValue(m_corona->universalSettings()->screenTrackerInterval());
|
||||
ui->themeRoundnessSpinBox->setSpecialValueText(i18nc("automatic background roundness","Automatic"));
|
||||
ui->themeRoundnessSpinBox->setValue(m_corona->themeExtended()->userThemeRoundness());
|
||||
ui->outlineSpinBox->setValue(m_corona->themeExtended()->outlineWidth());
|
||||
|
||||
//! About Menu
|
||||
@ -193,10 +190,6 @@ SettingsDialog::SettingsDialog(QWidget *parent, Latte::Corona *corona)
|
||||
updateApplyButtonsState();
|
||||
});
|
||||
|
||||
connect(ui->themeRoundnessSpinBox, QOverload<int>::of(&QSpinBox::valueChanged), [ = ](int i) {
|
||||
updateApplyButtonsState();
|
||||
});
|
||||
|
||||
connect(ui->outlineSpinBox, QOverload<int>::of(&QSpinBox::valueChanged), [ = ](int i) {
|
||||
updateApplyButtonsState();
|
||||
});
|
||||
@ -765,7 +758,6 @@ void SettingsDialog::restoreDefaults()
|
||||
ui->noBordersForMaximizedChkBox->setChecked(false);
|
||||
ui->highSensitivityBtn->setChecked(true);
|
||||
ui->screenTrackerSpinBox->setValue(SCREENTRACKERDEFAULTVALUE);
|
||||
ui->themeRoundnessSpinBox->setValue(THEMEDEFAULTROUNDNESS);
|
||||
ui->outlineSpinBox->setValue(OUTLINEDEFAULTWIDTH);
|
||||
}
|
||||
}
|
||||
@ -968,7 +960,6 @@ QList<int> SettingsDialog::currentSettings()
|
||||
settings << (int)ui->noBordersForMaximizedChkBox->isChecked();
|
||||
settings << m_mouseSensitivityButtons->checkedId();
|
||||
settings << ui->screenTrackerSpinBox->value();
|
||||
settings << ui->themeRoundnessSpinBox->value();
|
||||
settings << ui->outlineSpinBox->value();
|
||||
settings << m_model->rowCount();
|
||||
|
||||
@ -1226,7 +1217,6 @@ void SettingsDialog::updateApplyButtonsState()
|
||||
|| ui->noBordersForMaximizedChkBox->isChecked()
|
||||
|| !ui->highSensitivityBtn->isChecked()
|
||||
|| ui->screenTrackerSpinBox->value() != SCREENTRACKERDEFAULTVALUE
|
||||
|| ui->themeRoundnessSpinBox->value() != THEMEDEFAULTROUNDNESS
|
||||
|| ui->outlineSpinBox->value() != OUTLINEDEFAULTWIDTH ) {
|
||||
ui->buttonBox->button(QDialogButtonBox::RestoreDefaults)->setEnabled(true);
|
||||
} else {
|
||||
@ -1360,7 +1350,6 @@ bool SettingsDialog::saveAllChanges()
|
||||
m_corona->universalSettings()->setCanDisableBorders(noBordersForMaximized);
|
||||
m_corona->universalSettings()->setScreenTrackerInterval(ui->screenTrackerSpinBox->value());
|
||||
|
||||
m_corona->themeExtended()->setUserThemeRoundness(ui->themeRoundnessSpinBox->value());
|
||||
m_corona->themeExtended()->setOutlineWidth(ui->outlineSpinBox->value());
|
||||
|
||||
//! Update Layouts
|
||||
|
@ -444,8 +444,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>885</width>
|
||||
<height>613</height>
|
||||
<width>894</width>
|
||||
<height>594</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_9">
|
||||
@ -984,84 +984,6 @@ This tracker is used in order to not lose any screen related update.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_12">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_12">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="plasmaRoundnessLbl">
|
||||
<property name="toolTip">
|
||||
<string>Roundness used from Latte elements in order to feel part of the current plasma theme</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Background roundness</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="themeRoundnessSpinBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Roundness used from Latte elements in order to feel part of the current plasma theme
|
||||
when there are no other roundness information.</string>
|
||||
</property>
|
||||
<property name="specialValueText">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string> px.</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>-1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>32</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_13">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_15">
|
||||
<item>
|
||||
|
@ -1,9 +0,0 @@
|
||||
[Roundness]
|
||||
Breeze=0
|
||||
Air=3
|
||||
Oxygen=6
|
||||
Arc=4
|
||||
Materia=4
|
||||
Adapta=4
|
||||
Elegant=3
|
||||
UnityAmbiance=0
|
Loading…
Reference in New Issue
Block a user