From 1410bbde7779efe3a20f603523547c8b8f55b6a1 Mon Sep 17 00:00:00 2001

From: =?UTF-8?q?Jaakko=20Kera=CC=88nen?= jaakko.keranen@iki.fi

Date: Sat, 11 Sep 2021 07:43:57 +0300

Subject: [PATCH 1/1] Mobile: Many UI improvements; Upload UI


po/en.po | 22 ++++-

res/lang/de.bin | Bin 24008 -> 24162 bytes

res/lang/en.bin | Bin 22609 -> 22763 bytes

res/lang/es.bin | Bin 25135 -> 25286 bytes

res/lang/fi.bin | Bin 25140 -> 25291 bytes

res/lang/fr.bin | Bin 26109 -> 26260 bytes

res/lang/ia.bin | Bin 24736 -> 24890 bytes

res/lang/ie.bin | Bin 24494 -> 24645 bytes

res/lang/pl.bin | Bin 25669 -> 25823 bytes

res/lang/ru.bin | Bin 37391 -> 37542 bytes

res/lang/sr.bin | Bin 37048 -> 37199 bytes

res/lang/tok.bin | Bin 22930 -> 23081 bytes

res/lang/zh_Hans.bin | Bin 21688 -> 21842 bytes

res/lang/zh_Hant.bin | Bin 21873 -> 22027 bytes

src/app.c | 7 +-

src/ui/certimportwidget.c | 120 ++++++++++++++----------

src/ui/documentwidget.c | 9 +-

src/ui/labelwidget.c | 17 ++--

src/ui/mobile.c | 134 ++++++++++++++++++++-------

src/ui/mobile.h | 19 +++-

src/ui/root.c | 10 +-

src/ui/uploadwidget.c | 188 ++++++++++++++++++++++----------------

src/ui/util.c | 15 ++-

src/ui/widget.c | 4 +-

24 files changed, 349 insertions(+), 196 deletions(-)

diff --git a/po/en.po b/po/en.po

index dd3af388..546a9489 100644

--- a/po/en.po

+++ b/po/en.po

@@ -251,6 +251,10 @@ msgstr "Show Feed Entries"

msgid "menu.preferences"

msgstr "Preferences…"

+# used for Preferences on mobile

+msgid "menu.settings"

+msgstr "Settings…"

msgid "menu.help"

msgstr "Help"

@@ -906,7 +910,7 @@ msgid "heading.lookup.other"

msgstr "OTHER"

msgid "menu.page.upload"

-msgstr "Upload Page with Titan"

+msgstr "Upload Page with Titan…"

msgid "heading.upload"

msgstr "UPLOAD WITH TITAN"

@@ -953,6 +957,18 @@ msgstr "Set the Titan server port to use for this URL.\nThe port is saved in the

msgid "dlg.uploadport.set"

msgstr "Set Port"

+# used on mobile

+msgid "dlg.upload.text"

+msgstr "Upload Plain Text"

+# used on mobile

+msgid "dlg.upload.file"

+msgstr "Upload a File"

+# used on mobile

+msgid "dlg.upload.pickfile"

+msgstr "Select File…"

msgid "heading.translate"

msgstr "TRANSLATE PAGE"

@@ -1151,6 +1167,10 @@ msgstr "SPECIAL TAGS"

msgid "heading.prefs"

msgstr "PREFERENCES"

+# used on mobile

+msgid "heading.settings"

+msgstr "SETTINGS"

msgid "heading.prefs.certs"

msgstr "CERTIFICATES"

diff --git a/res/lang/de.bin b/res/lang/de.bin

index 9d87657f97d85d8ddbe180c270be81df99307d03..ba87d002c8671b2ca6feae6ed9c069119dbbeca3 100644

GIT binary patch

delta 152

zcmX@HoAJ>e#tjq2Ow%%RQW-)Ea`F>X6cQEOK)jTkbiGorh+aWvayD2+aB5C!atT=e

zQNyyytzt^zdL^k9B`~c4If<Eh3L!v|&2z+zWCc=7N;31(iy4AlLqa_L+=DkCF@7Mz

X4Ai=LiN`EPVYoDu0g^EHnkWna7lJx1

delta 33

