summaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/documentwidget.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c
index 91b33464..ac37bb01 100644
--- a/src/ui/documentwidget.c
+++ b/src/ui/documentwidget.c
@@ -573,7 +573,9 @@ static void updateDocument_DocumentWidget_(iDocumentWidget *d, const iGmResponse
573 if (category_GmStatusCode(statusCode) != categoryInput_GmStatusCode) { 573 if (category_GmStatusCode(statusCode) != categoryInput_GmStatusCode) {
574 iString str; 574 iString str;
575 invalidate_DocumentWidget_(d); 575 invalidate_DocumentWidget_(d);
576 updateTheme_DocumentWidget_(d); 576 if (document_App() == d) {
577 updateTheme_DocumentWidget_(d);
578 }
577 clear_String(&d->sourceMime); 579 clear_String(&d->sourceMime);
578// set_Block(&d->sourceContent, &response->body); 580// set_Block(&d->sourceContent, &response->body);
579 initBlock_String(&str, &response->body); 581 initBlock_String(&str, &response->body);
@@ -1550,20 +1552,21 @@ static iBool processEvent_DocumentWidget_(iDocumentWidget *d, const SDL_Event *e
1550 iArray items; 1552 iArray items;
1551 init_Array(&items, sizeof(iMenuItem)); 1553 init_Array(&items, sizeof(iMenuItem));
1552 if (d->contextLink) { 1554 if (d->contextLink) {
1555 const iString *linkUrl = linkUrl_GmDocument(d->doc, d->contextLink->linkId);
1553 pushBackN_Array( 1556 pushBackN_Array(
1554 &items, 1557 &items,
1555 (iMenuItem[]){ { "Open Link in New Tab", 1558 (iMenuItem[]){
1559 { "Open Link in New Tab",
1556 0, 1560 0,
1557 0, 1561 0,
1558 format_CStr("!open newtab:1 url:%s", 1562 format_CStr("!open newtab:1 url:%s", cstr_String(linkUrl)) },
1559 cstr_String(linkUrl_GmDocument( 1563 { "Open Link in Background Tab",
1560 d->doc, d->contextLink->linkId))) },
1561 { "---", 0, 0, NULL },
1562 { "Copy Link",
1563 0, 1564 0,
1564 0, 1565 0,
1565 "document.copylink" }}, 1566 format_CStr("!open newtab:2 url:%s", cstr_String(linkUrl)) },
1566 3); 1567 { "---", 0, 0, NULL },
1568 { "Copy Link", 0, 0, "document.copylink" } },
1569 4);
1567 } 1570 }
1568 else { 1571 else {
1569 if (!isEmpty_Range(&d->selectMark)) { 1572 if (!isEmpty_Range(&d->selectMark)) {