Skip to content

Commit

Permalink
Merge pull request #3561 from lucor/xdg-default-theme-selection
Browse files Browse the repository at this point in the history
Update Linux/XDG default theme selection
  • Loading branch information
lucor committed Jan 15, 2023
2 parents c8b9516 + 9bcee24 commit f1db0b5
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions app/app_xdg.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,19 @@ func findFreedestktopColorScheme() fyne.ThemeVariant {
return theme.VariantDark
}

// See: https://github.com/flatpak/xdg-desktop-portal/blob/1.16.0/data/org.freedesktop.impl.portal.Settings.xml#L32-L46
// 0: No preference
// 1: Prefer dark appearance
// 2: Prefer light appearance
switch value {
case 0:
case 2:
return theme.VariantLight
default:
case 1:
return theme.VariantDark
default:
// Default to light theme to support Gnome's default see https://github.com/fyne-io/fyne/pull/3561
return theme.VariantLight
}

}

func (a *fyneApp) SendNotification(n *fyne.Notification) {
Expand Down

0 comments on commit f1db0b5

Please sign in to comment.