Remove empty terminal black areas
- Hide the terminal output viewport when there are no output lines on a newly loaded level. - Reduce the minimum output history height so short output does not create a large empty black panel. - Use the pane surface color for the app background so normal spacing between cards is not black.
This commit is contained in:
@@ -19,8 +19,8 @@ android {
|
|||||||
applicationId = "solutions.tretter.githugandroid"
|
applicationId = "solutions.tretter.githugandroid"
|
||||||
minSdk = 26
|
minSdk = 26
|
||||||
targetSdk = 35
|
targetSdk = 35
|
||||||
versionCode = 140
|
versionCode = 141
|
||||||
versionName = "0.1.139"
|
versionName = "0.1.140"
|
||||||
|
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
vectorDrawables.useSupportLibrary = true
|
vectorDrawables.useSupportLibrary = true
|
||||||
|
|||||||
@@ -3,10 +3,10 @@ package solutions.tretter.githugandroid
|
|||||||
import androidx.compose.material3.darkColorScheme
|
import androidx.compose.material3.darkColorScheme
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
|
|
||||||
val AppBackground = Color(0xFF000000)
|
|
||||||
val PanelPrimary = Color(0xFF121212)
|
val PanelPrimary = Color(0xFF121212)
|
||||||
val PanelSecondary = Color(0xFF1E1E1E)
|
val PanelSecondary = Color(0xFF1E1E1E)
|
||||||
val PanelTertiary = Color(0xFF262626)
|
val PanelTertiary = Color(0xFF262626)
|
||||||
|
val AppBackground = PanelSecondary
|
||||||
val TerminalBackground = Color(0xFF050505)
|
val TerminalBackground = Color(0xFF050505)
|
||||||
val TextPrimary = Color(0xFFFFFFFF)
|
val TextPrimary = Color(0xFFFFFFFF)
|
||||||
val TextSecondary = Color(0xFFE6E6E6)
|
val TextSecondary = Color(0xFFE6E6E6)
|
||||||
@@ -26,4 +26,4 @@ val GitHugColorScheme = darkColorScheme(
|
|||||||
surfaceVariant = PanelSecondary,
|
surfaceVariant = PanelSecondary,
|
||||||
onSurfaceVariant = TextSecondary,
|
onSurfaceVariant = TextSecondary,
|
||||||
outline = TextMuted,
|
outline = TextMuted,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -82,7 +82,11 @@ fun TerminalPane(
|
|||||||
val reservedControlsHeight = 86.dp
|
val reservedControlsHeight = 86.dp
|
||||||
val maxOutputHeight = (terminalPaneMaxHeight - reservedControlsHeight).coerceAtLeast(120.dp)
|
val maxOutputHeight = (terminalPaneMaxHeight - reservedControlsHeight).coerceAtLeast(120.dp)
|
||||||
val outputLineHeight = 20.dp
|
val outputLineHeight = 20.dp
|
||||||
val desiredOutputHeight = (output.size.coerceAtLeast(6) * outputLineHeight.value).dp.coerceAtMost(maxOutputHeight)
|
val hasOutput = output.isNotEmpty()
|
||||||
|
val desiredOutputHeight = (output.size.coerceAtLeast(1) * outputLineHeight.value)
|
||||||
|
.dp
|
||||||
|
.coerceAtLeast(48.dp)
|
||||||
|
.coerceAtMost(maxOutputHeight)
|
||||||
|
|
||||||
LaunchedEffect(inputFieldVersion) {
|
LaunchedEffect(inputFieldVersion) {
|
||||||
outputHorizontalScroll.scrollTo(0)
|
outputHorizontalScroll.scrollTo(0)
|
||||||
@@ -120,28 +124,30 @@ fun TerminalPane(
|
|||||||
.widthIn(min = terminalMinWidth),
|
.widthIn(min = terminalMinWidth),
|
||||||
verticalArrangement = Arrangement.spacedBy(8.dp),
|
verticalArrangement = Arrangement.spacedBy(8.dp),
|
||||||
) {
|
) {
|
||||||
Box(
|
if (hasOutput) {
|
||||||
modifier = Modifier
|
Box(
|
||||||
.heightIn(min = 200.dp, max = maxOutputHeight)
|
modifier = Modifier
|
||||||
.height(desiredOutputHeight)
|
.heightIn(max = maxOutputHeight)
|
||||||
.fillMaxWidth()
|
.height(desiredOutputHeight)
|
||||||
.background(PanelPrimary, RoundedCornerShape(10.dp))
|
.fillMaxWidth()
|
||||||
.padding(8.dp)
|
.background(PanelPrimary, RoundedCornerShape(10.dp))
|
||||||
.horizontalScroll(outputHorizontalScroll)
|
.padding(8.dp)
|
||||||
.verticalScroll(outputVerticalScroll),
|
.horizontalScroll(outputHorizontalScroll)
|
||||||
) {
|
.verticalScroll(outputVerticalScroll),
|
||||||
SelectionContainer {
|
) {
|
||||||
Column(
|
SelectionContainer {
|
||||||
modifier = Modifier.widthIn(min = terminalMinWidth),
|
Column(
|
||||||
verticalArrangement = Arrangement.spacedBy(4.dp),
|
modifier = Modifier.widthIn(min = terminalMinWidth),
|
||||||
) {
|
verticalArrangement = Arrangement.spacedBy(4.dp),
|
||||||
output.forEach { line ->
|
) {
|
||||||
Text(
|
output.forEach { line ->
|
||||||
text = line,
|
Text(
|
||||||
color = if (line.startsWith("✔") || line.startsWith("🏁")) Success else TextSecondary,
|
text = line,
|
||||||
fontFamily = FontFamily.Monospace,
|
color = if (line.startsWith("✔") || line.startsWith("🏁")) Success else TextSecondary,
|
||||||
softWrap = false,
|
fontFamily = FontFamily.Monospace,
|
||||||
)
|
softWrap = false,
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user