Browse Source
Toplevel - Fix system theme not being applied at launch on some platforms (#16159)
* move platformbinding for theme variant from WindowBase up to TopLevel.
* remvoe visibility check in android insets manager for system theme
pull/16174/head
Emmanuel Hansen
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with
5 additions and
15 deletions
-
src/Android/Avalonia.Android/Platform/AndroidInsetsManager.cs
-
src/Avalonia.Controls/TopLevel.cs
-
src/Avalonia.Controls/WindowBase.cs
|
|
|
@ -191,11 +191,6 @@ namespace Avalonia.Android.Platform |
|
|
|
{ |
|
|
|
_statusBarTheme = value; |
|
|
|
|
|
|
|
if (!_topLevel.View.IsShown) |
|
|
|
{ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
var compat = new WindowInsetsControllerCompat(Window, _topLevel.View); |
|
|
|
|
|
|
|
if (_isDefaultSystemBarLightTheme == null) |
|
|
|
@ -229,11 +224,6 @@ namespace Avalonia.Android.Platform |
|
|
|
{ |
|
|
|
_systemUiVisibility = value; |
|
|
|
|
|
|
|
if (!_topLevel.View.IsShown) |
|
|
|
{ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
var compat = WindowCompat.GetInsetsController(Window, _topLevel.View); |
|
|
|
|
|
|
|
if (value == null || value.Value) |
|
|
|
|
|
|
|
@ -232,6 +232,11 @@ namespace Avalonia.Controls |
|
|
|
impl.TransparencyLevelChanged = HandleTransparencyLevelChanged; |
|
|
|
|
|
|
|
CreatePlatformImplBinding(TransparencyLevelHintProperty, hint => PlatformImpl.SetTransparencyLevelHint(hint ?? Array.Empty<WindowTransparencyLevel>())); |
|
|
|
CreatePlatformImplBinding(ActualThemeVariantProperty, variant => |
|
|
|
{ |
|
|
|
variant ??= ThemeVariant.Default; |
|
|
|
PlatformImpl?.SetFrameThemeVariant((PlatformThemeVariant?)variant ?? PlatformThemeVariant.Light); |
|
|
|
}); |
|
|
|
|
|
|
|
_keyboardNavigationHandler?.SetOwner(this); |
|
|
|
_accessKeyHandler?.SetOwner(this); |
|
|
|
|
|
|
|
@ -48,11 +48,6 @@ namespace Avalonia.Controls |
|
|
|
public WindowBase(IWindowBaseImpl impl) : this(impl, AvaloniaLocator.Current) |
|
|
|
{ |
|
|
|
CreatePlatformImplBinding(TopmostProperty, topmost => PlatformImpl!.SetTopmost(topmost)); |
|
|
|
CreatePlatformImplBinding(ActualThemeVariantProperty, variant => |
|
|
|
{ |
|
|
|
variant ??= ThemeVariant.Default; |
|
|
|
PlatformImpl?.SetFrameThemeVariant((PlatformThemeVariant?)variant ?? PlatformThemeVariant.Light); |
|
|
|
}); |
|
|
|
|
|
|
|
FrameSize = impl.FrameSize; |
|
|
|
} |
|
|
|
|