mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
Rename floatingBottomCenterOriginDp to floatingBottomOriginDp to better represent actual implementation
This commit is contained in:
parent
28f3c07d5f
commit
2e2bba2ac2
@ -717,7 +717,7 @@ class UixManager(private val latinIME: LatinIME) {
|
|||||||
}, onDragEnd = {
|
}, onDragEnd = {
|
||||||
latinIME.sizingCalculator.editSavedSettings { settings ->
|
latinIME.sizingCalculator.editSavedSettings { settings ->
|
||||||
settings.copy(
|
settings.copy(
|
||||||
floatingBottomCenterOriginDp = Pair(
|
floatingBottomOriginDp = Pair(
|
||||||
offset.value.x.toDp().value,
|
offset.value.x.toDp().value,
|
||||||
offset.value.y.toDp().value
|
offset.value.y.toDp().value
|
||||||
)
|
)
|
||||||
|
@ -147,7 +147,8 @@ data class SavedKeyboardSizingSettings(
|
|||||||
val oneHandedDirection: OneHandedDirection,
|
val oneHandedDirection: OneHandedDirection,
|
||||||
|
|
||||||
// Floating
|
// Floating
|
||||||
val floatingBottomCenterOriginDp: Pair<Float, Float>, // relative to bottom left of screen, .second is Y up
|
// bottom left of the floating keyboard, relative to bottom left of screen, .second is Y up
|
||||||
|
val floatingBottomOriginDp: Pair<Float, Float>,
|
||||||
val floatingWidthDp: Float,
|
val floatingWidthDp: Float,
|
||||||
val floatingHeightDp: Float
|
val floatingHeightDp: Float
|
||||||
) {
|
) {
|
||||||
@ -180,7 +181,7 @@ val DefaultKeyboardSettings = mapOf(
|
|||||||
splitWidthFraction = 4.0f / 5.0f,
|
splitWidthFraction = 4.0f / 5.0f,
|
||||||
oneHandedDirection = OneHandedDirection.Right,
|
oneHandedDirection = OneHandedDirection.Right,
|
||||||
oneHandedRectDp = Rect(4, 4, 364, 30),
|
oneHandedRectDp = Rect(4, 4, 364, 30),
|
||||||
floatingBottomCenterOriginDp = Pair(0.0f, 0.0f),
|
floatingBottomOriginDp = Pair(0.0f, 0.0f),
|
||||||
floatingHeightDp = 240.0f,
|
floatingHeightDp = 240.0f,
|
||||||
floatingWidthDp = 360.0f
|
floatingWidthDp = 360.0f
|
||||||
),
|
),
|
||||||
@ -192,7 +193,7 @@ val DefaultKeyboardSettings = mapOf(
|
|||||||
splitWidthFraction = 3.0f / 5.0f,
|
splitWidthFraction = 3.0f / 5.0f,
|
||||||
oneHandedDirection = OneHandedDirection.Right,
|
oneHandedDirection = OneHandedDirection.Right,
|
||||||
oneHandedRectDp = Rect(4, 4, 364, 30),
|
oneHandedRectDp = Rect(4, 4, 364, 30),
|
||||||
floatingBottomCenterOriginDp = Pair(0.0f, 0.0f),
|
floatingBottomOriginDp = Pair(0.0f, 0.0f),
|
||||||
floatingHeightDp = 240.0f,
|
floatingHeightDp = 240.0f,
|
||||||
floatingWidthDp = 360.0f
|
floatingWidthDp = 360.0f
|
||||||
),
|
),
|
||||||
@ -204,7 +205,7 @@ val DefaultKeyboardSettings = mapOf(
|
|||||||
splitWidthFraction = 3.0f / 5.0f,
|
splitWidthFraction = 3.0f / 5.0f,
|
||||||
oneHandedDirection = OneHandedDirection.Right,
|
oneHandedDirection = OneHandedDirection.Right,
|
||||||
oneHandedRectDp = Rect(4, 4, 364, 30),
|
oneHandedRectDp = Rect(4, 4, 364, 30),
|
||||||
floatingBottomCenterOriginDp = Pair(0.0f, 0.0f),
|
floatingBottomOriginDp = Pair(0.0f, 0.0f),
|
||||||
floatingHeightDp = 240.0f,
|
floatingHeightDp = 240.0f,
|
||||||
floatingWidthDp = 360.0f
|
floatingWidthDp = 360.0f
|
||||||
),
|
),
|
||||||
@ -374,8 +375,8 @@ class KeyboardSizingCalculator(val context: Context, val uixManager: UixManager)
|
|||||||
val recommendedHeightFloat = singularRowHeightFloat * numRows
|
val recommendedHeightFloat = singularRowHeightFloat * numRows
|
||||||
FloatingKeyboardSize(
|
FloatingKeyboardSize(
|
||||||
bottomOrigin = Pair(
|
bottomOrigin = Pair(
|
||||||
dp(savedSettings.floatingBottomCenterOriginDp.first),
|
dp(savedSettings.floatingBottomOriginDp.first),
|
||||||
dp(savedSettings.floatingBottomCenterOriginDp.second)
|
dp(savedSettings.floatingBottomOriginDp.second)
|
||||||
),
|
),
|
||||||
width = dp(savedSettings.floatingWidthDp),
|
width = dp(savedSettings.floatingWidthDp),
|
||||||
height = recommendedHeightFloat.toInt(),
|
height = recommendedHeightFloat.toInt(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user