summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-12-10 16:23:24 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-12-10 16:23:24 +0200
commit97a3dc5ef8829f744c6191d7c77681c1b2f1a07b (patch)
tree50895a30f8698fcbea7dfbd6b8d542ebb521d6e4 /src
parentec88d55f71663ef711531c002434d9f55fe885f8 (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.h1
-rw-r--r--src/ios.m3
-rw-r--r--src/ui/inputwidget.c2
3 files changed, 6 insertions, 0 deletions
diff --git a/src/ios.h b/src/ios.h
index fbe7c2eb..bf742f1f 100644
--- a/src/ios.h
+++ b/src/ios.h
@@ -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
79iDeclareType(SystemTextInput) 80iDeclareType(SystemTextInput)
diff --git a/src/ios.m b/src/ios.m
index 43d7ec69..c9e843e4 100644
--- a/src/ios.m
+++ b/src/ios.m
@@ -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));