diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-12-10 16:23:24 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-12-10 16:23:24 +0200 |
commit | 97a3dc5ef8829f744c6191d7c77681c1b2f1a07b (patch) | |
tree | 50895a30f8698fcbea7dfbd6b8d542ebb521d6e4 /src | |
parent | ec88d55f71663ef711531c002434d9f55fe885f8 (diff) |
iOS: Extra padding at bottom of upload text editor
Long multiline editors should have a fair bit of overscroll at the bottom, as long as it doesn't affect the normal expanding editors.
Diffstat (limited to 'src')
-rw-r--r-- | src/ios.h | 1 | ||||
-rw-r--r-- | src/ios.m | 3 | ||||
-rw-r--r-- | src/ui/inputwidget.c | 2 |
3 files changed, 6 insertions, 0 deletions
@@ -74,6 +74,7 @@ enum iSystemTextInputFlags { | |||
74 | disableAutocapitalize_SystemTextInputFlag = iBit(6), | 74 | disableAutocapitalize_SystemTextInputFlag = iBit(6), |
75 | alignRight_SystemTextInputFlag = iBit(7), | 75 | alignRight_SystemTextInputFlag = iBit(7), |
76 | insertNewlines_SystemTextInputFlag = iBit(8), | 76 | insertNewlines_SystemTextInputFlag = iBit(8), |
77 | extraPadding_SystemTextInputFlag = iBit(9), | ||
77 | }; | 78 | }; |
78 | 79 | ||
79 | iDeclareType(SystemTextInput) | 80 | iDeclareType(SystemTextInput) |
@@ -771,6 +771,9 @@ void init_SystemTextInput(iSystemTextInput *d, iRect rect, int flags) { | |||
771 | [view setBackgroundColor:[UIColor colorWithWhite:1.0f alpha:0.0f]]; | 771 | [view setBackgroundColor:[UIColor colorWithWhite:1.0f alpha:0.0f]]; |
772 | [view setTextColor:textColor]; | 772 | [view setTextColor:textColor]; |
773 | [view setTintColor:tintColor]; | 773 | [view setTintColor:tintColor]; |
774 | if (flags & extraPadding_SystemTextInputFlag) { | ||
775 | [view setContentInset:(UIEdgeInsets){ 0, 0, 3 * gap_UI / get_Window()->pixelRatio, 0}]; | ||
776 | } | ||
774 | [view setEditable:YES]; | 777 | [view setEditable:YES]; |
775 | [view setDelegate:appState_]; | 778 | [view setDelegate:appState_]; |
776 | [view becomeFirstResponder]; | 779 | [view becomeFirstResponder]; |
diff --git a/src/ui/inputwidget.c b/src/ui/inputwidget.c index 22f983eb..18c0c20c 100644 --- a/src/ui/inputwidget.c +++ b/src/ui/inputwidget.c | |||
@@ -1179,7 +1179,9 @@ void begin_InputWidget(iInputWidget *d) { | |||
1179 | (d->maxWrapLines > 1 ? multiLine_SystemTextInputFlags : 0) | | 1179 | (d->maxWrapLines > 1 ? multiLine_SystemTextInputFlags : 0) | |
1180 | (d->inFlags & isUrl_InputWidgetFlag ? (disableAutocorrect_SystemTextInputFlag | | 1180 | (d->inFlags & isUrl_InputWidgetFlag ? (disableAutocorrect_SystemTextInputFlag | |
1181 | disableAutocapitalize_SystemTextInputFlag) : 0) | | 1181 | disableAutocapitalize_SystemTextInputFlag) : 0) | |
1182 | /* widget-specific tweaks (hacks) */ | ||
1182 | (!cmp_String(id_Widget(w), "url") ? returnGo_SystemTextInputFlags : 0) | | 1183 | (!cmp_String(id_Widget(w), "url") ? returnGo_SystemTextInputFlags : 0) | |
1184 | (!cmp_String(id_Widget(w), "upload.text") ? extraPadding_SystemTextInputFlag : 0) | | ||
1183 | (flags_Widget(w) & alignRight_WidgetFlag ? alignRight_SystemTextInputFlag : 0) | | 1185 | (flags_Widget(w) & alignRight_WidgetFlag ? alignRight_SystemTextInputFlag : 0) | |
1184 | (isAllowedToInsertNewline_InputWidget_(d) ? insertNewlines_SystemTextInputFlag : 0) | | 1186 | (isAllowedToInsertNewline_InputWidget_(d) ? insertNewlines_SystemTextInputFlag : 0) | |
1185 | (d->inFlags & selectAllOnFocus_InputWidgetFlag ? selectAll_SystemTextInputFlags : 0)); | 1187 | (d->inFlags & selectAllOnFocus_InputWidgetFlag ? selectAll_SystemTextInputFlags : 0)); |