fix: make shared page bodies full width
This commit is contained in:
@@ -12,7 +12,6 @@ import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.layout.widthIn
|
||||
import androidx.compose.foundation.selection.selectable
|
||||
import androidx.compose.foundation.selection.selectableGroup
|
||||
import androidx.compose.material.icons.Icons
|
||||
@@ -42,7 +41,6 @@ import androidx.compose.ui.graphics.vector.ImageVector
|
||||
import androidx.compose.ui.semantics.Role
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.unit.dp
|
||||
import net.awan.pipelines.ui.theme.DETAIL_MAX_WIDTH_DP
|
||||
import net.awan.pipelines.ui.theme.ICON_RAIL_DP
|
||||
import net.awan.pipelines.ui.theme.SPACING_L
|
||||
import net.awan.pipelines.ui.theme.SPACING_M
|
||||
@@ -215,9 +213,9 @@ private fun RailTab(tab: DetailTab, selected: Boolean, onClick: () -> Unit) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Constrains a text tab's single scroll container to a comfortable reading width
|
||||
* on a wide window (centred) instead of letting lines run edge to edge; on a
|
||||
* narrow window the content simply fills the tab.
|
||||
* Gives a tab body the complete safe-area width supplied by its page container.
|
||||
* Internal content remains responsible for any narrower, purpose-specific layout
|
||||
* such as chat bubbles.
|
||||
*/
|
||||
@Composable
|
||||
fun DetailTabBody(
|
||||
@@ -225,18 +223,7 @@ fun DetailTabBody(
|
||||
modifier: Modifier = Modifier,
|
||||
content: @Composable (Modifier) -> Unit,
|
||||
) {
|
||||
if (wide) {
|
||||
Box(modifier.fillMaxSize(), contentAlignment = Alignment.TopCenter) {
|
||||
content(
|
||||
Modifier
|
||||
.fillMaxHeight()
|
||||
.widthIn(max = DETAIL_MAX_WIDTH_DP.dp)
|
||||
.fillMaxWidth(),
|
||||
)
|
||||
}
|
||||
} else {
|
||||
content(modifier.fillMaxSize())
|
||||
}
|
||||
content(modifier.fillMaxSize())
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -94,14 +94,11 @@ internal val DESTINATION_PILL_RESERVE = 88.dp
|
||||
*/
|
||||
internal val ATTENTION_CHIP_RESERVE = SPACING_XXL + SPACING_M
|
||||
|
||||
// ---- Detail rail and max content width (ui/components/DetailTabs.kt) -------
|
||||
// ---- Detail rail (ui/components/DetailTabs.kt) ------------------------------
|
||||
|
||||
/** The always-visible wide section rail's width (icons with labels). */
|
||||
internal const val WIDE_RAIL_WIDTH_DP = 200
|
||||
|
||||
/** Comfortable max text width for a tab body on a wide window. */
|
||||
const val DETAIL_MAX_WIDTH_DP = 840
|
||||
|
||||
// ---- Workflow graph geometry (ui/graph/WorkflowGraph.kt) -------------------
|
||||
// The graph's node, edge and legend geometry. These are named here like every
|
||||
// other app dimension so the graph file imports them instead of writing raw dp
|
||||
|
||||
Reference in New Issue
Block a user