rcmV++0N(%NyaC9&0kDx4lhPIzvkDg{9kWX`))ccONtyw(*h-2M@$C(5

diff --git a/res/lang/en.bin b/res/lang/en.bin

index 9fe4cfb37e8ed4b3d7c374d5d0bf17996123052d..a7dfb86623fc8870a76d515150fb36417028db93 100644

GIT binary patch

delta 152

zcmcb(f${Z5#tjZ)rfHcusSKe7Ir)hx3W*ACAYMvNx?U+*M6Vz-IUB4ZI5j6Vxdbf#

zsA1V;6EP)my^_?55}4M2oW#sLg%F^~W^b`~(gLX^C7F5Y#SFo&At9cA?!lY&jW!E0

W1GR2<Wk8f43~y7KoTKte+2=9684T

delta 33

rcmV++0N(%Wu>sMr0kA+8lYtf%v$+=I8?&}DsS>kdMR@_U^+xs)0Zk7D

diff --git a/res/lang/es.bin b/res/lang/es.bin

index 1effaf3d28b592136c50cc36550a2becfb9b61d7..7e7398d65e2f39f220858a218ebbb1ab361df446 100644

GIT binary patch

delta 143

zcmZ2~gz?x>#tj|frfHcusSKe7Ir)hx3W*ACAYMvNx?U+*M6Vz-IUB4ZI5j6Vxdbf#

zsA1XU8gV6Yy^_?55}4M2oW#sLg%F^~=E>qG<pfeoN;31(iy4AlLqa_L+=Dj<nJp3*

QhKoWOK%+Ll^>q>f0R87S1^@s6

delta 28

kcmX?hlyUtL#tj|flTV6^ZDy3%C%5^g*$nZ`-G0_00Ju&I%>V!Z

diff --git a/res/lang/fi.bin b/res/lang/fi.bin

index fcaa8cc6b7a7b981f7d95beddf72f4a28109a8bd..607e52fde5fe368fa19859bee317c347d4ecf877 100644

GIT binary patch

delta 143

zcmdmTgz@xI#tkpTP17=SQW-)Ea`F>X6cQEOK)jTkbiGorh+aWvayD2+aB5C!atT=e

zQNyyycf?i1^-5AJN?=+8auPH16heR^o4<-%$O)vDlw{_m7c&IAhJ<+fxd(4nHd`zq

Q3>SqmfJSZJ?^h}e07nisdjJ3c

delta 28

kcmX?olyS=u#tkpTCu>SbY)+QYmD{|^Y^KEKSpPg>0J6>tLjV8(

diff --git a/res/lang/fr.bin b/res/lang/fr.bin

index 32104f447641e53c0962963854c72c19ebb2f794..955695edf3e411303dcc3746ef6f72e1f1049798 100644

GIT binary patch

delta 143

zcmex+nsLfm#tmhXrfHcusSKe7Ir)hx3W*ACAYMvNx?U+*M6Vz-IUB4ZI5j6Vxdbf#

zsA1XUEJ+P<y^_?55}4M2oW#sLg%F^~=61=&@&c(PC7F5Y#SFo&At9cA?!lWCEUP7i

P;i6Cm(5TH*0y9Mb_dGRa

delta 28

kcmbPomhtat#tmhXlebICZ2l@aLw@se%R-6GMnOp;0Kv%&D*ylh

diff --git a/res/lang/ia.bin b/res/lang/ia.bin

index 5b64a18219203885ded6732a54757619f338e0e6..61a18efc6b0928503d5d08631b769dcd216753f0 100644

GIT binary patch

delta 152

zcmZ2*ka5=#tk#XP17=SQW-)EaF>X6cQEOK)jTkbiGorh+aWvayD2+aB5C!atT=e

zQNyyyJ>p8@dL^k9B`~c4If<Eh3L!v|&5OmWWCc=7N;31(iy4AlLqa_L+=Dj@o8Ay*

W25Q~>+N+&W7%mNEfF!bgOho|nN;#we

delta 33

pcmdmWh;hL|#tk#XC*Kqo+bk%NFS~h`={eEO+1~Apn|XZoL;&)h4CDX+

diff --git a/res/lang/ie.bin b/res/lang/ie.bin

index 6d56897233e9307a9fbb31fc7f9676c14dce98b9..06ea7979a1058c9917ba403e74938a4ace5a4f87 100644

GIT binary patch

delta 143

zcmZ3tpYiAc#tpXOrfHcusSKe7Ir)hx3W*ACAYMvNx?U+*M6Vz-IUB4ZI5j6Vxdbf#

zsA1V;LvbZ>y^_?55}4M2oW#sLg%F^~W)JZbG6Jb3C7F5Y#SFo&At9cA?!lYcOhP1t

P;i6Cm(5TJ9KGDJem7+8F

delta 28

kcmX?lfN|Y^#tpXOlk3FAHg6N(E3>)R#7koHN1qU30J2XDy#N3J

diff --git a/res/lang/pl.bin b/res/lang/pl.bin

index 69ad06f809adea0c42cf1ac6d2aa53044b0134b0..5fc5e24a7b6507cc5a793458c8b8c28296bca8d4 100644

GIT binary patch

delta 152

zcmX?lg7N-I#tlxArfHcusSKe7Ir)hx3W*ACAYMvNx?U+*M6Vz-IUB4ZI5j6Vxdbf#

zsA1V;Gf5?Jy^_?55}4M2oW#sLg%F^~W?#w6assI(C7F5Y#SFo&At9cA?!lYIELg;t

Wfm%09`5j{vhD$>kAc>p)IU)eC{5Yoo

delta 33

rcmV++0N(%K$pOX40kA?DlY<!+v%49{9<!Y|`W3U9PR0SVdQfE)2n-J7

diff --git a/res/lang/ru.bin b/res/lang/ru.bin

index 67babbcda3e1be2296911b5a14a4499c7cf26918..1718f647efc931c66e414b53077b3b498fa7413e 100644

GIT binary patch

delta 143

zcmeBQ!nABD(}q+v)3nT-REE%koczQTg+v865HBSsU9S`@qF0caoDEhHoSKuGTmqJV

z)Ua%Fq?(?%UP)?22~2B1PGV-BLI_Y~bB)?h9f8!6lFYpHVuoPXkPuHl_u$Rh!STw%

Pa8W1&Xw>GzWj@jXwQn`C

