mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 02:36:19 +02:00
[Light Switch] Changed the rules surrounding the max/min value of the Offset field (#45125)
<!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request This PR introduces new logic that dictates the max and min value for the `Offset` field that the user can change when using Sunrise to Sunset mode. <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist - [x] Closes: #44959 <!-- - [ ] Closes: #yyy (add separate lines for additional resolved issues) --> - [x] **Communication:** I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected <!-- Provide a more detailed description of the PR, other things fixed, or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments The new logic is as follows: - The sunrise offset cannot go into the previous day and cannot overlap the current sunset transition time - The sunset offset cannot overlap the last sunrise time and cannot overlap into the next day. These values are dynamic and update when the VM updates with new times. <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed - Manual testing
This commit is contained in:
@@ -112,8 +112,8 @@
|
||||
<controls:IsEnabledTextBlock x:Uid="LightSwitch_SunriseText" VerticalAlignment="Center" />
|
||||
<NumberBox
|
||||
AutomationProperties.AutomationId="SunriseOffset_LightSwitch"
|
||||
Maximum="60"
|
||||
Minimum="-60"
|
||||
Maximum="{x:Bind ViewModel.SunriseOffsetMax, Mode=OneWay}"
|
||||
Minimum="{x:Bind ViewModel.SunriseOffsetMin, Mode=OneWay}"
|
||||
SpinButtonPlacementMode="Compact"
|
||||
Value="{x:Bind ViewModel.SunriseOffset, Mode=TwoWay}" />
|
||||
</StackPanel>
|
||||
@@ -121,8 +121,8 @@
|
||||
<controls:IsEnabledTextBlock x:Uid="LightSwitch_SunsetText" VerticalAlignment="Center" />
|
||||
<NumberBox
|
||||
AutomationProperties.AutomationId="SunsetOffset_LightSwitch"
|
||||
Maximum="60"
|
||||
Minimum="-60"
|
||||
Maximum="{x:Bind ViewModel.SunsetOffsetMax, Mode=OneWay}"
|
||||
Minimum="{x:Bind ViewModel.SunsetOffsetMin, Mode=OneWay}"
|
||||
SpinButtonPlacementMode="Compact"
|
||||
Value="{x:Bind ViewModel.SunsetOffset, Mode=TwoWay}" />
|
||||
</StackPanel>
|
||||
|
||||
Reference in New Issue
Block a user