mirror of
https://github.com/Suwayomi/TachideskJUI.git
synced 2026-01-29 15:04:08 +01:00
Dont add a surface under the loading screen
This commit is contained in:
@@ -10,7 +10,6 @@ import androidx.compose.foundation.layout.BoxWithConstraints
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.material.CircularProgressIndicator
|
||||
import androidx.compose.material.Surface
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.ui.Alignment
|
||||
@@ -28,20 +27,18 @@ fun LoadingScreen(
|
||||
retryMessage: String = stringResource("action_retry"),
|
||||
retry: (() -> Unit)? = null
|
||||
) {
|
||||
Surface(modifier) {
|
||||
BoxWithConstraints {
|
||||
if (isLoading) {
|
||||
val size = remember(maxHeight, maxWidth) {
|
||||
min(maxHeight, maxWidth) / 2
|
||||
}
|
||||
if (progress != 0.0F && !progress.isNaN()) {
|
||||
CircularProgressIndicator(progress, Modifier.align(Alignment.Center).size(size))
|
||||
} else {
|
||||
CircularProgressIndicator(Modifier.align(Alignment.Center).size(size))
|
||||
}
|
||||
} else {
|
||||
ErrorScreen(errorMessage, modifier, retryMessage, retry)
|
||||
BoxWithConstraints(modifier) {
|
||||
if (isLoading) {
|
||||
val size = remember(maxHeight, maxWidth) {
|
||||
min(maxHeight, maxWidth) / 2
|
||||
}
|
||||
if (progress != 0.0F && !progress.isNaN()) {
|
||||
CircularProgressIndicator(progress, Modifier.align(Alignment.Center).size(size))
|
||||
} else {
|
||||
CircularProgressIndicator(Modifier.align(Alignment.Center).size(size))
|
||||
}
|
||||
} else {
|
||||
ErrorScreen(errorMessage, modifier, retryMessage, retry)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
package ca.gosyer.ui.main
|
||||
|
||||
import androidx.compose.desktop.AppWindow
|
||||
import androidx.compose.material.Surface
|
||||
import androidx.compose.runtime.CompositionLocalProvider
|
||||
import androidx.compose.runtime.collectAsState
|
||||
import androidx.compose.runtime.getValue
|
||||
@@ -132,12 +133,14 @@ fun main() {
|
||||
MainMenu(rootBundle)
|
||||
}
|
||||
ServerResult.STARTING, ServerResult.FAILED -> {
|
||||
LoadingScreen(
|
||||
initialized == ServerResult.STARTING,
|
||||
errorMessage = stringResource("unable_to_start_server"),
|
||||
retryMessage = stringResource("action_start_anyway"),
|
||||
retry = serverService::startAnyway
|
||||
)
|
||||
Surface {
|
||||
LoadingScreen(
|
||||
initialized == ServerResult.STARTING,
|
||||
errorMessage = stringResource("unable_to_start_server"),
|
||||
retryMessage = stringResource("action_start_anyway"),
|
||||
retry = serverService::startAnyway
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user