diff options
-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)); |