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

View file

@ -3,60 +3,61 @@ package xyz.atnrch.wrench.components
import androidx.compose.foundation.BorderStroke import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.border import androidx.compose.foundation.border
import androidx.compose.foundation.layout.* 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.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.RectangleShape import androidx.compose.ui.graphics.RectangleShape
import androidx.compose.ui.unit.ExperimentalUnitApi
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import xyz.atnrch.wrench.components.debug.DummyTextEntry import xyz.atnrch.wrench.components.debug.DummyTextEntry
import xyz.atnrch.wrench.ui.UIColors import xyz.atnrch.wrench.ui.UIColors
import xyz.atnrch.wrench.watcher.WatcherManager import xyz.atnrch.wrench.watcher.WatcherManager
@OptIn(ExperimentalUnitApi::class)
@Composable @Composable
fun WatcherDisplay( fun WatcherDisplay(
watcherManager: WatcherManager watcherManager: WatcherManager
) { ) {
var selectedFile = remember { mutableStateOf("") } var selectedFile = remember { mutableStateOf("") }
Box( Row(
contentAlignment = Alignment.Center, horizontalArrangement = Arrangement.SpaceEvenly
modifier = Modifier ){
.fillMaxWidth(0.5f)
.fillMaxHeight(1f)
.border(BorderStroke(4.dp, Color.Black), RectangleShape),
) {
Column(
modifier = Modifier.padding(24.dp)
) {
//.............
// INPUT SIDE
//.............
watcherManager.getEntries().forEach {
WatcherTextEntry(it)
}
DummyTextEntry()
}
}
Box {
Box( Box(
contentAlignment = Alignment.Center, contentAlignment = Alignment.Center,
modifier = Modifier modifier = Modifier
.padding(PaddingValues(0.dp, 0.dp, 0.dp, 55.dp))
.fillMaxHeight()
.fillMaxWidth(0.5f) .fillMaxWidth(0.5f)
.fillMaxHeight(1f) .border(BorderStroke(4.dp, UIColors.ORANGE), RectangleShape)
.border(BorderStroke(4.dp, UIColors.STRESS), RectangleShape),
) { ) {
Column( Column {
modifier = Modifier.padding(24.dp)
) {
//............. //.............
// OUTPUT SIDE // INPUT SIDE
//............. //.............
watcherManager.getEntries().forEach {
WatcherTextEntry(it)
}
DummyTextEntry() DummyTextEntry()
} }
} }
Box {
Box(
contentAlignment = Alignment.Center,
modifier = Modifier
.padding(PaddingValues(0.dp, 0.dp, 0.dp, 55.dp))
.fillMaxHeight()
.fillMaxWidth(1f)
.border(BorderStroke(4.dp, UIColors.STRESS), RectangleShape)
) {
Column {
//.............
// OUTPUT SIDE
//.............
DummyTextEntry()
}
}
}
} }
} }