delta 28

kcmZ3sl&OCS(}q;F$;;G~HosDPr?dG}aH#U;#Bx_@0J)6}cK`qY

diff --git a/res/lang/sr.bin b/res/lang/sr.bin

index a7f7639bf96143a6ceafaeb1e50700fb9ccd7680..60b7b600fa9b9eb81e31d96ef4d590b62b3577a9 100644

GIT binary patch

delta 160

zcmdn7km>v)rVSre9MUp#QW-)Ea`F>X6cQEOK)jTkbiGorh+aWvayD2+aB5C!atT=e

zQNuDMC6fc?#ATtXOHwOJU}gp6BxdF*gaAc0GpU}@5=bp6$;?YHW(al-3GwuE58iyl

TUrJ3FE(&D;&E9;y^q~|0*!ev0

delta 28

kcmX@Vh-t?{rVSreCL5{BY%WkesI}QUKtOGCY1u6)0JQH5;{X5v

diff --git a/res/lang/tok.bin b/res/lang/tok.bin

index b7476101f2cd7cb3994279af4475eda7abb42222..3298f0e8d7e04720581a88cdd72343aeffbda7fa 100644

GIT binary patch

delta 143

zcmbQVnQS7#tjQZOw%%RQW-)EaF>X6cQEOK)jTkbiGorh+aWvayD2+aB5C!atT=e

zQNyyyQ$&=+^-5AJN?=+8auPH16heR^n^%jRl@v%VDap)BFJ=gK4GHn|a}VB}r&lg6

Q3>SqmfJSY;=ek800Ne+Dylh

delta 28

kcmZ3vg>lkm#tjQZCO;Gr+bk)1NOJR6y<G9lHEwH#0kdNZ@&Et;

diff --git a/res/lang/zh_Hans.bin b/res/lang/zh_Hans.bin

index 03eb8b438d21008cb618b78198b60229a30dfc64..8c32a0c5361579edb3196272d4a28853659dd66a 100644

GIT binary patch

delta 152

zcmdn7lJU|i#tmu0rfHcusSKe7Ir)hx3W*ACAYMvNx?U+*M6Vz-IUB4ZI5j6Vxdbf#

zsA1XUC}AaWy^_?55}4M2oW#sLg%F^~=0f2Wk^-qEC7F5Y#SFo&At9cA?!lY+b=L_q

W1GR46>rlxk43~y7Koa^+ok9SxA~?DL

delta 33

rcmV++0N(%7ssXsE0kCEhlcy6Fv)>b)8MBrxq!Y6}L3shQ&aR||*;g

