swkbd: Added swkbdInlineGetMiniaturizedHeight.

This commit is contained in:
yellows8 2020-12-16 20:32:42 -05:00
parent c51918a605
commit 0d5dcde5b9
No known key found for this signature in database
GPG Key ID: 0AF90DA3F1E60E43
2 changed files with 15 additions and 0 deletions

View File

@ -650,6 +650,12 @@ Result swkbdInlineGetImage(SwkbdInline* s, void* buffer, u64 size, bool *data_av
*/
s32 swkbdInlineGetMaxHeight(SwkbdInline* s);
/**
* @brief Gets the MiniaturizedHeight, relative to the bottom of the screen.
* @param s SwkbdInline object.
*/
s32 swkbdInlineGetMiniaturizedHeight(SwkbdInline* s);
/**
* @brief GetTouchRectangles. Returns number of valid Rects: 1 for only keytop, 2 for keytop/footer.
* @param s SwkbdInline object.

View File

@ -589,6 +589,15 @@ s32 swkbdInlineGetMaxHeight(SwkbdInline* s) {
return s->state == SwkbdState_Unknown6 ? height1 : height0;
}
s32 swkbdInlineGetMiniaturizedHeight(SwkbdInline* s) {
bool flag=0;
if (s->calcArg.appearArg.type >= SwkbdType_ZhHans && s->calcArg.appearArg.type <= SwkbdType_Unknown9) flag = 1;
else if (!(s->calcArg.appearArg.dicFlag && s->wordInfoInitialized && s->dicCustomInitialized)) {
flag = !s->calcArg.appearArg.keySetDisableBitmask && (s->calcArg.appearArg.type != SwkbdType_NumPad && s->calcArg.appearArg.type != SwkbdType_QWERTY);
}
return flag ? 132 : 72;
}
s32 swkbdInlineGetTouchRectangles(SwkbdInline* s, SwkbdRect *keytop, SwkbdRect *footer) {
float keytop_max_height = (float)swkbdInlineGetMaxHeight(s);
float footer_max_height = keytop_max_height;