Skip to content

Commit 4e2cdb1

Browse files
committed
Make enter key bigger font
1 parent 13ea78d commit 4e2cdb1

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

app/src/main/java/rs/ruffle/Keyboard.kt

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ import androidx.compose.ui.Modifier
3030
import androidx.compose.ui.graphics.RectangleShape
3131
import androidx.compose.ui.graphics.vector.ImageVector
3232
import androidx.compose.ui.tooling.preview.Preview
33+
import androidx.compose.ui.unit.TextUnit
3334
import androidx.compose.ui.unit.dp
35+
import androidx.compose.ui.unit.em
3436
import rs.ruffle.ui.theme.RuffleTheme
3537

3638
val BUTTON_ROWS = arrayOf(
@@ -77,7 +79,7 @@ val BUTTON_ROWS = arrayOf(
7779
KeyboardButton(keyCode = 66, keyChar = 'b', text = "B"),
7880
KeyboardButton(keyCode = 78, keyChar = 'n', text = "N"),
7981
KeyboardButton(keyCode = 77, keyChar = 'm', text = "M"),
80-
KeyboardButton(keyCode = 13, keyChar = '\u000D', text = "")
82+
KeyboardButton(keyCode = 13, keyChar = '\u000D', text = "", size = 5.em)
8183
),
8284
arrayOf(
8385
KeyboardButton(keyCode = 17, text = "CTRL"),
@@ -102,10 +104,11 @@ data class KeyboardButton(
102104
val keyCode: Byte,
103105
val keyChar: Char = '\u0000',
104106
val text: String = keyChar.toString(),
105-
val icon: ImageVector? = null
107+
val icon: ImageVector? = null,
108+
val size: TextUnit = TextUnit.Unspecified
106109
)
107110

108-
class ContextMenuItem(
111+
data class ContextMenuItem(
109112
val text: String,
110113
val separatorBefore: Boolean,
111114
val enabled: Boolean,
@@ -237,7 +240,10 @@ fun TextButton(
237240
if (button.icon != null) {
238241
Icon(button.icon, contentDescription = button.text)
239242
} else {
240-
Text(text = button.text)
243+
Text(
244+
text = button.text,
245+
fontSize = button.size
246+
)
241247
}
242248
}
243249
}

0 commit comments

Comments
 (0)