diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-12-30 08:12:13 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-12-30 08:12:13 +0200 |
commit | 0e5047069b5782b39620af8a5fd31d57ba9809e5 (patch) | |
tree | 8f3e01ca20213721154c997b9442a96303918403 /src/ui | |
parent | c5f9a431f3b42c3a34578f5406b5e39a9eec9cd0 (diff) |
DocumentWidget: Update banner while loading
The banner would sometimes appear only after the page had finished loading, because the site icon got lost when the GmDocument was switched.
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/banner.c | 1 | ||||
-rw-r--r-- | src/ui/documentwidget.c | 9 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/ui/banner.c b/src/ui/banner.c index 2b0b852e..e8c2e6d2 100644 --- a/src/ui/banner.c +++ b/src/ui/banner.c | |||
@@ -76,7 +76,6 @@ static void updateHeight_Banner_(iBanner *d) { | |||
76 | } | 76 | } |
77 | const size_t numItems = size_Array(&d->items); | 77 | const size_t numItems = size_Array(&d->items); |
78 | if (numItems) { | 78 | if (numItems) { |
79 | // const int innerPad = gap_UI; | ||
80 | iConstForEach(Array, i, &d->items) { | 79 | iConstForEach(Array, i, &d->items) { |
81 | const iBannerItem *item = i.value; | 80 | const iBannerItem *item = i.value; |
82 | d->rect.size.y += item->height; | 81 | d->rect.size.y += item->height; |
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c index 65de157b..cbd32066 100644 --- a/src/ui/documentwidget.c +++ b/src/ui/documentwidget.c | |||
@@ -2129,12 +2129,17 @@ static void showOrHidePinningIndicator_DocumentWidget_(iDocumentWidget *d) { | |||
2129 | isPinned_DocumentWidget_(d)); | 2129 | isPinned_DocumentWidget_(d)); |
2130 | } | 2130 | } |
2131 | 2131 | ||
2132 | static void updateBanner_DocumentWidget_(iDocumentWidget *d) { | ||
2133 | setSite_Banner(d->banner, siteText_DocumentWidget_(d), siteIcon_GmDocument(d->view.doc)); | ||
2134 | } | ||
2135 | |||
2132 | static void documentWasChanged_DocumentWidget_(iDocumentWidget *d) { | 2136 | static void documentWasChanged_DocumentWidget_(iDocumentWidget *d) { |
2133 | iChangeFlags(d->flags, selecting_DocumentWidgetFlag, iFalse); | 2137 | iChangeFlags(d->flags, selecting_DocumentWidgetFlag, iFalse); |
2134 | setFlags_Widget(as_Widget(d), touchDrag_WidgetFlag, iFalse); | 2138 | setFlags_Widget(as_Widget(d), touchDrag_WidgetFlag, iFalse); |
2135 | updateVisitedLinks_GmDocument(d->view.doc); | 2139 | updateVisitedLinks_GmDocument(d->view.doc); |
2136 | documentRunsInvalidated_DocumentWidget_(d); | 2140 | documentRunsInvalidated_DocumentWidget_(d); |
2137 | updateWindowTitle_DocumentWidget_(d); | 2141 | updateWindowTitle_DocumentWidget_(d); |
2142 | updateBanner_DocumentWidget_(d); | ||
2138 | updateVisible_DocumentView_(&d->view); | 2143 | updateVisible_DocumentView_(&d->view); |
2139 | d->view.drawBufs->flags |= updateSideBuf_DrawBufsFlag; | 2144 | d->view.drawBufs->flags |= updateSideBuf_DrawBufsFlag; |
2140 | invalidate_DocumentWidget_(d); | 2145 | invalidate_DocumentWidget_(d); |
@@ -2161,10 +2166,6 @@ static void replaceDocument_DocumentWidget_(iDocumentWidget *d, iGmDocument *new | |||
2161 | documentWasChanged_DocumentWidget_(d); | 2166 | documentWasChanged_DocumentWidget_(d); |
2162 | } | 2167 | } |
2163 | 2168 | ||
2164 | static void updateBanner_DocumentWidget_(iDocumentWidget *d) { | ||
2165 | setSite_Banner(d->banner, siteText_DocumentWidget_(d), siteIcon_GmDocument(d->view.doc)); | ||
2166 | } | ||
2167 | |||
2168 | static void updateTheme_DocumentWidget_(iDocumentWidget *d) { | 2169 | static void updateTheme_DocumentWidget_(iDocumentWidget *d) { |
2169 | if (document_App() != d || category_GmStatusCode(d->sourceStatus) == categoryInput_GmStatusCode) { | 2170 | if (document_App() != d || category_GmStatusCode(d->sourceStatus) == categoryInput_GmStatusCode) { |
2170 | return; | 2171 | return; |