quicksettings/nightcolor: Fix functionality, update to new changes to config

This commit is contained in:
Devin Lin 2022-09-10 14:22:39 -04:00
parent e9dad0651c
commit 419de3fbe7
3 changed files with 6 additions and 17 deletions

View file

@ -9,17 +9,11 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
<kcfgfile name="kwinrc"/>
<kcfgfile name="kwinrc" />
<group name="NightColor">
<entry name="ActiveEnabled" type="Bool">
<default>true</default>
</entry>
<entry name="Active" type="Bool">
<default>false</default>
</entry>
<entry name="ModeEnabled" type="Bool">
<default>true</default>
</entry>
<entry name="Mode" type="Enum">
<choices name="ColorCorrect::NightColorMode">
<choice name="Automatic"/>
@ -29,13 +23,11 @@
</choices>
<default>Automatic</default>
</entry>
<entry name="NightTemperatureEnabled" type="Bool">
<default>true</default>
<entry name="DayTemperature" type="Int">
<default>6500</default>
</entry>
<entry name="NightTemperature" type="Int">
<default>4500</default>
<min>1000</min>
<max>6500</max>
</entry>
<entry name="LatitudeAuto" type="Double">
<default>0.</default>
@ -43,9 +35,6 @@
<entry name="LongitudeAuto" type="Double">
<default>0.</default>
</entry>
<entry name="LocationEnabled" type="Bool">
<default>true</default>
</entry>
<entry name="LatitudeFixed" type="Double">
<default>0.</default>
</entry>
@ -63,3 +52,5 @@
</entry>
</group>
</kcfg>

View file

@ -33,9 +33,7 @@ bool NightColorUtil::enabled()
void NightColorUtil::setEnabled(bool enabled)
{
m_settings->setModeEnabled(true);
m_settings->setMode(ColorCorrect::NightColorMode::Constant);
m_settings->setActiveEnabled(true);
m_settings->setActive(enabled);
m_settings->save();
}

View file

@ -31,5 +31,5 @@ public Q_SLOTS:
private:
bool m_enabled;
OrgKdeKwinColorCorrectInterface *m_ccInterface;
NightColorSettings *const m_settings;
NightColorSettings *m_settings;
};