summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-12-08 17:37:15 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-12-08 17:37:15 +0200
commit1fd1ad1f5220c0a567ca3839b32393b9ce274589 (patch)
tree63e11f6ca4425f5f845365eadbca2e0e85a3662d
parenta8d64c19ee2a1015dbbaa019170940f6b7427485 (diff)
Mobile: Hide iOS text view background; Translation panel positioning
Mobile panels should always be root-parented, but the source document relationship is currently not communicated in any other way.
-rw-r--r--src/ios.m2
-rw-r--r--src/ui/documentwidget.c5
-rw-r--r--src/ui/util.c3
3 files changed, 8 insertions, 2 deletions
diff --git a/src/ios.m b/src/ios.m
index 6a30c8a8..021e354d 100644
--- a/src/ios.m
+++ b/src/ios.m
@@ -759,7 +759,7 @@ void init_SystemTextInput(iSystemTextInput *d, iRect rect, int flags) {
759 } 759 }
760 else { 760 else {
761 UITextView *view = REF_d_view; 761 UITextView *view = REF_d_view;
762 [view setBackgroundColor:backgroundColor]; 762 [view setBackgroundColor:[UIColor colorWithWhite:1.0f alpha:0.0f]];
763 [view setTextColor:textColor]; 763 [view setTextColor:textColor];
764 [view setTintColor:tintColor]; 764 [view setTintColor:tintColor];
765 [view setEditable:YES]; 765 [view setEditable:YES];
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c
index 3dadb911..a9a0e07c 100644
--- a/src/ui/documentwidget.c
+++ b/src/ui/documentwidget.c
@@ -3204,6 +3204,11 @@ static iBool handleCommand_DocumentWidget_(iDocumentWidget *d, const char *cmd)
3204 else if (equal_Command(cmd, "document.translate") && d == document_App()) { 3204 else if (equal_Command(cmd, "document.translate") && d == document_App()) {
3205 if (!d->translation) { 3205 if (!d->translation) {
3206 d->translation = new_Translation(d); 3206 d->translation = new_Translation(d);
3207 if (isUsingPanelLayout_Mobile()) {
3208 const iRect safe = safeRect_Root(w->root);
3209 d->translation->dlg->rect.pos = windowToLocal_Widget(w, zero_I2());
3210 d->translation->dlg->rect.size = safe.size;
3211 }
3207 } 3212 }
3208 return iTrue; 3213 return iTrue;
3209 } 3214 }
diff --git a/src/ui/util.c b/src/ui/util.c
index 6e139856..21067bf4 100644
--- a/src/ui/util.c
+++ b/src/ui/util.c
@@ -1655,7 +1655,8 @@ static void updateValueInputSizing_(iWidget *dlg) {
1655 } 1655 }
1656 else { 1656 else {
1657 dlg->rect.size.x = 1657 dlg->rect.size.x =
1658 iMin(rootSize.x, iMaxi(iMaxi(100 * gap_UI, title->rect.size.x), prompt->rect.size.x)); 1658 iMin(rootSize.x, iMaxi(iMaxi(100 * gap_UI, title ? title->rect.size.x : 0),
1659 prompt->rect.size.x));
1659 } 1660 }
1660 /* Adjust the maximum number of visible lines. */ 1661 /* Adjust the maximum number of visible lines. */
1661 int footer = 6 * gap_UI; 1662 int footer = 6 * gap_UI;