Repository navigation
Replace ILocaleService with IPlatformSettings, adding the system theme and change events - #666
Merged
Merged
Conversation
…theme and change events for the theme and the preferred locales
|
📦 Development package |
|
✅ Development package validation passed on all platforms. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces
ILocaleServicefrom #665 withIPlatformSettings, one service for the user's OS or browser settings that apply to the whole app and can change while it runs.API
SystemTheme Theme(Light,DarkorUnknown) andThemeChanged, fromSDL_GetSystemThemeandSDL_EVENT_SYSTEM_THEME_CHANGED.GetPreferredLocales()andPreferredLocalesChanged, fromSDL_GetPreferredLocalesandSDL_EVENT_LOCALE_CHANGED. The locale code is unchanged from Expose the user's preferred locales through ILocaleService #665.EventServiceon the main thread, before the frame's updates.Behavior
PixelyExceptionoff the main thread. SDL documentsSDL_GetSystemThemeas main-thread only andSDL_GetPreferredLocalesas not thread safe.Unknowntheme and never raisesThemeChanged, so a scenario does not depend on the host's theme. Locales stay readable there, sinceSDL_HINT_PREFERRED_LOCALESlets a scenario pin them.Breaking change
ILocaleService,LocaleServiceanddocs/locales.mdare removed. UseIPlatformSettings.GetPreferredLocales()instead. The content ofdocs/locales.mdmoved todocs/platform-settings.md.Testing
Pixely.Tests: 598 passed, including newPlatformSettingsTeststhat push SDL's theme and locale events.src/Pixelybuilds fornet11.0-browser.