fix: 2 boxes now spaced evenly

This commit is contained in:
aro 2022-11-21 19:14:33 +01:00
parent 8d796b75d7
commit cbd918540a
2 changed files with 34 additions and 33 deletions

View file

@ -34,9 +34,11 @@ fun BottomRow(
Button(
{
if (state) {
buttonColors[0] = UIColors.WATCHER_START_BG
run { watcher.stop() }
onStateChange(false)
} else {
buttonColors[0] = UIColors.WATCHER_STOP_BG
run { watcher.start() }
onStateChange(true)
}
@ -47,7 +49,6 @@ fun BottomRow(
modifier = Modifier.shadow(15.dp, RoundedCornerShape(100), false)
) {
if (state) {
buttonColors[0] = UIColors.WATCHER_STOP_BG
Icon(
Icons.Filled.Close,
tint = UIColors.WATCHER_STOP_FG,
@ -55,7 +56,6 @@ fun BottomRow(
modifier = Modifier.size(28.dp)
)
} else {
buttonColors[0] = UIColors.WATCHER_START_BG
Icon(
Icons.Filled.PlayArrow,
tint = UIColors.WATCHER_START_FG,

View file

@ -3,34 +3,35 @@ package xyz.atnrch.wrench.components
import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.border
import androidx.compose.foundation.layout.*
import androidx.compose.runtime.*
import androidx.compose.runtime.Composable
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.RectangleShape
import androidx.compose.ui.unit.ExperimentalUnitApi
import androidx.compose.ui.unit.dp
import xyz.atnrch.wrench.components.debug.DummyTextEntry
import xyz.atnrch.wrench.ui.UIColors
import xyz.atnrch.wrench.watcher.WatcherManager
@OptIn(ExperimentalUnitApi::class)
@Composable
fun WatcherDisplay(
watcherManager: WatcherManager
) {
var selectedFile = remember { mutableStateOf("") }
Row(
horizontalArrangement = Arrangement.SpaceEvenly
){
Box(
contentAlignment = Alignment.Center,
modifier = Modifier
.padding(PaddingValues(0.dp, 0.dp, 0.dp, 55.dp))
.fillMaxHeight()
.fillMaxWidth(0.5f)
.fillMaxHeight(1f)
.border(BorderStroke(4.dp, Color.Black), RectangleShape),
) {
Column(
modifier = Modifier.padding(24.dp)
.border(BorderStroke(4.dp, UIColors.ORANGE), RectangleShape)
) {
Column {
//.............
// INPUT SIDE
//.............
@ -45,13 +46,12 @@ fun WatcherDisplay(
Box(
contentAlignment = Alignment.Center,
modifier = Modifier
.fillMaxWidth(0.5f)
.fillMaxHeight(1f)
.border(BorderStroke(4.dp, UIColors.STRESS), RectangleShape),
) {
Column(
modifier = Modifier.padding(24.dp)
.padding(PaddingValues(0.dp, 0.dp, 0.dp, 55.dp))
.fillMaxHeight()
.fillMaxWidth(1f)
.border(BorderStroke(4.dp, UIColors.STRESS), RectangleShape)
) {
Column {
//.............
// OUTPUT SIDE
//.............
@ -59,4 +59,5 @@ fun WatcherDisplay(
}
}
}
}
}