mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-02-23 19:49:43 +01:00
Disable input boxes if using location services to fetch location
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user