Skip to content

Commit a35cb14

Browse files
committed
Fix color of location permission label
1 parent fe5de36 commit a35cb14

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

src/DarkUI.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ namespace WinDynamicDesktop
1212
{
1313
internal class DarkUI
1414
{
15-
private static readonly Color bgColorDark = Color.FromArgb(32, 32, 32);
16-
private static readonly Color fgColorDark = Color.FromArgb(224, 224, 224);
15+
public static readonly Color bgColorDark = Color.FromArgb(32, 32, 32);
16+
public static readonly Color fgColorDark = Color.FromArgb(224, 224, 224);
1717

1818
public static bool IsDark
1919
{

src/ScheduleDialog.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ private void UpdateGuiState()
5454
{
5555
if (!hasLocationPermission)
5656
{
57-
locationPermissionLabel.ForeColor = SystemColors.ControlText;
57+
locationPermissionLabel.ForeColor = DarkUI.IsDark ? DarkUI.fgColorDark : default;
5858
locationPermissionLabel.Text = _("Click below to grant permission to access location");
5959
}
6060
else
@@ -180,7 +180,9 @@ private async void okButton_Click(object sender, EventArgs e)
180180
{
181181
hasLocationPermission = UwpLocation.HasAccess();
182182
UpdateLocationState();
183-
MessageDialog.ShowWarning(_("Failed to get location from Windows location service."), _("Error"));
183+
MessageDialog.ShowWarning(string.Format(
184+
_("Failed to get location from Windows location service:\n\n{0}"),
185+
UwpLocation.lastUpdateError.ToString()), _("Error"));
184186
}
185187
}
186188
else if (radioButton3.Checked)

src/UwpLocation.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ namespace WinDynamicDesktop
1010
class UwpLocation
1111
{
1212
private static readonly Func<string, string> _ = Localization.GetTranslation;
13+
public static Exception lastUpdateError;
1314

1415
private static async Task<bool> UnsafeRequestAccess()
1516
{
@@ -68,7 +69,9 @@ public static async Task<bool> UpdateGeoposition()
6869

6970
return true;
7071
}
71-
catch { /* Do nothing */ }
72+
catch (Exception exc) {
73+
lastUpdateError = exc;
74+
}
7275

7376
return false;
7477
}

0 commit comments

Comments
 (0)