mirror of
https://github.com/amir1376/ab-download-manager.git
synced 2025-02-20 11:43:24 +08:00
fix crash when changing theme in linux (#348)
This commit is contained in:
parent
ef869a2851
commit
b8ce924ad8
@ -39,6 +39,8 @@ import ir.amirab.util.customwindow.HitSpots
|
|||||||
import ir.amirab.util.customwindow.util.CustomWindowDecorationAccessing
|
import ir.amirab.util.customwindow.util.CustomWindowDecorationAccessing
|
||||||
import ir.amirab.util.customwindow.windowFrameItem
|
import ir.amirab.util.customwindow.windowFrameItem
|
||||||
import ir.amirab.util.ifThen
|
import ir.amirab.util.ifThen
|
||||||
|
import kotlinx.coroutines.Dispatchers
|
||||||
|
import kotlinx.coroutines.withContext
|
||||||
|
|
||||||
|
|
||||||
// a window frame which totally rendered with compose
|
// a window frame which totally rendered with compose
|
||||||
@ -318,11 +320,13 @@ fun CustomWindow(
|
|||||||
val isLight = myColors.isLight
|
val isLight = myColors.isLight
|
||||||
val background = myColors.background
|
val background = myColors.background
|
||||||
LaunchedEffect(background) {
|
LaunchedEffect(background) {
|
||||||
//I set window background fix window edge flickering on window resize
|
withContext(Dispatchers.Main) {
|
||||||
window.background = background.takeOrElse {
|
//I set window background fix window edge flickering on window resize
|
||||||
if (isLight) Color.White
|
window.background = background.takeOrElse {
|
||||||
else Color.Black
|
if (isLight) Color.White
|
||||||
}.toWindowColorType()
|
else Color.Black
|
||||||
|
}.toWindowColorType()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
UiScaledContent {
|
UiScaledContent {
|
||||||
CompositionLocalProvider(
|
CompositionLocalProvider(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user