summaryrefslogtreecommitdiff
path: root/src/ui/documentwidget.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/documentwidget.c')
-rw-r--r--src/ui/documentwidget.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c
index ff1c577a..7e4bdc73 100644
--- a/src/ui/documentwidget.c
+++ b/src/ui/documentwidget.c
@@ -313,6 +313,27 @@ static void updateVisible_DocumentWidget_(iDocumentWidget *d) {
313 } 313 }
314} 314}
315 315
316const iString *bookmarkTitle_DocumentWidget(const iDocumentWidget *d) {
317 iStringArray *title = iClob(new_StringArray());
318 if (!isEmpty_String(title_GmDocument(d->doc))) {
319 pushBack_StringArray(title, title_GmDocument(d->doc));
320 }
321 if (!isEmpty_String(d->titleUser)) {
322 pushBack_StringArray(title, d->titleUser);
323 }
324 else {
325 iUrl parts;
326 init_Url(&parts, d->mod.url);
327 if (!isEmpty_Range(&parts.host)) {
328 pushBackRange_StringArray(title, parts.host);
329 }
330 }
331 if (isEmpty_StringArray(title)) {
332 pushBackCStr_StringArray(title, "Blank Page");
333 }
334 return collect_String(joinCStr_StringArray(title, " \u2014 "));
335}
336
316static void updateWindowTitle_DocumentWidget_(const iDocumentWidget *d) { 337static void updateWindowTitle_DocumentWidget_(const iDocumentWidget *d) {
317 iLabelWidget *tabButton = tabPageButton_Widget(findWidget_App("doctabs"), d); 338 iLabelWidget *tabButton = tabPageButton_Widget(findWidget_App("doctabs"), d);
318 if (!tabButton) { 339 if (!tabButton) {