diff --git a/res/lang/zh_Hant.bin b/res/lang/zh_Hant.bin

index c0378db809212df254de6ba14dcf792b899c492d..68f7d3bc455927498004717eb12779b9dae1f4ef 100644

GIT binary patch

delta 152

zcmeykim`hQ<AyWBrfHcusSKe7Ir)hx3W*ACAYMvNx?U+*M6Vz-IUB4ZI5j6Vxdbf#

zsA1XU1Hww;dL^k9B`~c4If<Eh3L!v|&DVt|ND8Eulw{_m7c&IAhJ<+fxd(5K)qN?<

X4Ai>W&9R<Q7%mNEfF$-gZ59FmBX&BQ

delta 33

pcmeBP!}xI(<AyWBlX*qNHoJ<nN^X9ldtZ3-F~@qw&GF7_gaGjO4ch<!

diff --git a/src/app.c b/src/app.c

index a52552c0..e597edbe 100644

--- a/src/app.c

+++ b/src/app.c

@@ -2382,7 +2382,8 @@ iBool handleCommand_App(const char *cmd) {

         setUrl_UploadWidget(upload, url);

         setResponseViewer_UploadWidget(upload, document_App());

         addChild_Widget(get_Root()->widget, iClob(upload));

+// finalizeSheet_Mobile(as_Widget(upload));

         postRefresh_App();

         return iTrue;

     }

@@ -2761,7 +2762,9 @@ iBool handleCommand_App(const char *cmd) {

     iCertImportWidget *imp = new_CertImportWidget();

     setPageContent_CertImportWidget(imp, sourceContent_DocumentWidget(document_App()));

     addChild_Widget(get_Root()->widget, iClob(imp));

+// finalizeSheet_Mobile(as_Widget(imp));

     postRefresh_App();

     return iTrue;

 }

diff --git a/src/ui/certimportwidget.c b/src/ui/certimportwidget.c

index 2e60c71f..65cb6654 100644

--- a/src/ui/certimportwidget.c

+++ b/src/ui/certimportwidget.c

@@ -104,61 +104,83 @@ static iBool tryImport_CertImportWidget_(iCertImportWidget *d, const iBlock *dat

void init_CertImportWidget(iCertImportWidget *d) {

 iWidget *w = as_Widget(d);

+#if defined (iPlatformAppleMobile)

+#endif

 init_Widget(w);

 setId_Widget(w, "certimport");

 d->cert = NULL;

 }

     addChild_Widget(w, iClob(makePadding_Widget(gap_UI)));

-// addChild_Widget(headings, iClob(makeHeading_Widget("${dlg.certimport.notes}")));

-// addChild_Widget(values, iClob(d->notes = new_InputWidget(0)));

-// setHint_InputWidget(d->notes, "${hint.certimport.description}");

 }

 if (deviceType_App() != desktop_AppDeviceType) {

     /* Try auto-pasting. */

     postCommand_App("certimport.paste");

diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c

index 83f2ea6a..4b3c2db0 100644

--- a/src/ui/documentwidget.c

+++ b/src/ui/documentwidget.c

@@ -2852,7 +2852,8 @@ static iBool handleCommand_DocumentWidget_(iDocumentWidget *d, const char *cmd)

         setUrl_UploadWidget(upload, d->mod.url);

         setResponseViewer_UploadWidget(upload, d);

         addChild_Widget(get_Root()->widget, iClob(upload));

+// finalizeSheet_Mobile(as_Widget(upload));

         postRefresh_App();

     }

     return iTrue;

@@ -3679,16 +3680,10 @@ static iBool processEvent_DocumentWidget_(iDocumentWidget *d, const SDL_Event *e

                         { "---" },

                         { book_Icon " ${menu.page.import}", 0, 0, "bookmark.links confirm:1" },

                         { globe_Icon " ${menu.page.translate}", 0, 0, "document.translate" },

-#if defined (iPlatformMobile)

-#else

                         { upload_Icon " ${menu.page.upload}", 0, 0, "document.upload" },

                         { "---" },

                         { "${menu.page.copyurl}", 0, 0, "document.copylink" } },

                     15);

