Modern Apps git

← Modern-Apps.git

minesweeper: fix difficulty text wrap (#699)

Commit
837697422ae0844719a67d0b15d028c34ef1d4a0
Author
vayun-mathur <[email protected]>
When
2026-09-12 23:52 UTC (2 months ago)
Parents
7b9df97

Diff

games/minesweeper/src/main/java/com/vayunmathur/games/minesweeper/ui/dialogs/GameConfigDialog.kt
diff --git a/games/minesweeper/src/main/java/com/vayunmathur/games/minesweeper/ui/dialogs/GameConfigDialog.kt b/games/minesweeper/src/main/java/com/vayunmathur/games/minesweeper/ui/dialogs/GameConfigDialog.ktindex f6bbb4ba29..59ff36ac98 100644--- a/games/minesweeper/src/main/java/com/vayunmathur/games/minesweeper/ui/dialogs/GameConfigDialog.kt+++ b/games/minesweeper/src/main/java/com/vayunmathur/games/minesweeper/ui/dialogs/GameConfigDialog.kt@@ -11,6 +11,7 @@ import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource+import androidx.compose.ui.text.style.TextOverflow import com.vayunmathur.games.minesweeper.R import com.vayunmathur.games.minesweeper.data.BoardSize import com.vayunmathur.games.minesweeper.data.Difficulty@@ -54,23 +55,39 @@ fun GameConfigDialog(                 verticalArrangement = Arrangement.spacedBy(Spacing.md),             ) {                 Text(stringResource(R.string.field_size), style = MaterialTheme.typography.labelLarge)-                SingleChoiceSegmentedButtonRow {+                SingleChoiceSegmentedButtonRow(Modifier.fillMaxWidth()) {                     BoardSize.entries.forEachIndexed { index, value ->                         SegmentedButton(                             shape = SegmentedButtonDefaults.itemShape(index, BoardSize.entries.size),                             onClick = { size = value },                             selected = size == value,-                        ) { Text(value.displayName()) }+                            modifier = Modifier.weight(1f),+                        ) {+                            Text(+                                value.displayName(),+                                maxLines = 1,+                                softWrap = false,+                                overflow = TextOverflow.Ellipsis,+                            )+                        }                     }                 }                 Text(stringResource(R.string.difficulty), style = MaterialTheme.typography.labelLarge)-                SingleChoiceSegmentedButtonRow {+                SingleChoiceSegmentedButtonRow(Modifier.fillMaxWidth()) {                     Difficulty.entries.forEachIndexed { index, value ->                         SegmentedButton(                             shape = SegmentedButtonDefaults.itemShape(index, Difficulty.entries.size),                             onClick = { difficulty = value },                             selected = difficulty == value,-                        ) { Text(value.displayName()) }+                            modifier = Modifier.weight(1f),+                        ) {+                            Text(+                                value.displayName(),+                                maxLines = 1,+                                softWrap = false,+                                overflow = TextOverflow.Ellipsis,+                            )+                        }                     }                 }                 Text(
games/sudoku/src/main/java/com/vayunmathur/games/sudoku/ui/dialogs/GameConfigDialog.kt
diff --git a/games/sudoku/src/main/java/com/vayunmathur/games/sudoku/ui/dialogs/GameConfigDialog.kt b/games/sudoku/src/main/java/com/vayunmathur/games/sudoku/ui/dialogs/GameConfigDialog.ktindex d7a2d43438..89de256ae8 100644--- a/games/sudoku/src/main/java/com/vayunmathur/games/sudoku/ui/dialogs/GameConfigDialog.kt+++ b/games/sudoku/src/main/java/com/vayunmathur/games/sudoku/ui/dialogs/GameConfigDialog.kt@@ -11,6 +11,7 @@ import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource+import androidx.compose.ui.text.style.TextOverflow import com.vayunmathur.games.sudoku.R import com.vayunmathur.games.sudoku.data.BoardSize import com.vayunmathur.games.sudoku.data.Difficulty@@ -56,26 +57,42 @@ fun GameConfigDialog(                     stringResource(R.string.board_size),                     style = MaterialTheme.typography.labelLarge,                 )-                SingleChoiceSegmentedButtonRow {+                SingleChoiceSegmentedButtonRow(Modifier.fillMaxWidth()) {                     BoardSize.entries.forEachIndexed { index, value ->                         SegmentedButton(                             shape = SegmentedButtonDefaults.itemShape(index, BoardSize.entries.size),                             onClick = { size = value },                             selected = size == value,-                        ) { Text(value.displayName()) }+                            modifier = Modifier.weight(1f),+                        ) {+                            Text(+                                value.displayName(),+                                maxLines = 1,+                                softWrap = false,+                                overflow = TextOverflow.Ellipsis,+                            )+                        }                     }                 }                 Text(                     stringResource(R.string.difficulty),                     style = MaterialTheme.typography.labelLarge,                 )-                SingleChoiceSegmentedButtonRow {+                SingleChoiceSegmentedButtonRow(Modifier.fillMaxWidth()) {                     Difficulty.entries.forEachIndexed { index, value ->                         SegmentedButton(                             shape = SegmentedButtonDefaults.itemShape(index, Difficulty.entries.size),                             onClick = { difficulty = value },                             selected = difficulty == value,-                        ) { Text(value.displayName()) }+                            modifier = Modifier.weight(1f),+                        ) {+                            Text(+                                value.displayName(),+                                maxLines = 1,+                                softWrap = false,+                                overflow = TextOverflow.Ellipsis,+                            )+                        }                     }                 }                 Button(