Skip to content

Commit 2220f6f

Browse files
committed
WR-406: Fix login screen sizing
1 parent 39584ea commit 2220f6f

File tree

2 files changed

+20
-11
lines changed

2 files changed

+20
-11
lines changed

src/main/kotlin/org/datepollsystems/waiterrobot/mediator/ui/login/LoginScreen.kt

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import androidx.compose.ui.ExperimentalComposeUiApi
1616
import androidx.compose.ui.Modifier
1717
import androidx.compose.ui.autofill.AutofillType
1818
import androidx.compose.ui.graphics.Color
19+
import androidx.compose.ui.layout.ContentScale
1920
import androidx.compose.ui.text.input.KeyboardType
2021
import androidx.compose.ui.text.input.PasswordVisualTransformation
2122
import androidx.compose.ui.text.input.VisualTransformation
@@ -44,18 +45,27 @@ fun LoginScreen(vm: LoginViewModel) {
4445
}
4546

4647
Column(
47-
modifier = Modifier.padding(50.dp).requiredWidthIn(max = 550.dp),
48+
modifier = Modifier.padding(10.dp).requiredWidthIn(max = 550.dp),
4849
horizontalAlignment = Alignment.CenterHorizontally,
4950
verticalArrangement = Arrangement.spacedBy(25.dp, Alignment.CenterVertically)
5051
) {
51-
Image(
52-
painter = painterResource(Res.drawable.icon_round),
53-
contentDescription = "WaiterRobot icon",
52+
Box(
5453
modifier = Modifier
55-
.fillMaxWidth(0.4f)
56-
.aspectRatio(1f)
57-
.padding(bottom = 20.dp)
58-
)
54+
.weight(1f, fill = false)
55+
.heightIn(max = 300.dp)
56+
.aspectRatio(1f),
57+
contentAlignment = Alignment.Center
58+
) {
59+
Image(
60+
painter = painterResource(Res.drawable.icon_round),
61+
contentDescription = "WaiterRobot icon",
62+
modifier = Modifier
63+
.fillMaxHeight()
64+
.aspectRatio(1f),
65+
contentScale = ContentScale.Fit
66+
)
67+
}
68+
5969
Text(text = stringResource(Res.string.login_title), style = MaterialTheme.typography.headlineMedium)
6070
Text(
6171
modifier = Modifier.padding(horizontal = 20.dp),

src/main/kotlin/org/datepollsystems/waiterrobot/mediator/ui/startUI.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ package org.datepollsystems.waiterrobot.mediator.ui
33
import androidx.compose.ui.graphics.painter.BitmapPainter
44
import androidx.compose.ui.graphics.painter.Painter
55
import androidx.compose.ui.res.loadImageBitmap
6-
import androidx.compose.ui.unit.DpSize
7-
import androidx.compose.ui.unit.dp
86
import androidx.compose.ui.window.Window
7+
import androidx.compose.ui.window.WindowPlacement
98
import androidx.compose.ui.window.application
109
import androidx.compose.ui.window.rememberWindowState
1110
import org.datepollsystems.waiterrobot.mediator.core.ShortcutManager
@@ -21,7 +20,7 @@ fun startUI(onClose: () -> Unit = {}) {
2120
title = "kellner.team",
2221
icon = appIcon,
2322
state = rememberWindowState(
24-
size = DpSize(1300.dp, 800.dp)
23+
placement = WindowPlacement.Maximized,
2524
),
2625
onCloseRequest = {
2726
onClose()

0 commit comments

Comments
 (0)