Update hint label color selection

This commit is contained in:
Aleksandras Kostarevas 2024-08-28 20:21:39 +03:00
parent 0c78fe5f12
commit c5d3fe9917

View File

@ -19,9 +19,10 @@ import android.graphics.Rect
import android.graphics.Typeface import android.graphics.Typeface
import android.graphics.drawable.Drawable import android.graphics.drawable.Drawable
import android.text.TextUtils import android.text.TextUtils
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.toArgb
import org.futo.inputmethod.keyboard.internal.KeyDrawParams import org.futo.inputmethod.keyboard.internal.KeyDrawParams
import org.futo.inputmethod.keyboard.internal.KeySpecParser import org.futo.inputmethod.keyboard.internal.KeySpecParser
import org.futo.inputmethod.keyboard.internal.KeyStyle
import org.futo.inputmethod.keyboard.internal.KeyVisualAttributes import org.futo.inputmethod.keyboard.internal.KeyVisualAttributes
import org.futo.inputmethod.keyboard.internal.KeyboardIconsSet import org.futo.inputmethod.keyboard.internal.KeyboardIconsSet
import org.futo.inputmethod.keyboard.internal.KeyboardParams import org.futo.inputmethod.keyboard.internal.KeyboardParams
@ -368,14 +369,14 @@ data class Key(
} }
fun selectHintTextColor(provider: DynamicThemeProvider, params: KeyDrawParams): Int { fun selectHintTextColor(provider: DynamicThemeProvider, params: KeyDrawParams): Int {
if (hasHintLabel) { return provider.getKeyStyleDescriptor(visualStyle).let { style ->
return params.mHintLabelColor when {
mPressed -> style.foregroundColorPressed
else -> style.foregroundColor
} }
if (hasShiftedLetterHint) { }.let {
return if (isShiftedLetterActivated) params.mShiftedLetterHintActivatedColor Color(it).copy(alpha = 0.5f).toArgb()
else params.mShiftedLetterHintInactivatedColor
} }
return params.mHintLetterColor
} }
fun selectMoreKeyTextSize(params: KeyDrawParams): Int { fun selectMoreKeyTextSize(params: KeyDrawParams): Int {