-#endif

                 if (isEmpty_Range(&d->selectMark)) {

                     pushBackN_Array(

                         &items,

diff --git a/src/ui/labelwidget.c b/src/ui/labelwidget.c

index 03595d1a..ec324d02 100644

--- a/src/ui/labelwidget.c

+++ b/src/ui/labelwidget.c

@@ -244,6 +244,9 @@ static void getColors_LabelWidget_(const iLabelWidget *d, int *bg, int *fg, int

         }

     }

 }

 if (isPress) {

     *bg = uiBackgroundPressed_ColorId | permanent_ColorId;

     if (isButton) {

@@ -257,9 +260,6 @@ static void getColors_LabelWidget_(const iLabelWidget *d, int *bg, int *fg, int

         *fg = isDark_ColorTheme(colorTheme_App()) ? white_ColorId : black_ColorId;

     }

 }

}

iLocalDef int iconPadding_LabelWidget_(const iLabelWidget *d) {

@@ -318,6 +318,10 @@ static void draw_LabelWidget_(const iLabelWidget *d) {

 }

 setClip_Paint(&p, rect);

 const int iconPad = iconPadding_LabelWidget_(d);

 if (d->icon && d->icon != 0x20) { /* no need to draw an empty icon */

     iString str;

     initUnicodeN_String(&str, &d->icon, 1);

@@ -331,10 +335,7 @@ static void draw_LabelWidget_(const iLabelWidget *d) {

                            -gap_UI / 8)),

             init_I2(iconPad, lineHeight_Text(d->font)) },

         iTrue,

         "%s",

         cstr_String(&str));

     deinit_String(&str);

@@ -387,7 +388,7 @@ static void draw_LabelWidget_(const iLabelWidget *d) {

     drawCentered_Text(d->font,

                       (iRect){ addX_I2(topRight_Rect(chRect), -iconPad),

                                init_I2(chSize, height_Rect(chRect)) },

 }

 unsetClip_Paint(&p);

}

diff --git a/src/ui/mobile.c b/src/ui/mobile.c

index daa1fa1a..6ea672e6 100644

--- a/src/ui/mobile.c

+++ b/src/ui/mobile.c

