@@ -30,7 +30,9 @@ import androidx.compose.ui.Modifier
30
30
import androidx.compose.ui.graphics.RectangleShape
31
31
import androidx.compose.ui.graphics.vector.ImageVector
32
32
import androidx.compose.ui.tooling.preview.Preview
33
+ import androidx.compose.ui.unit.TextUnit
33
34
import androidx.compose.ui.unit.dp
35
+ import androidx.compose.ui.unit.em
34
36
import rs.ruffle.ui.theme.RuffleTheme
35
37
36
38
val BUTTON_ROWS = arrayOf(
@@ -77,7 +79,7 @@ val BUTTON_ROWS = arrayOf(
77
79
KeyboardButton (keyCode = 66 , keyChar = ' b' , text = " B" ),
78
80
KeyboardButton (keyCode = 78 , keyChar = ' n' , text = " N" ),
79
81
KeyboardButton (keyCode = 77 , keyChar = ' m' , text = " M" ),
80
- KeyboardButton (keyCode = 13 , keyChar = ' \u000D ' , text = " ↵" )
82
+ KeyboardButton (keyCode = 13 , keyChar = ' \u000D ' , text = " ↵" , size = 5 .em )
81
83
),
82
84
arrayOf(
83
85
KeyboardButton (keyCode = 17 , text = " CTRL" ),
@@ -102,10 +104,11 @@ data class KeyboardButton(
102
104
val keyCode : Byte ,
103
105
val keyChar : Char = ' \u0000 ' ,
104
106
val text : String = keyChar.toString(),
105
- val icon : ImageVector ? = null
107
+ val icon : ImageVector ? = null ,
108
+ val size : TextUnit = TextUnit .Unspecified
106
109
)
107
110
108
- class ContextMenuItem (
111
+ data class ContextMenuItem (
109
112
val text : String ,
110
113
val separatorBefore : Boolean ,
111
114
val enabled : Boolean ,
@@ -237,7 +240,10 @@ fun TextButton(
237
240
if (button.icon != null ) {
238
241
Icon (button.icon, contentDescription = button.text)
239
242
} else {
240
- Text (text = button.text)
243
+ Text (
244
+ text = button.text,
245
+ fontSize = button.size
246
+ )
241
247
}
242
248
}
243
249
}
0 commit comments