diff --git a/src/DarkUI.cs b/src/DarkUI.cs index 7f048ed..49675a1 100644 --- a/src/DarkUI.cs +++ b/src/DarkUI.cs @@ -12,8 +12,8 @@ namespace WinDynamicDesktop { internal class DarkUI { - private static readonly Color bgColorDark = Color.FromArgb(32, 32, 32); - private static readonly Color fgColorDark = Color.FromArgb(224, 224, 224); + public static readonly Color bgColorDark = Color.FromArgb(32, 32, 32); + public static readonly Color fgColorDark = Color.FromArgb(224, 224, 224); public static bool IsDark { diff --git a/src/ScheduleDialog.cs b/src/ScheduleDialog.cs index 436f2d6..d0d79e3 100644 --- a/src/ScheduleDialog.cs +++ b/src/ScheduleDialog.cs @@ -54,7 +54,7 @@ private void UpdateGuiState() { if (!hasLocationPermission) { - locationPermissionLabel.ForeColor = SystemColors.ControlText; + locationPermissionLabel.ForeColor = DarkUI.IsDark ? DarkUI.fgColorDark : default; locationPermissionLabel.Text = _("Click below to grant permission to access location"); } else @@ -180,7 +180,9 @@ private async void okButton_Click(object sender, EventArgs e) { hasLocationPermission = UwpLocation.HasAccess(); UpdateLocationState(); - MessageDialog.ShowWarning(_("Failed to get location from Windows location service."), _("Error")); + MessageDialog.ShowWarning(string.Format( + _("Failed to get location from Windows location service:\n\n{0}"), + UwpLocation.lastUpdateError.ToString()), _("Error")); } } else if (radioButton3.Checked) diff --git a/src/UwpLocation.cs b/src/UwpLocation.cs index e2dd0d2..2e42d6f 100644 --- a/src/UwpLocation.cs +++ b/src/UwpLocation.cs @@ -10,6 +10,7 @@ namespace WinDynamicDesktop class UwpLocation { private static readonly Func _ = Localization.GetTranslation; + public static Exception lastUpdateError; private static async Task UnsafeRequestAccess() { @@ -68,7 +69,9 @@ public static async Task UpdateGeoposition() return true; } - catch { /* Do nothing */ } + catch (Exception exc) { + lastUpdateError = exc; + } return false; }