@@ -90,15 +90,15 @@ static void unselectAllPanelButtons_(iWidget *topPanel) {

static iBool mainDetailSplitHandler_(iWidget *mainDetailSplit, const char *cmd) {

 if (equal_Command(cmd, "window.resized")) {

     iWidget *    sheet        = parent_Widget(mainDetailSplit);

     iWidget *    navi         = findChild_Widget(sheet, "panel.navi");

     iWidget *    detailStack  = findChild_Widget(mainDetailSplit, "detailstack");

     const size_t numPanels    = childCount_Widget(detailStack);

     const iBool  isSideBySide = isSideBySideLayout_() && numPanels > 0;

     setFlags_Widget(mainDetailSplit, arrangeHorizontal_WidgetFlag, isSideBySide);

     setFlags_Widget(detailStack, expand_WidgetFlag, isSideBySide);

     setFlags_Widget(detailStack, hidden_WidgetFlag, numPanels == 0);

@@ -172,7 +172,16 @@ static iBool topPanelHandler_(iWidget *topPanel, const char *cmd) {

     }

     unselectAllPanelButtons_(topPanel);

     if (!wasClosed) {

     }

     return iTrue;

 }

@@ -503,11 +512,19 @@ void makePanelItem_Mobile(iWidget *panel, const iMenuItem *item) {

 else if (equal_Command(spec, "label")) {

     iLabelWidget *lab = new_LabelWidget(label, NULL);

     widget = as_Widget(lab);

 }

 else if (equal_Command(spec, "padding")) {

 }

 /* Apply common styling to the heading. */

 if (heading) {

@@ -539,7 +556,7 @@ static const iMenuItem *findDialogCancelAction_(const iMenuItem *items, size_t n

     return NULL;

 }

 for (size_t i = 0; i < n; i++) {

         return &items[i];

     }

 }

@@ -556,13 +573,20 @@ iWidget *makePanelsParent_Mobile(iWidget *parentWidget,

                              const char *id,

                              const iMenuItem *itemsNullTerminated,

                              const iMenuItem *actions, size_t numActions) {

+}

+void initPanels_Mobile(iWidget *panels, iWidget *parentWidget,

 /* A multipanel widget has a top panel and one or more detail panels. In a horizontal layout,

    the detail panels slide in from the right and cover the top panel. In a landscape layout,

    the detail panels are always visible on the side. */

                 resizeToParentWidth_WidgetFlag | resizeToParentHeight_WidgetFlag |

                     frameless_WidgetFlag | focusRoot_WidgetFlag | commandOnClick_WidgetFlag |

                     overflowScrollable_WidgetFlag | leftEdgeDraggable_WidgetFlag,

@@ -572,7 +596,7 @@ iWidget *makePanelsParent_Mobile(iWidget *parentWidget,

     setCommandHandler_Widget(mainDetailSplit, mainDetailSplitHandler_);

     setFlags_Widget(mainDetailSplit, resizeHeightOfChildren_WidgetFlag, iFalse);

     setId_Widget(mainDetailSplit, "mdsplit");

 }

 /* The panel roots. */

 iWidget *topPanel = new_Widget(); {

@@ -591,7 +615,6 @@ iWidget *makePanelsParent_Mobile(iWidget *parentWidget,

     setFlags_Widget(detailStack, collapse_WidgetFlag | resizeWidthOfChildren_WidgetFlag, iTrue);

     addChild_Widget(mainDetailSplit, iClob(detailStack));

 }

 /* Slide top panel with detail panels. */ {

     setFlags_Widget(topPanel, refChildrenOffset_WidgetFlag, iTrue);

     topPanel->offsetRef = detailStack;

@@ -612,15 +635,17 @@ iWidget *makePanelsParent_Mobile(iWidget *parentWidget,

     checkIcon_LabelWidget(naviBack);

     setId_Widget(as_Widget(naviBack), "panel.back");

     setFont_LabelWidget(naviBack, labelFont_());

                          drawBackgroundToVerticalSafeArea_WidgetFlag |

                              arrangeHeight_WidgetFlag | resizeWidthOfChildren_WidgetFlag |

                              resizeToParentWidth_WidgetFlag | arrangeVertical_WidgetFlag);        

 }

 /* Create panel contents based on provided items. */

 for (size_t i = 0; itemsNullTerminated[i].label; i++) {

     const iMenuItem *item = &itemsNullTerminated[i];

     if (equal_Command(item->label, "panel")) {

         const char *id = cstr_Rangecc(range_Command(item->label, "id"));

         const iString *label = hasLabel_Command(item->label, "text")

                                    ? collect_String(suffix_Command(item->label, "text"))

@@ -655,10 +680,12 @@ iWidget *makePanelsParent_Mobile(iWidget *parentWidget,

         setFont_LabelWidget(naviBack, labelBoldFont_());            

     }

     else if (defaultItem && defaultItem != cancelItem) {

         iLabelWidget *defaultButton = new_LabelWidget(defaultItem->label, defaultItem->command);

         setFont_LabelWidget(defaultButton, labelBoldFont_());

         setFlags_Widget(as_Widget(defaultButton),

@@ -689,16 +716,21 @@ iWidget *makePanelsParent_Mobile(iWidget *parentWidget,

         }

         makePanelItem_Mobile(

             topPanel,

     }

 }

 /* Finalize the layout. */

 mainDetailSplitHandler_(mainDetailSplit, "window.resized"); /* make it resize the split */

 postCommand_App("widget.overflow"); /* with the correct dimensions */    

}

#if 0

@@ -1130,7 +1162,9 @@ void setupMenuTransition_Mobile(iWidget *sheet, iBool isIncoming) {

 }

}

-void setupSheetTransition_Mobile(iWidget *sheet, iBool isIncoming) {

+void setupSheetTransition_Mobile(iWidget *sheet, int flags) {

 if (!isUsingPanelLayout_Mobile()) {

     if (prefs_App()->uiAnimations) {

         setFlags_Widget(sheet, horizontalOffset_WidgetFlag, iFalse);

@@ -1144,17 +1178,51 @@ void setupSheetTransition_Mobile(iWidget *sheet, iBool isIncoming) {

     }

     return;

 }

     return;

 }

 if (isIncoming) {

     setVisualOffset_Widget(sheet, 0, 200, easeOut_AnimFlag);

 else {

 }

}

diff --git a/src/ui/mobile.h b/src/ui/mobile.h

index 30679c7c..e1131953 100644

--- a/src/ui/mobile.h

+++ b/src/ui/mobile.h

@@ -35,8 +35,23 @@ iWidget * makePanelsParent_Mobile (iWidget *parent,

                                      const char *id,                                         

                                      const iMenuItem *itemsNullTerminated,

                                      const iMenuItem *actions, size_t numActions);

+void initPanels_Mobile (iWidget *panels, iWidget *parentWidget,

+enum iTransitionFlags {

+};

+enum iTransitionDir {

+};

-void setupMenuTransition_Mobile (iWidget *menu, iBool isIncoming);

-void setupSheetTransition_Mobile (iWidget *sheet, iBool isIncoming);

+void setupMenuTransition_Mobile (iWidget *menu, iBool isIncoming);

+void setupSheetTransition_Mobile (iWidget *sheet, int flags);

void finalizeSheet_Mobile (iWidget *sheet);

diff --git a/src/ui/root.c b/src/ui/root.c

index eae8e4bb..a792e93d 100644

--- a/src/ui/root.c

+++ b/src/ui/root.c

@@ -118,7 +118,7 @@ static const iMenuItem phoneNavMenuItems_[] = {

 { "${menu.downloads}", 0, 0, "downloads.open" },

 { "${menu.feeds.entrylist}", 0, 0, "!open url:about:feeds" },

 { "---" },

};

#endif /* Mobile */

@@ -1163,20 +1163,12 @@ void createUserInterface_Root(iRoot *d) {

                     { star_Icon " ${menu.page.subscribe}", subscribeToPage_KeyModifier, "feeds.subscribe" },

                     { book_Icon " ${menu.page.import}", 0, 0, "bookmark.links confirm:1" },

                     { globe_Icon " ${menu.page.translate}", 0, 0, "document.translate" },

-#if defined (iPlatformMobile)

-#else

                     { upload_Icon " ${menu.page.upload}", 0, 0, "document.upload" },

                     { "---" },

                     { "${menu.page.copyurl}", 0, 0, "document.copylink" },

                     { "${menu.page.copysource}", 'c', KMOD_PRIMARY, "copy" },

                     { download_Icon " " saveToDownloads_Label, SDLK_s, KMOD_PRIMARY, "document.save" } },

                 12);

-#endif

             setId_Widget(as_Widget(pageMenuButton), "pagemenubutton");

             setFont_LabelWidget(pageMenuButton, uiContentBold_FontId);

             setAlignVisually_LabelWidget(pageMenuButton, iTrue);

diff --git a/src/ui/uploadwidget.c b/src/ui/uploadwidget.c

index 4c72c60a..fb8aaf0a 100644

--- a/src/ui/uploadwidget.c

+++ b/src/ui/uploadwidget.c

@@ -81,91 +81,122 @@ void init_UploadWidget(iUploadWidget *d) {

 iWidget *w = as_Widget(d);

 init_Widget(w);

 setId_Widget(w, "upload");

 init_String(&d->originalUrl);

 init_String(&d->url);

 d->viewer = NULL;

 d->request = NULL;

 init_String(&d->filePath);

 d->fileSize = 0;

+// { "padding" },

 }

-// const int bigGap = lineHeight_Text(uiLabel_FontId) * 3 / 4;

-// iWidget *pad = addChild_Widget(headings, iClob(makePadding_Widget(0)));

-// iWidget *hint = addChild_Widget(values, iClob(new_LabelWidget("${upload.file.drophint}", NULL)));

-// pad->sizeRef = hint;

 }

 setBackupFileName_InputWidget(d->input, "uploadbackup.txt");

 updateInputMaxHeight_UploadWidget_(d);

}

@@ -201,6 +232,7 @@ static void setUrlPort_UploadWidget_(iUploadWidget *d, const iString *url, uint1

 appendFormat_String(&d->url, ":%u", overridePort ? overridePort : titanPortForUrl_(url));

 appendRange_String(&d->url, (iRangecc){ parts.path.start, constEnd_String(url) });

 setText_LabelWidget(d->info, &d->url);

}

void setUrl_UploadWidget(iUploadWidget *d, const iString *url) {

@@ -233,7 +265,7 @@ static iBool processEvent_UploadWidget_(iUploadWidget *d, const SDL_Event *ev) {

 if (isResize_UserEvent(ev)) {

     updateInputMaxHeight_UploadWidget_(d);

 }

     setupSheetTransition_Mobile(w, iFalse);

     destroy_Widget(w);

     return iTrue;

diff --git a/src/ui/util.c b/src/ui/util.c

index b875e260..6069e800 100644

--- a/src/ui/util.c

+++ b/src/ui/util.c

@@ -1061,6 +1061,7 @@ iWidget *removeTabPage_Widget(iWidget *tabs, size_t index) {

}

void resizeToLargestPage_Widget(iWidget *tabs) {

// puts("RESIZE TO LARGEST PAGE ...");

 iWidget *pages = findChild_Widget(tabs, "tabs.pages");

 iForEach(ObjectList, i, children_Widget(pages)) {

@@ -1216,7 +1217,7 @@ iBool valueInputHandler_(iWidget *dlg, const char *cmd) {

             postCommandf_App("valueinput.cancelled id:%s", cstr_String(id_Widget(dlg)));

             setId_Widget(dlg, ""); /* no further commands to emit */

         }

         destroy_Widget(dlg);

         return iTrue;

     }

@@ -1225,13 +1226,13 @@ iBool valueInputHandler_(iWidget *dlg, const char *cmd) {

 else if (equal_Command(cmd, "valueinput.cancel")) {

     postCommandf_App("valueinput.cancelled id:%s", cstr_String(id_Widget(dlg)));

     setId_Widget(dlg, ""); /* no further commands to emit */

     destroy_Widget(dlg);

     return iTrue;

 }

 else if (equal_Command(cmd, "valueinput.accept")) {

     acceptValueInput_(dlg);

     destroy_Widget(dlg);

     return iTrue;

 }

@@ -1345,7 +1346,9 @@ iWidget *makeValueInput_Widget(iWidget *parent, const iString *initialValue, con

                                      acceptKeyMod_ReturnKeyBehavior(prefs_App()->returnKey),

                                      "valueinput.accept" } },

                     2)));

+// finalizeSheet_Mobile(dlg);

 if (parent) {

     setFocus_Widget(as_Widget(input));

 }

@@ -1915,6 +1918,7 @@ iWidget *makePreferences_Widget(void) {

         { NULL }

     };

     iWidget *dlg = makePanels_Mobile("prefs", (iMenuItem[]){

         { "panel text:" gear_Icon " ${heading.prefs.general}", 0, 0, (const void *) generalPanelItems },

         { "panel icon:0x1f5a7 id:heading.prefs.network", 0, 0, (const void *) networkPanelItems },

         { "panel text:" person_Icon " ${sidebar.identities}", 0, 0, (const void *) identityPanelItems },

@@ -2405,7 +2409,7 @@ iWidget *makeFeedSettings_Widget(uint32_t bookmarkId) {

     arrange_Widget(dlg);

     as_Widget(input)->rect.size.x = 100 * gap_UI - headings->rect.size.x;

     addChild_Widget(get_Root()->widget, iClob(dlg));

+// finalizeSheet_Mobile(dlg);

 }

 /* Initialize. */ {

     const iBookmark *bm  = bookmarkId ? get_Bookmarks(bookmarks_App(), bookmarkId) : NULL;

@@ -2419,6 +2423,7 @@ iWidget *makeFeedSettings_Widget(uint32_t bookmarkId) {

                     iTrue);

     setCommandHandler_Widget(dlg, handleFeedSettingCommands_);

 }

 return dlg;

}

diff --git a/src/ui/widget.c b/src/ui/widget.c

index 4fd8f066..659a00cc 100644

--- a/src/ui/widget.c

+++ b/src/ui/widget.c

@@ -452,7 +452,7 @@ static void arrange_Widget_(iWidget *d) {

 else if (d->flags & centerHorizontal_WidgetFlag) {

     centerHorizontal_Widget_(d);

 }

     iRect childBounds = zero_Rect();

     if (flags_Widget(d->parent) & arrangeWidth_WidgetFlag) {

         /* Can't go narrower than what the children require, though. */

@@ -462,7 +462,7 @@ static void arrange_Widget_(iWidget *d) {

     setWidth_Widget_(d, iMaxi(width_Rect(innerRect_Widget_(d->parent)),

                               width_Rect(childBounds)));

 }

     TRACE(d, "resize to parent height");

     setHeight_Widget_(d, height_Rect(innerRect_Widget_(d->parent)));

 }

--

2.25.1

Proxy Information
Original URL
gemini://git.skyjake.fi/lagrange/work%2Fv1.7/patch/1410bbde7779efe3a20f603523547c8b8f55b6a1.patch
Status Code
Success (20)
Meta
text/plain
Capsule Response Time
118.703169 milliseconds
Gemini-to-HTML Time
14.221786 milliseconds

This content has been proxied by September (ba2dc).