Skip to content

Commit

Permalink
Fix color of location permission label
Browse files Browse the repository at this point in the history
  • Loading branch information
t1m0thyj committed Nov 9, 2024
1 parent fe5de36 commit a35cb14
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/DarkUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
6 changes: 4 additions & 2 deletions src/ScheduleDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
5 changes: 4 additions & 1 deletion src/UwpLocation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace WinDynamicDesktop
class UwpLocation
{
private static readonly Func<string, string> _ = Localization.GetTranslation;
public static Exception lastUpdateError;

private static async Task<bool> UnsafeRequestAccess()
{
Expand Down Expand Up @@ -68,7 +69,9 @@ public static async Task<bool> UpdateGeoposition()

return true;
}
catch { /* Do nothing */ }
catch (Exception exc) {
lastUpdateError = exc;
}

return false;
}
Expand Down

0 comments on commit a35cb14

Please sign in to comment.