From cbd918540a31f1b974dae8dd1dae687cf8cebff6 Mon Sep 17 00:00:00 2001 From: aro Date: Mon, 21 Nov 2022 19:14:33 +0100 Subject: [PATCH] fix: 2 boxes now spaced evenly --- .../wrench/components/WrenchBottomRow.kt | 4 +- .../components/WrenchFileManagerInput.kt | 63 ++++++++++--------- 2 files changed, 34 insertions(+), 33 deletions(-) diff --git a/src/main/kotlin/xyz/atnrch/wrench/components/WrenchBottomRow.kt b/src/main/kotlin/xyz/atnrch/wrench/components/WrenchBottomRow.kt index f5a90f3..f13733f 100644 --- a/src/main/kotlin/xyz/atnrch/wrench/components/WrenchBottomRow.kt +++ b/src/main/kotlin/xyz/atnrch/wrench/components/WrenchBottomRow.kt @@ -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, diff --git a/src/main/kotlin/xyz/atnrch/wrench/components/WrenchFileManagerInput.kt b/src/main/kotlin/xyz/atnrch/wrench/components/WrenchFileManagerInput.kt index 8ba84c4..c911ab0 100644 --- a/src/main/kotlin/xyz/atnrch/wrench/components/WrenchFileManagerInput.kt +++ b/src/main/kotlin/xyz/atnrch/wrench/components/WrenchFileManagerInput.kt @@ -3,60 +3,61 @@ 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("") } - Box( - contentAlignment = Alignment.Center, - 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 { + 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, UIColors.STRESS), RectangleShape), + .border(BorderStroke(4.dp, UIColors.ORANGE), RectangleShape) ) { - Column( - modifier = Modifier.padding(24.dp) - ) { + Column { //............. - // OUTPUT SIDE + // INPUT SIDE //............. + watcherManager.getEntries().forEach { + WatcherTextEntry(it) + } 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() + } + } + } } }