fyne-io / fyne

Cross platform GUI toolkit in Go inspired by Material Design
https://fyne.io/
Other
25.28k stars 1.4k forks source link

Mobile simulator should follow light/dark mode #4970

Open Jacalz opened 5 months ago

Jacalz commented 5 months ago

Checklist

Is your feature request related to a problem?

The mobile simulator on Linux (maybe MacOS as well if it works similar there?) does not follow the dark theme preference set by the desktop operating system. Given that the apps will adapt to the set theme on Android and iOS, it makes sense to try to follow the theme even when they are simulating a mobile on the desktop. Support for this would allow developers to test their apps with both themes easily.

I suspect that this might apply to Linux phones as well?

Is it possible to construct a solution with the existing API?

Yes. The handling for themes that looks at the XDG dark mode preference is already working in the desktop driver.

Describe the solution you'd like to see.

The code for the desktop driver has code for checking theme preference of light/dark mode. This code can likely be moved into the mobile simulator code.

Jacalz commented 5 months ago

Is this a problem on macOS as well or is the mobile simulator not behaving the same way there? If that is the case then this is likely a Linux specific issue (especially given the note about Linux phones above).

andydotxyz commented 5 months ago

This probably applies to all the simulators because they don't use the device specific code, it's just a lightweight window that scales content and simulates the mobile APIs.