Commit 8e8b6145 authored by Natalie Clarius's avatar Natalie Clarius Committed by Nate Graham
Browse files

plugins/nightcolor: add configurable day temperature

BUG: 390021
parent 6b38b037
Pipeline #225581 failed with stage
in 16 minutes and 41 seconds
......@@ -14,7 +14,7 @@ namespace KWin
static const int MSC_DAY = 86400000;
static const int MIN_TEMPERATURE = 1000;
static const int NEUTRAL_TEMPERATURE = 6500;
static const int DEFAULT_DAY_TEMPERATURE = 6500;
static const int DEFAULT_NIGHT_TEMPERATURE = 4500;
static const int FALLBACK_SLOW_UPDATE_TIME = 1800000; /* 30 minutes */
......
......@@ -266,7 +266,8 @@ void NightColorManager::readConfig()
break;
}
m_nightTargetTemp = qBound(MIN_TEMPERATURE, s->nightTemperature(), NEUTRAL_TEMPERATURE);
m_dayTargetTemp = qBound(MIN_TEMPERATURE, s->dayTemperature(), DEFAULT_DAY_TEMPERATURE);
m_nightTargetTemp = qBound(MIN_TEMPERATURE, s->nightTemperature(), DEFAULT_DAY_TEMPERATURE);
double lat, lng;
auto correctReadin = [&lat, &lng]() {
......@@ -628,7 +629,7 @@ bool NightColorManager::daylight() const
int NightColorManager::currentTargetTemp() const
{
if (!m_running) {
return NEUTRAL_TEMPERATURE;
return DEFAULT_DAY_TEMPERATURE;
}
if (m_mode == NightColorMode::Constant) {
......
......@@ -300,9 +300,9 @@ private:
QTimer *m_quickAdjustTimer = nullptr;
QTimer *m_previewTimer = nullptr;
int m_currentTemp = NEUTRAL_TEMPERATURE;
int m_targetTemperature = NEUTRAL_TEMPERATURE;
int m_dayTargetTemp = NEUTRAL_TEMPERATURE;
int m_currentTemp = DEFAULT_DAY_TEMPERATURE;
int m_targetTemperature = DEFAULT_DAY_TEMPERATURE;
int m_dayTargetTemp = DEFAULT_DAY_TEMPERATURE;
int m_nightTargetTemp = DEFAULT_NIGHT_TEMPERATURE;
int m_inhibitReferenceCount = 0;
......
......@@ -17,6 +17,9 @@
</choices>
<default>NightColorMode::Automatic</default>
</entry>
<entry name="DayTemperature" type="Int">
<default>6500</default>
</entry>
<entry name="NightTemperature" type="Int">
<default>4500</default>
</entry>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment