Schedule page: Force valid sunrise and sunset times
This commit is contained in:
@@ -30,6 +30,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
|||||||
<property name="margin-top">12</property>
|
<property name="margin-top">12</property>
|
||||||
<property name="margin-bottom">12</property>
|
<property name="margin-bottom">12</property>
|
||||||
<property name="valign">center</property>
|
<property name="valign">center</property>
|
||||||
|
<signal name="notify::time" handler="onSunriseTimeChanged"/>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
@@ -42,6 +43,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
|||||||
<property name="margin-top">12</property>
|
<property name="margin-top">12</property>
|
||||||
<property name="margin-bottom">12</property>
|
<property name="margin-bottom">12</property>
|
||||||
<property name="valign">center</property>
|
<property name="valign">center</property>
|
||||||
|
<signal name="notify::time" handler="onSunsetTimeChanged"/>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
|||||||
@@ -34,4 +34,14 @@ var SchedulePage = GObject.registerClass({
|
|||||||
});
|
});
|
||||||
this._keyboard_shortcut_button.keybinding = settings.get_strv('nightthemeswitcher-ondemand-keybinding')[0];
|
this._keyboard_shortcut_button.keybinding = settings.get_strv('nightthemeswitcher-ondemand-keybinding')[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onSunriseTimeChanged(_chooser) {
|
||||||
|
if (this._schedule_sunrise_time_chooser.time >= this._schedule_sunset_time_chooser.time)
|
||||||
|
this._schedule_sunset_time_chooser.time = this._schedule_sunrise_time_chooser.time + 1 / 60;
|
||||||
|
}
|
||||||
|
|
||||||
|
onSunsetTimeChanged(_chooser) {
|
||||||
|
if (this._schedule_sunset_time_chooser.time <= this._schedule_sunrise_time_chooser.time)
|
||||||
|
this._schedule_sunrise_time_chooser.time = this._schedule_sunset_time_chooser.time - 1 / 60;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user