Skip to content

Commit

Permalink
Limit the horizontal scroll bar to the more basic text windows
Browse files Browse the repository at this point in the history
  • Loading branch information
jbartok committed Jul 8, 2024
1 parent 8440b33 commit 1155fe5
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 60 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,7 @@ private fun ConnectedMainContent(component: ConnectedComponent, model: Connectio
val action = component.actionFor(outcome.model)
if (action != null) {
action.run {
verticalScrollContent {
ModelContent(outcome.model)
}
ModelContent(outcome.model)
}
} else {
Text(
Expand All @@ -114,7 +112,7 @@ private fun ConnectedMainContent(component: ConnectedComponent, model: Connectio
}

@Composable
fun verticalScrollContent(
fun horizontalScrollContent(
content: @Composable ColumnScope.() -> Unit,
) {
Box(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import androidx.compose.foundation.layout.ColumnScope
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import org.gradle.client.ui.connected.horizontalScrollContent
import org.gradle.tooling.model.build.BuildEnvironment

class GetBuildEnvironment : GetModelAction<BuildEnvironment> {
Expand All @@ -15,29 +16,31 @@ class GetBuildEnvironment : GetModelAction<BuildEnvironment> {

@Composable
override fun ColumnScope.ModelContent(model: BuildEnvironment) {
Text(
text = "Build Environment",
style = MaterialTheme.typography.titleMedium
)
Text(
text = "Build Identifier: ${model.buildIdentifier.rootDir}",
style = MaterialTheme.typography.labelSmall
)
Text(
text = "Java Home: ${model.java.javaHome}",
style = MaterialTheme.typography.labelSmall
)
Text(
text = "JVM Arguments: ${model.java.jvmArguments}",
style = MaterialTheme.typography.labelSmall
)
Text(
text = "Gradle Version: ${model.gradle.gradleVersion}",
style = MaterialTheme.typography.labelSmall
)
Text(
text = "Gradle User Home: ${model.gradle.gradleUserHome}",
style = MaterialTheme.typography.labelSmall
)
horizontalScrollContent {
Text(
text = "Build Environment",
style = MaterialTheme.typography.titleMedium
)
Text(
text = "Build Identifier: ${model.buildIdentifier.rootDir}",
style = MaterialTheme.typography.labelSmall
)
Text(
text = "Java Home: ${model.java.javaHome}",
style = MaterialTheme.typography.labelSmall
)
Text(
text = "JVM Arguments: ${model.java.jvmArguments}",
style = MaterialTheme.typography.labelSmall
)
Text(
text = "Gradle Version: ${model.gradle.gradleVersion}",
style = MaterialTheme.typography.labelSmall
)
Text(
text = "Gradle User Home: ${model.gradle.gradleUserHome}",
style = MaterialTheme.typography.labelSmall
)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import androidx.compose.foundation.layout.ColumnScope
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import org.gradle.client.ui.connected.horizontalScrollContent
import org.gradle.tooling.model.gradle.GradleBuild

class GetGradleBuild : GetModelAction<GradleBuild> {
Expand All @@ -15,21 +16,23 @@ class GetGradleBuild : GetModelAction<GradleBuild> {

@Composable
override fun ColumnScope.ModelContent(model: GradleBuild) {
Text(
text = "Gradle Build",
style = MaterialTheme.typography.titleMedium
)
Text(
text = "Build Identifier: ${model.buildIdentifier.rootDir}",
style = MaterialTheme.typography.labelSmall
)
Text(
text = "Root Project Identifier: ${model.rootProject.projectIdentifier}",
style = MaterialTheme.typography.labelSmall
)
Text(
text = "Root Project Name: ${model.rootProject.name}",
style = MaterialTheme.typography.labelSmall
)
horizontalScrollContent {
Text(
text = "Gradle Build",
style = MaterialTheme.typography.titleMedium
)
Text(
text = "Build Identifier: ${model.buildIdentifier.rootDir}",
style = MaterialTheme.typography.labelSmall
)
Text(
text = "Root Project Identifier: ${model.rootProject.projectIdentifier}",
style = MaterialTheme.typography.labelSmall
)
Text(
text = "Root Project Name: ${model.rootProject.name}",
style = MaterialTheme.typography.labelSmall
)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import androidx.compose.foundation.layout.ColumnScope
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import org.gradle.client.ui.connected.horizontalScrollContent
import org.gradle.tooling.model.GradleProject

class GetGradleProject : GetModelAction<GradleProject> {
Expand All @@ -15,21 +16,23 @@ class GetGradleProject : GetModelAction<GradleProject> {

@Composable
override fun ColumnScope.ModelContent(model: GradleProject) {
Text(
text = "Gradle Project",
style = MaterialTheme.typography.titleMedium
)
Text(
text = "Root Project Identifier: ${model.projectIdentifier}",
style = MaterialTheme.typography.labelSmall
)
Text(
text = "Root Project Name: ${model.name}",
style = MaterialTheme.typography.labelSmall
)
Text(
text = "Root Project Description: ${model.description}",
style = MaterialTheme.typography.labelSmall
)
horizontalScrollContent {
Text(
text = "Gradle Project",
style = MaterialTheme.typography.titleMedium
)
Text(
text = "Root Project Identifier: ${model.projectIdentifier}",
style = MaterialTheme.typography.labelSmall
)
Text(
text = "Root Project Name: ${model.name}",
style = MaterialTheme.typography.labelSmall
)
Text(
text = "Root Project Description: ${model.description}",
style = MaterialTheme.typography.labelSmall
)
}
}
}

0 comments on commit 1155fe5

Please sign in to comment.