Disable input boxes if using location services to fetch location

This commit is contained in:
Jaylyn Barbee
2025-11-05 09:15:33 -05:00
parent 814eb78a27
commit 3b1dfeb920
2 changed files with 8 additions and 0 deletions

View File

@@ -255,6 +255,7 @@
</Grid.ColumnDefinitions>
<NumberBox
x:Uid="LightSwitch_LatitudeBox"
x:Name="LatitudeBox"
Maximum="90"
Minimum="-90"
PlaceholderText="52"
@@ -262,6 +263,7 @@
ValueChanged="LatLonBox_ValueChanged" />
<NumberBox
x:Uid="LightSwitch_LongitudeBox"
x:Name="LongitudeBox"
Grid.Column="1"
Maximum="180"
Minimum="-180"

View File

@@ -91,6 +91,8 @@ namespace Microsoft.PowerToys.Settings.UI.Views
private async void GetGeoLocation_Click(object sender, RoutedEventArgs e)
{
LatitudeBox.IsEnabled = false;
LongitudeBox.IsEnabled = false;
SyncButton.IsEnabled = false;
SyncLoader.IsActive = true;
SyncLoader.Visibility = Visibility.Visible;
@@ -136,12 +138,16 @@ namespace Microsoft.PowerToys.Settings.UI.Views
SyncLoader.IsActive = false;
SyncLoader.Visibility = Visibility.Collapsed;
LocationDialog.IsPrimaryButtonEnabled = true;
LatitudeBox.IsEnabled = true;
LongitudeBox.IsEnabled = true;
LocationResultPanel.Visibility = Visibility.Visible;
}
catch (Exception ex)
{
SyncButton.IsEnabled = true;
SyncLoader.IsActive = false;
LatitudeBox.IsEnabled = true;
LongitudeBox.IsEnabled = true;
System.Diagnostics.Debug.WriteLine("Location error: " + ex.Message);
}
}