diff options
Diffstat (limited to 'src/ui/documentwidget.c')
-rw-r--r-- | src/ui/documentwidget.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c index c8755fd2..f8a2e330 100644 --- a/src/ui/documentwidget.c +++ b/src/ui/documentwidget.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <the_Foundation/path.h> | 15 | #include <the_Foundation/path.h> |
16 | #include <the_Foundation/ptrarray.h> | 16 | #include <the_Foundation/ptrarray.h> |
17 | #include <the_Foundation/regexp.h> | 17 | #include <the_Foundation/regexp.h> |
18 | #include <the_Foundation/stringarray.h> | ||
18 | 19 | ||
19 | #include <SDL_clipboard.h> | 20 | #include <SDL_clipboard.h> |
20 | #include <SDL_timer.h> | 21 | #include <SDL_timer.h> |
@@ -257,16 +258,24 @@ static void updateVisible_DocumentWidget_(iDocumentWidget *d) { | |||
257 | } | 258 | } |
258 | 259 | ||
259 | static void updateWindowTitle_DocumentWidget_(const iDocumentWidget *d) { | 260 | static void updateWindowTitle_DocumentWidget_(const iDocumentWidget *d) { |
260 | const char *titleSep = " \u2013 "; | 261 | iStringArray *title = iClob(new_StringArray()); |
261 | iString *title = collect_String(copy_String(title_GmDocument(d->doc))); | 262 | if (!isEmpty_String(title_GmDocument(d->doc))) { |
263 | pushBack_StringArray(title, title_GmDocument(d->doc)); | ||
264 | } | ||
262 | if (!isEmpty_String(d->titleUser)) { | 265 | if (!isEmpty_String(d->titleUser)) { |
263 | if (!isEmpty_String(title)) appendCStr_String(title, titleSep); | 266 | pushBack_StringArray(title, d->titleUser); |
264 | append_String(title, d->titleUser); | 267 | } |
268 | else { | ||
269 | iUrl parts; | ||
270 | init_Url(&parts, d->url); | ||
271 | if (!isEmpty_Range(&parts.host)) { | ||
272 | pushBackRange_StringArray(title, parts.host); | ||
273 | } | ||
265 | } | 274 | } |
266 | if (isEmpty_String(title)) { | 275 | if (isEmpty_StringArray(title)) { |
267 | setCStr_String(title, "Lagrange"); | 276 | pushBackCStr_StringArray(title, "Lagrange"); |
268 | } | 277 | } |
269 | setTitle_Window(get_Window(), title); | 278 | setTitle_Window(get_Window(), collect_String(joinCStr_StringArray(title, " \u2013 "))); |
270 | } | 279 | } |
271 | 280 | ||
272 | static void setSource_DocumentWidget_(iDocumentWidget *d, const iString *source) { | 281 | static void setSource_DocumentWidget_(iDocumentWidget *d, const iString *source) { |