diff options
-rw-r--r-- | src/app.c | 7 | ||||
-rw-r--r-- | src/ui/documentwidget.c | 2 | ||||
-rw-r--r-- | src/ui/lookupwidget.c | 16 | ||||
-rw-r--r-- | src/ui/widget.c | 54 | ||||
-rw-r--r-- | src/ui/widget.h | 3 | ||||
-rw-r--r-- | src/ui/window.c | 75 |
6 files changed, 90 insertions, 67 deletions
@@ -1692,7 +1692,7 @@ iBool handleCommand_App(const char *cmd) { | |||
1692 | } | 1692 | } |
1693 | setInitialScroll_DocumentWidget(doc, argfLabel_Command(cmd, "scroll")); | 1693 | setInitialScroll_DocumentWidget(doc, argfLabel_Command(cmd, "scroll")); |
1694 | setRedirectCount_DocumentWidget(doc, redirectCount); | 1694 | setRedirectCount_DocumentWidget(doc, redirectCount); |
1695 | setFlags_Widget(findWidget_App("document.progress"), hidden_WidgetFlag, iTrue); | 1695 | showCollapsed_Widget(findWidget_App("document.progress"), iFalse); |
1696 | if (prefs_App()->decodeUserVisibleURLs) { | 1696 | if (prefs_App()->decodeUserVisibleURLs) { |
1697 | urlDecodePath_String(url); | 1697 | urlDecodePath_String(url); |
1698 | } | 1698 | } |
@@ -1920,12 +1920,11 @@ iBool handleCommand_App(const char *cmd) { | |||
1920 | return iTrue; | 1920 | return iTrue; |
1921 | } | 1921 | } |
1922 | else if (equal_Command(cmd, "feeds.update.started")) { | 1922 | else if (equal_Command(cmd, "feeds.update.started")) { |
1923 | setFlags_Widget(findWidget_App("feeds.progress"), hidden_WidgetFlag, iFalse); | 1923 | showCollapsed_Widget(findWidget_App("feeds.progress"), iTrue); |
1924 | postRefresh_App(); | ||
1925 | return iFalse; | 1924 | return iFalse; |
1926 | } | 1925 | } |
1927 | else if (equal_Command(cmd, "feeds.update.finished")) { | 1926 | else if (equal_Command(cmd, "feeds.update.finished")) { |
1928 | setFlags_Widget(findWidget_App("feeds.progress"), hidden_WidgetFlag, iTrue); | 1927 | showCollapsed_Widget(findWidget_App("feeds.progress"), iFalse); |
1929 | refreshFinished_Feeds(); | 1928 | refreshFinished_Feeds(); |
1930 | postRefresh_App(); | 1929 | postRefresh_App(); |
1931 | return iFalse; | 1930 | return iFalse; |
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c index 5d3aa3ba..a7666865 100644 --- a/src/ui/documentwidget.c +++ b/src/ui/documentwidget.c | |||
@@ -836,7 +836,7 @@ static void showErrorPage_DocumentWidget_(iDocumentWidget *d, enum iGmStatusCode | |||
836 | static void updateFetchProgress_DocumentWidget_(iDocumentWidget *d) { | 836 | static void updateFetchProgress_DocumentWidget_(iDocumentWidget *d) { |
837 | iLabelWidget *prog = findWidget_App("document.progress"); | 837 | iLabelWidget *prog = findWidget_App("document.progress"); |
838 | const size_t dlSize = d->request ? bodySize_GmRequest(d->request) : 0; | 838 | const size_t dlSize = d->request ? bodySize_GmRequest(d->request) : 0; |
839 | setFlags_Widget(as_Widget(prog), hidden_WidgetFlag, dlSize < 250000); | 839 | showCollapsed_Widget(as_Widget(prog), dlSize >= 250000); |
840 | if (isVisible_Widget(prog)) { | 840 | if (isVisible_Widget(prog)) { |
841 | updateText_LabelWidget(prog, | 841 | updateText_LabelWidget(prog, |
842 | collectNewFormat_String("%s%.3f MB", | 842 | collectNewFormat_String("%s%.3f MB", |
diff --git a/src/ui/lookupwidget.c b/src/ui/lookupwidget.c index 29ae0fee..b68d4a23 100644 --- a/src/ui/lookupwidget.c +++ b/src/ui/lookupwidget.c | |||
@@ -385,11 +385,13 @@ void init_LookupWidget(iLookupWidget *d) { | |||
385 | iWidget *w = as_Widget(d); | 385 | iWidget *w = as_Widget(d); |
386 | init_Widget(w); | 386 | init_Widget(w); |
387 | setId_Widget(w, "lookup"); | 387 | setId_Widget(w, "lookup"); |
388 | setFlags_Widget(w, focusable_WidgetFlag | resizeChildren_WidgetFlag, iTrue); | 388 | setFlags_Widget(w, focusable_WidgetFlag, iTrue); |
389 | #if defined (iPlatformAppleMobile) | 389 | #if defined (iPlatformAppleMobile) |
390 | setFlags_Widget(w, unhittable_WidgetFlag, iTrue); | 390 | setFlags_Widget(w, unhittable_WidgetFlag, iTrue); |
391 | #endif | 391 | #endif |
392 | d->list = addChild_Widget(w, iClob(new_ListWidget())); | 392 | d->list = addChildFlags_Widget(w, iClob(new_ListWidget()), |
393 | resizeToParentWidth_WidgetFlag | | ||
394 | resizeToParentHeight_WidgetFlag); | ||
393 | d->cursor = iInvalidPos; | 395 | d->cursor = iInvalidPos; |
394 | d->work = new_Thread(worker_LookupWidget_); | 396 | d->work = new_Thread(worker_LookupWidget_); |
395 | setUserData_Thread(d->work, d); | 397 | setUserData_Thread(d->work, d); |
@@ -428,7 +430,7 @@ void submit_LookupWidget(iLookupWidget *d, const iString *term) { | |||
428 | signal_Condition(&d->jobAvailable); | 430 | signal_Condition(&d->jobAvailable); |
429 | } | 431 | } |
430 | else { | 432 | else { |
431 | setFlags_Widget(as_Widget(d), hidden_WidgetFlag, iTrue); | 433 | showCollapsed_Widget(as_Widget(d), iFalse); |
432 | } | 434 | } |
433 | }); | 435 | }); |
434 | } | 436 | } |
@@ -597,7 +599,7 @@ static void presentResults_LookupWidget_(iLookupWidget *d) { | |||
597 | scrollOffset_ListWidget(d->list, 0); | 599 | scrollOffset_ListWidget(d->list, 0); |
598 | updateVisible_ListWidget(d->list); | 600 | updateVisible_ListWidget(d->list); |
599 | invalidate_ListWidget(d->list); | 601 | invalidate_ListWidget(d->list); |
600 | setFlags_Widget(as_Widget(d), hidden_WidgetFlag, numItems_ListWidget(d->list) == 0); | 602 | showCollapsed_Widget(as_Widget(d), numItems_ListWidget(d->list) != 0); |
601 | } | 603 | } |
602 | 604 | ||
603 | static iLookupItem *item_LookupWidget_(iLookupWidget *d, size_t index) { | 605 | static iLookupItem *item_LookupWidget_(iLookupWidget *d, size_t index) { |
@@ -674,7 +676,7 @@ static iBool processEvent_LookupWidget_(iLookupWidget *d, const SDL_Event *ev) { | |||
674 | } | 676 | } |
675 | if (equal_Command(cmd, "input.ended") && equal_Rangecc(range_Command(cmd, "id"), "url") && | 677 | if (equal_Command(cmd, "input.ended") && equal_Rangecc(range_Command(cmd, "id"), "url") && |
676 | !isFocused_Widget(w)) { | 678 | !isFocused_Widget(w)) { |
677 | setFlags_Widget(w, hidden_WidgetFlag, iTrue); | 679 | showCollapsed_Widget(w, iFalse); |
678 | } | 680 | } |
679 | if (isCommand_Widget(w, ev, "focus.lost")) { | 681 | if (isCommand_Widget(w, ev, "focus.lost")) { |
680 | setCursor_LookupWidget_(d, iInvalidPos); | 682 | setCursor_LookupWidget_(d, iInvalidPos); |
@@ -689,7 +691,7 @@ static iBool processEvent_LookupWidget_(iLookupWidget *d, const SDL_Event *ev) { | |||
689 | const iLookupItem *item = constItem_ListWidget(d->list, arg_Command(cmd)); | 691 | const iLookupItem *item = constItem_ListWidget(d->list, arg_Command(cmd)); |
690 | if (item && !isEmpty_String(&item->command)) { | 692 | if (item && !isEmpty_String(&item->command)) { |
691 | setText_InputWidget(url, url_DocumentWidget(document_App())); | 693 | setText_InputWidget(url, url_DocumentWidget(document_App())); |
692 | setFlags_Widget(w, hidden_WidgetFlag, iTrue); | 694 | showCollapsed_Widget(w, iFalse); |
693 | setCursor_LookupWidget_(d, iInvalidPos); | 695 | setCursor_LookupWidget_(d, iInvalidPos); |
694 | postCommandString_App(&item->command); | 696 | postCommandString_App(&item->command); |
695 | postCommand_App("focus.set id:"); /* unfocus */ | 697 | postCommand_App("focus.set id:"); /* unfocus */ |
@@ -703,7 +705,7 @@ static iBool processEvent_LookupWidget_(iLookupWidget *d, const SDL_Event *ev) { | |||
703 | iWidget *url = findWidget_App("url"); | 705 | iWidget *url = findWidget_App("url"); |
704 | switch (key) { | 706 | switch (key) { |
705 | case SDLK_ESCAPE: | 707 | case SDLK_ESCAPE: |
706 | setFlags_Widget(w, hidden_WidgetFlag, iTrue); | 708 | showCollapsed_Widget(w, iFalse); |
707 | setCursor_LookupWidget_(d, iInvalidPos); | 709 | setCursor_LookupWidget_(d, iInvalidPos); |
708 | setFocus_Widget(url); | 710 | setFocus_Widget(url); |
709 | return iTrue; | 711 | return iTrue; |
diff --git a/src/ui/widget.c b/src/ui/widget.c index 3c9edccb..19546235 100644 --- a/src/ui/widget.c +++ b/src/ui/widget.c | |||
@@ -209,6 +209,16 @@ void setPadding_Widget(iWidget *d, int left, int top, int right, int bottom) { | |||
209 | d->padding[3] = bottom; | 209 | d->padding[3] = bottom; |
210 | } | 210 | } |
211 | 211 | ||
212 | void showCollapsed_Widget(iWidget *d, iBool show) { | ||
213 | const iBool isVisible = !(d->flags & hidden_WidgetFlag); | ||
214 | if ((isVisible && !show) || (!isVisible && show)) { | ||
215 | setFlags_Widget(d, hidden_WidgetFlag, !show); | ||
216 | /* The entire UI may be affected, if parents are resized due to the (un)collapsing. */ | ||
217 | arrange_Widget(get_Window()->root); | ||
218 | postRefresh_App(); | ||
219 | } | ||
220 | } | ||
221 | |||
212 | void setVisualOffset_Widget(iWidget *d, int value, uint32_t span, int animFlags) { | 222 | void setVisualOffset_Widget(iWidget *d, int value, uint32_t span, int animFlags) { |
213 | setFlags_Widget(d, visualOffset_WidgetFlag, iTrue); | 223 | setFlags_Widget(d, visualOffset_WidgetFlag, iTrue); |
214 | if (span == 0) { | 224 | if (span == 0) { |
@@ -349,36 +359,37 @@ void arrange_Widget(iWidget *d) { | |||
349 | if (!d->children) { | 359 | if (!d->children) { |
350 | return; | 360 | return; |
351 | } | 361 | } |
352 | /* Resize children to fill the parent widget. */ | ||
353 | const size_t childCount = numArrangedChildren_Widget_(d); | 362 | const size_t childCount = numArrangedChildren_Widget_(d); |
363 | /* There may still be unarranged children that need arranging internally. */ | ||
354 | if (childCount == 0) { | 364 | if (childCount == 0) { |
365 | iForEach(ObjectList, i, d->children) { | ||
366 | iWidget *child = as_Widget(i.object); | ||
367 | if (isArranged_Widget_(child)) { | ||
368 | arrange_Widget(child); | ||
369 | } | ||
370 | } | ||
355 | return; | 371 | return; |
356 | } | 372 | } |
373 | /* Resize children to fill the parent widget. */ | ||
357 | if (d->flags & resizeChildren_WidgetFlag) { | 374 | if (d->flags & resizeChildren_WidgetFlag) { |
358 | const iInt2 dirs = init_I2((d->flags & resizeWidthOfChildren_WidgetFlag) != 0, | 375 | const iInt2 dirs = init_I2((d->flags & resizeWidthOfChildren_WidgetFlag) != 0, |
359 | (d->flags & resizeHeightOfChildren_WidgetFlag) != 0); | 376 | (d->flags & resizeHeightOfChildren_WidgetFlag) != 0); |
360 | /* Collapse hidden children. */ | 377 | /* Collapse hidden children. */ |
361 | iBool uncollapsed = iFalse; | 378 | iBool collapseChanged = iFalse; |
362 | iForEach(ObjectList, c, d->children) { | 379 | iForEach(ObjectList, c, d->children) { |
363 | iWidget *child = as_Widget(c.object); | 380 | iWidget *child = as_Widget(c.object); |
364 | if (isCollapsed_Widget_(child)) { | 381 | if (!isCollapsed_Widget_(child) && child->flags & wasCollapsed_WidgetFlag) { |
365 | if (d->flags & arrangeHorizontal_WidgetFlag) { | ||
366 | setWidth_Widget_(child, 0); | ||
367 | } | ||
368 | if (d->flags & arrangeVertical_WidgetFlag) { | ||
369 | setHeight_Widget_(child, 0); | ||
370 | } | ||
371 | } | ||
372 | else if (child->flags & wasCollapsed_WidgetFlag) { | ||
373 | setFlags_Widget(child, wasCollapsed_WidgetFlag, iFalse); | 382 | setFlags_Widget(child, wasCollapsed_WidgetFlag, iFalse); |
374 | /* Undo collapse and determine the normal size again. */ | 383 | /* Undo collapse and determine the normal size again. */ |
375 | if (child->flags & arrangeSize_WidgetFlag) { | 384 | arrange_Widget(d); |
376 | arrange_Widget(d); | 385 | collapseChanged = iTrue; |
377 | uncollapsed = iTrue; | 386 | } |
378 | } | 387 | else if (isCollapsed_Widget_(child) && ~child->flags & wasCollapsed_WidgetFlag) { |
388 | setFlags_Widget(child, wasCollapsed_WidgetFlag, iTrue); | ||
389 | collapseChanged = iTrue; | ||
379 | } | 390 | } |
380 | } | 391 | } |
381 | if (uncollapsed) { | 392 | if (collapseChanged) { |
382 | arrange_Widget(d); /* Redo with the new child sizes. */ | 393 | arrange_Widget(d); /* Redo with the new child sizes. */ |
383 | return; | 394 | return; |
384 | } | 395 | } |
@@ -436,7 +447,7 @@ void arrange_Widget(iWidget *d) { | |||
436 | } | 447 | } |
437 | iForEach(ObjectList, i, d->children) { | 448 | iForEach(ObjectList, i, d->children) { |
438 | iWidget *child = as_Widget(i.object); | 449 | iWidget *child = as_Widget(i.object); |
439 | if (isArranged_Widget_(child)) { | 450 | if (isArranged_Widget_(child) && ~child->flags & parentCannotResize_WidgetFlag) { |
440 | if (dirs.x) setWidth_Widget_(child, child->flags & unpadded_WidgetFlag ? unpaddedChildSize.x : childSize.x); | 451 | if (dirs.x) setWidth_Widget_(child, child->flags & unpadded_WidgetFlag ? unpaddedChildSize.x : childSize.x); |
441 | if (dirs.y) setHeight_Widget_(child, child->flags & unpadded_WidgetFlag ? unpaddedChildSize.y : childSize.y); | 452 | if (dirs.y) setHeight_Widget_(child, child->flags & unpadded_WidgetFlag ? unpaddedChildSize.y : childSize.y); |
442 | } | 453 | } |
@@ -446,8 +457,9 @@ void arrange_Widget(iWidget *d) { | |||
446 | if (d->flags & resizeChildrenToWidestChild_WidgetFlag) { | 457 | if (d->flags & resizeChildrenToWidestChild_WidgetFlag) { |
447 | const int widest = widestChild_Widget_(d); | 458 | const int widest = widestChild_Widget_(d); |
448 | iForEach(ObjectList, i, d->children) { | 459 | iForEach(ObjectList, i, d->children) { |
449 | if (isArranged_Widget_(i.object)) { | 460 | iWidget *child = as_Widget(i.object); |
450 | setWidth_Widget_(as_Widget(i.object), widest); | 461 | if (isArranged_Widget_(child) && ~child->flags & parentCannotResize_WidgetFlag) { |
462 | setWidth_Widget_(child, widest); | ||
451 | } | 463 | } |
452 | } | 464 | } |
453 | } | 465 | } |
@@ -505,6 +517,10 @@ void arrange_Widget(iWidget *d) { | |||
505 | arrange_Widget(child); | 517 | arrange_Widget(child); |
506 | } | 518 | } |
507 | } | 519 | } |
520 | if (d->flags & moveToParentRightEdge_WidgetFlag) { | ||
521 | /* TODO: Fix this: not DRY. See beginning of method. */ | ||
522 | d->rect.pos.x = width_Rect(innerRect_Widget_(d->parent)) - width_Rect(d->rect); | ||
523 | } | ||
508 | } | 524 | } |
509 | if (d->flags & arrangeHeight_WidgetFlag) { | 525 | if (d->flags & arrangeHeight_WidgetFlag) { |
510 | setHeight_Widget_(d, bounds.size.y); | 526 | setHeight_Widget_(d, bounds.size.y); |
diff --git a/src/ui/widget.h b/src/ui/widget.h index a00bb3b7..8dc51a1f 100644 --- a/src/ui/widget.h +++ b/src/ui/widget.h | |||
@@ -216,7 +216,8 @@ void setPos_Widget (iWidget *, iInt2 pos); | |||
216 | void setSize_Widget (iWidget *, iInt2 size); | 216 | void setSize_Widget (iWidget *, iInt2 size); |
217 | void setPadding_Widget (iWidget *, int left, int top, int right, int bottom); | 217 | void setPadding_Widget (iWidget *, int left, int top, int right, int bottom); |
218 | iLocalDef void setPadding1_Widget (iWidget *d, int padding) { setPadding_Widget(d, padding, padding, padding, padding); } | 218 | iLocalDef void setPadding1_Widget (iWidget *d, int padding) { setPadding_Widget(d, padding, padding, padding, padding); } |
219 | void setVisualOffset_Widget (iWidget *d, int value, uint32_t span, int animFlags); | 219 | void setVisualOffset_Widget (iWidget *, int value, uint32_t span, int animFlags); |
220 | void showCollapsed_Widget (iWidget *, iBool show); /* takes care of rearranging, refresh */ | ||
220 | void setBackgroundColor_Widget (iWidget *, int bgColor); | 221 | void setBackgroundColor_Widget (iWidget *, int bgColor); |
221 | void setFrameColor_Widget (iWidget *, int frameColor); | 222 | void setFrameColor_Widget (iWidget *, int frameColor); |
222 | void setCommandHandler_Widget (iWidget *, iBool (*handler)(iWidget *, const char *)); | 223 | void setCommandHandler_Widget (iWidget *, iBool (*handler)(iWidget *, const char *)); |
diff --git a/src/ui/window.c b/src/ui/window.c index edbbf0e9..554dc592 100644 --- a/src/ui/window.c +++ b/src/ui/window.c | |||
@@ -519,8 +519,9 @@ static iBool willPerformSearchQuery_(const iString *userInput) { | |||
519 | 519 | ||
520 | static void showSearchQueryIndicator_(iBool show) { | 520 | static void showSearchQueryIndicator_(iBool show) { |
521 | iWidget *indicator = findWidget_App("input.indicator.search"); | 521 | iWidget *indicator = findWidget_App("input.indicator.search"); |
522 | setFlags_Widget(indicator, hidden_WidgetFlag, !show); | 522 | showCollapsed_Widget(indicator, show); |
523 | iInputWidget *url = (iInputWidget *) parent_Widget(indicator); | 523 | iAssert(isInstance_Object(parent_Widget(parent_Widget(indicator)), &Class_InputWidget)); |
524 | iInputWidget *url = (iInputWidget *) parent_Widget(parent_Widget(indicator)); | ||
524 | setContentPadding_InputWidget(url, -1, contentPadding_InputWidget(url).left + | 525 | setContentPadding_InputWidget(url, -1, contentPadding_InputWidget(url).left + |
525 | (show ? width_Widget(indicator) : 0)); | 526 | (show ? width_Widget(indicator) : 0)); |
526 | } | 527 | } |
@@ -857,17 +858,19 @@ static void updateMetrics_Window_(iWindow *d) { | |||
857 | iWidget *navBar = findChild_Widget(d->root, "navbar"); | 858 | iWidget *navBar = findChild_Widget(d->root, "navbar"); |
858 | iWidget *lock = findChild_Widget(navBar, "navbar.lock"); | 859 | iWidget *lock = findChild_Widget(navBar, "navbar.lock"); |
859 | iWidget *url = findChild_Widget(d->root, "url"); | 860 | iWidget *url = findChild_Widget(d->root, "url"); |
860 | iWidget *fprog = findChild_Widget(navBar, "feeds.progress"); | 861 | // iWidget *fprog = findChild_Widget(navBar, "feeds.progress"); |
861 | iWidget *docProg = findChild_Widget(navBar, "document.progress"); | 862 | // iWidget *docProg = findChild_Widget(navBar, "document.progress"); |
862 | iWidget *indSearch = findChild_Widget(navBar, "input.indicator.search"); | 863 | // iWidget *indSearch = findChild_Widget(navBar, "input.indicator.search"); |
864 | iWidget *rightEmbed = findChild_Widget(navBar, "url.rightembed"); | ||
863 | setPadding_Widget(as_Widget(url), 0, gap_UI, 0, gap_UI); | 865 | setPadding_Widget(as_Widget(url), 0, gap_UI, 0, gap_UI); |
864 | navBar->rect.size.y = 0; /* recalculate height based on children (FIXME: shouldn't be needed) */ | 866 | navBar->rect.size.y = 0; /* recalculate height based on children (FIXME: shouldn't be needed) */ |
865 | updateSize_LabelWidget((iLabelWidget *) lock); | 867 | updateSize_LabelWidget((iLabelWidget *) lock); |
866 | setContentPadding_InputWidget((iInputWidget *) url, width_Widget(lock) * 0.75, | 868 | setContentPadding_InputWidget((iInputWidget *) url, width_Widget(lock) * 0.75, |
867 | width_Widget(lock) * 0.75); | 869 | width_Widget(lock) * 0.75); |
868 | fprog->rect.pos.y = gap_UI; | 870 | rightEmbed->rect.pos.y = gap_UI; |
869 | docProg->rect.pos.y = gap_UI; | 871 | // fprog->rect.pos.y = gap_UI; |
870 | indSearch->rect.pos.y = gap_UI; | 872 | // docProg->rect.pos.y = gap_UI; |
873 | // indSearch->rect.pos.y = gap_UI; | ||
871 | updatePadding_Window_(d); | 874 | updatePadding_Window_(d); |
872 | arrange_Widget(d->root); | 875 | arrange_Widget(d->root); |
873 | postRefresh_App(); | 876 | postRefresh_App(); |
@@ -968,52 +971,54 @@ static void setupUserInterface_Window(iWindow *d) { | |||
968 | noBackground_WidgetFlag | frameless_WidgetFlag | unpadded_WidgetFlag | | 971 | noBackground_WidgetFlag | frameless_WidgetFlag | unpadded_WidgetFlag | |
969 | (deviceType_App() == desktop_AppDeviceType ? tight_WidgetFlag : 0); | 972 | (deviceType_App() == desktop_AppDeviceType ? tight_WidgetFlag : 0); |
970 | /* Page information/certificate warning. */ { | 973 | /* Page information/certificate warning. */ { |
971 | iLabelWidget *lock = | 974 | iLabelWidget *lock = addChildFlags_Widget( |
972 | addChildFlags_Widget(as_Widget(url), | 975 | as_Widget(url), |
973 | iClob(newIcon_LabelWidget("\U0001f513", SDLK_i, KMOD_PRIMARY, "document.info")), | 976 | iClob(newIcon_LabelWidget("\U0001f513", SDLK_i, KMOD_PRIMARY, "document.info")), |
974 | embedFlags | moveToParentLeftEdge_WidgetFlag); | 977 | embedFlags | moveToParentLeftEdge_WidgetFlag); |
975 | setId_Widget(as_Widget(lock), "navbar.lock"); | 978 | setId_Widget(as_Widget(lock), "navbar.lock"); |
976 | setFont_LabelWidget(lock, defaultSymbols_FontId); | 979 | setFont_LabelWidget(lock, defaultSymbols_FontId); |
977 | updateTextCStr_LabelWidget(lock, "\U0001f512"); | 980 | updateTextCStr_LabelWidget(lock, "\U0001f512"); |
978 | } | 981 | } |
982 | iWidget *rightEmbed = new_Widget(); | ||
983 | setId_Widget(rightEmbed, "url.rightembed"); | ||
984 | addChildFlags_Widget(as_Widget(url), | ||
985 | iClob(rightEmbed), | ||
986 | arrangeHorizontal_WidgetFlag | arrangeSize_WidgetFlag | | ||
987 | resizeHeightOfChildren_WidgetFlag | | ||
988 | moveToParentRightEdge_WidgetFlag); | ||
989 | /* Feeds refresh indicator is inside the input field. */ { | ||
990 | iLabelWidget *queryInd = | ||
991 | new_LabelWidget(uiTextAction_ColorEscape "\u21d2 Search Query", NULL); | ||
992 | setId_Widget(as_Widget(queryInd), "input.indicator.search"); | ||
993 | setBackgroundColor_Widget(as_Widget(queryInd), uiBackground_ColorId); | ||
994 | setFrameColor_Widget(as_Widget(queryInd), uiTextAction_ColorId); | ||
995 | setAlignVisually_LabelWidget(queryInd, iTrue); | ||
996 | addChildFlags_Widget(rightEmbed, | ||
997 | iClob(queryInd), | ||
998 | collapse_WidgetFlag | hidden_WidgetFlag); | ||
999 | } | ||
979 | /* Feeds refresh indicator is inside the input field. */ { | 1000 | /* Feeds refresh indicator is inside the input field. */ { |
980 | iLabelWidget *fprog = new_LabelWidget(uiTextCaution_ColorEscape | 1001 | iLabelWidget *fprog = new_LabelWidget(uiTextCaution_ColorEscape |
981 | "\u2605 Refreshing Feeds...", NULL); | 1002 | "\u2605 Updating Feeds", NULL); |
982 | setId_Widget(as_Widget(fprog), "feeds.progress"); | 1003 | setId_Widget(as_Widget(fprog), "feeds.progress"); |
983 | setBackgroundColor_Widget(as_Widget(fprog), uiBackground_ColorId); | 1004 | setBackgroundColor_Widget(as_Widget(fprog), uiBackground_ColorId); |
984 | setAlignVisually_LabelWidget(fprog, iTrue); | 1005 | setAlignVisually_LabelWidget(fprog, iTrue); |
985 | // shrink_Rect(&as_Widget(fprog)->rect, init_I2(0, gap_UI)); | 1006 | addChildFlags_Widget(rightEmbed, |
986 | addChildFlags_Widget(as_Widget(url), | ||
987 | iClob(fprog), | 1007 | iClob(fprog), |
988 | moveToParentRightEdge_WidgetFlag | hidden_WidgetFlag); | 1008 | collapse_WidgetFlag | hidden_WidgetFlag); |
989 | } | 1009 | } |
990 | /* Download progress indicator is also inside the input field, but hidden normally. | 1010 | /* Download progress indicator is also inside the input field, but hidden normally. */ { |
991 | TODO: It shouldn't overlap the feeds indicator... */ { | ||
992 | iLabelWidget *progress = new_LabelWidget(uiTextCaution_ColorEscape "00.000 MB", NULL); | 1011 | iLabelWidget *progress = new_LabelWidget(uiTextCaution_ColorEscape "00.000 MB", NULL); |
993 | setId_Widget(as_Widget(progress), "document.progress"); | 1012 | setId_Widget(as_Widget(progress), "document.progress"); |
994 | setBackgroundColor_Widget(as_Widget(progress), uiBackground_ColorId); | 1013 | setBackgroundColor_Widget(as_Widget(progress), uiBackground_ColorId); |
995 | setAlignVisually_LabelWidget(progress, iTrue); | 1014 | setAlignVisually_LabelWidget(progress, iTrue); |
996 | // shrink_Rect(&as_Widget(progress)->rect, init_I2(0, gap_UI)); | 1015 | addChildFlags_Widget( |
997 | addChildFlags_Widget(as_Widget(url), | 1016 | rightEmbed, iClob(progress), collapse_WidgetFlag); |
998 | iClob(progress), | ||
999 | moveToParentRightEdge_WidgetFlag); | ||
1000 | } | ||
1001 | /* Feeds refresh indicator is inside the input field. */ { | ||
1002 | iLabelWidget *queryInd = | ||
1003 | new_LabelWidget(uiTextAction_ColorEscape "\u21d2 Search Query", NULL); | ||
1004 | setId_Widget(as_Widget(queryInd), "input.indicator.search"); | ||
1005 | setBackgroundColor_Widget(as_Widget(queryInd), uiBackground_ColorId); | ||
1006 | setFrameColor_Widget(as_Widget(queryInd), uiTextAction_ColorId); | ||
1007 | setAlignVisually_LabelWidget(queryInd, iTrue); | ||
1008 | // shrink_Rect(&as_Widget(queryInd)->rect, init_I2(0, gap_UI)); | ||
1009 | addChildFlags_Widget(as_Widget(url), | ||
1010 | iClob(queryInd), | ||
1011 | moveToParentRightEdge_WidgetFlag | hidden_WidgetFlag); | ||
1012 | } | 1017 | } |
1013 | /* Reload button. */ | 1018 | /* Reload button. */ |
1014 | iLabelWidget *reload = newIcon_LabelWidget(reloadCStr_, 0, 0, "navigate.reload"); | 1019 | iLabelWidget *reload = newIcon_LabelWidget(reloadCStr_, 0, 0, "navigate.reload"); |
1015 | setId_Widget(as_Widget(reload), "reload"); | 1020 | setId_Widget(as_Widget(reload), "reload"); |
1016 | addChildFlags_Widget(as_Widget(url), iClob(reload), embedFlags | moveToParentRightEdge_WidgetFlag); | 1021 | addChildFlags_Widget(rightEmbed, iClob(reload), embedFlags); |
1017 | updateSize_LabelWidget(reload); | 1022 | updateSize_LabelWidget(reload); |
1018 | } | 1023 | } |
1019 | addChildFlags_Widget(navBar, iClob(new_Widget()), expand_WidgetFlag); | 1024 | addChildFlags_Widget(navBar, iClob(new_Widget()), expand_WidgetFlag); |