Skip to content

Commit d97470c

Browse files
committed
Scan buttons: drop fillMaxWidth, size to content + left-align naturally
1 parent 2c011ab commit d97470c

1 file changed

Lines changed: 6 additions & 15 deletions

File tree

app/src/main/java/com/eried/eucplanet/ui/settings/ExternalGpsSection.kt

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -201,14 +201,10 @@ private fun PairedExternalGpsCard(
201201
}
202202

203203
/**
204-
* Full-width scan-action button with the label pinned to the left edge.
205-
* Used for both the External GPS card and (via the analogous version in
206-
* SettingsScreen) the Flic scan card so the two cards in the Integration
207-
* tab share an identical visual rhythm: same size, same text alignment.
208-
*
209-
* Without the [Row] + `weight(1f)` trick, Material 3 centres single-word
210-
* labels in a fillMaxWidth Button, which made "Scan" / "Pair" / "Stop"
211-
* float in the middle while longer earlier labels filled the chip.
204+
* Compact scan-action button sized to its label, sitting at the left edge
205+
* of its parent column. Shared between the Flic scan card and the External
206+
* GPS card so the two cards in the Integration tab share an identical
207+
* visual rhythm — short word, natural-width button, left-aligned.
212208
*/
213209
@Composable
214210
fun LeftAlignedScanButton(
@@ -222,14 +218,9 @@ fun LeftAlignedScanButton(
222218
else ButtonDefaults.buttonColors()
223219
Button(
224220
onClick = onClick,
225-
modifier = modifier.fillMaxWidth(),
221+
modifier = modifier,
226222
colors = colors
227223
) {
228-
Row(
229-
modifier = Modifier.fillMaxWidth(),
230-
verticalAlignment = Alignment.CenterVertically
231-
) {
232-
Text(text = label)
233-
}
224+
Text(text = label)
234225
}
235226
}

0 commit comments

Comments
 (0)