diff options
Diffstat (limited to 'src/gmdocument.c')
-rw-r--r-- | src/gmdocument.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/gmdocument.c b/src/gmdocument.c index 3298fecc..ff088ef7 100644 --- a/src/gmdocument.c +++ b/src/gmdocument.c | |||
@@ -720,6 +720,13 @@ static void setDerivedThemeColors_(enum iGmDocumentTheme theme) { | |||
720 | } | 720 | } |
721 | } | 721 | } |
722 | 722 | ||
723 | static void updateIconBasedOnUrl_GmDocument_(iGmDocument *d) { | ||
724 | const iChar userIcon = siteIcon_Bookmarks(bookmarks_App(), &d->url); | ||
725 | if (userIcon) { | ||
726 | d->siteIcon = userIcon; | ||
727 | } | ||
728 | } | ||
729 | |||
723 | void setThemeSeed_GmDocument(iGmDocument *d, const iBlock *seed) { | 730 | void setThemeSeed_GmDocument(iGmDocument *d, const iBlock *seed) { |
724 | const iPrefs * prefs = prefs_App(); | 731 | const iPrefs * prefs = prefs_App(); |
725 | enum iGmDocumentTheme theme = | 732 | enum iGmDocumentTheme theme = |
@@ -1092,10 +1099,7 @@ void setThemeSeed_GmDocument(iGmDocument *d, const iBlock *seed) { | |||
1092 | if (equal_CStr(cstr_Block(seed), "gemini.circumlunar.space")) { | 1099 | if (equal_CStr(cstr_Block(seed), "gemini.circumlunar.space")) { |
1093 | d->siteIcon = 0x264a; /* gemini symbol */ | 1100 | d->siteIcon = 0x264a; /* gemini symbol */ |
1094 | } | 1101 | } |
1095 | const iChar userIcon = siteIcon_Bookmarks(bookmarks_App(), urlHost_String(&d->url)); | 1102 | updateIconBasedOnUrl_GmDocument_(d); |
1096 | if (userIcon) { | ||
1097 | d->siteIcon = userIcon; | ||
1098 | } | ||
1099 | } | 1103 | } |
1100 | #if 0 | 1104 | #if 0 |
1101 | for (int i = tmFirst_ColorId; i < max_ColorId; ++i) { | 1105 | for (int i = tmFirst_ColorId; i < max_ColorId; ++i) { |
@@ -1197,6 +1201,7 @@ void setUrl_GmDocument(iGmDocument *d, const iString *url) { | |||
1197 | iUrl parts; | 1201 | iUrl parts; |
1198 | init_Url(&parts, url); | 1202 | init_Url(&parts, url); |
1199 | setRange_String(&d->localHost, parts.host); | 1203 | setRange_String(&d->localHost, parts.host); |
1204 | updateIconBasedOnUrl_GmDocument_(d); | ||
1200 | } | 1205 | } |
1201 | 1206 | ||
1202 | void setSource_GmDocument(iGmDocument *d, const iString *source, int width) { | 1207 | void setSource_GmDocument(iGmDocument *d, const iString *source, int width) { |