diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-08-16 16:15:30 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-08-16 16:15:30 +0300 |
commit | 027d8185b10632092508bfda62467d24c9f8655b (patch) | |
tree | 03b0bf1edb9f2f284afde1679e24ac390b2f201d /src/ui/documentwidget.c | |
parent | b10087331ff28acbc368361ba14dba3a70b7dc90 (diff) |
Palette has UI colors; defined Light theme colors
Diffstat (limited to 'src/ui/documentwidget.c')
-rw-r--r-- | src/ui/documentwidget.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c index 891e7650..ae828367 100644 --- a/src/ui/documentwidget.c +++ b/src/ui/documentwidget.c | |||
@@ -329,7 +329,7 @@ const iString *bookmarkTitle_DocumentWidget(const iDocumentWidget *d) { | |||
329 | if (!isEmpty_String(d->titleUser)) { | 329 | if (!isEmpty_String(d->titleUser)) { |
330 | pushBack_StringArray(title, d->titleUser); | 330 | pushBack_StringArray(title, d->titleUser); |
331 | } | 331 | } |
332 | else { | 332 | if (isEmpty_StringArray(title)) { |
333 | iUrl parts; | 333 | iUrl parts; |
334 | init_Url(&parts, d->mod.url); | 334 | init_Url(&parts, d->mod.url); |
335 | if (!isEmpty_Range(&parts.host)) { | 335 | if (!isEmpty_Range(&parts.host)) { |
@@ -693,11 +693,11 @@ static void checkResponse_DocumentWidget_(iDocumentWidget *d) { | |||
693 | iWidget *dlg = makeValueInput_Widget( | 693 | iWidget *dlg = makeValueInput_Widget( |
694 | as_Widget(d), | 694 | as_Widget(d), |
695 | NULL, | 695 | NULL, |
696 | format_CStr(cyan_ColorEscape "%s", cstr_Rangecc(parts.host)), | 696 | format_CStr(uiHeading_ColorEscape "%s", cstr_Rangecc(parts.host)), |
697 | isEmpty_String(meta_GmRequest(d->request)) | 697 | isEmpty_String(meta_GmRequest(d->request)) |
698 | ? format_CStr("Please enter input for %s:", cstr_Rangecc(parts.path)) | 698 | ? format_CStr("Please enter input for %s:", cstr_Rangecc(parts.path)) |
699 | : cstr_String(meta_GmRequest(d->request)), | 699 | : cstr_String(meta_GmRequest(d->request)), |
700 | orange_ColorEscape "Send \u21d2", | 700 | uiTextCaution_ColorEscape "Send \u21d2", |
701 | "document.input.submit"); | 701 | "document.input.submit"); |
702 | setSensitive_InputWidget(findChild_Widget(dlg, "input"), | 702 | setSensitive_InputWidget(findChild_Widget(dlg, "input"), |
703 | statusCode == sensitiveInput_GmStatusCode); | 703 | statusCode == sensitiveInput_GmStatusCode); |
@@ -834,7 +834,7 @@ static iBool handleMediaCommand_DocumentWidget_(iDocumentWidget *d, const char * | |||
834 | } | 834 | } |
835 | else { | 835 | else { |
836 | const iGmError *err = get_GmError(code); | 836 | const iGmError *err = get_GmError(code); |
837 | makeMessage_Widget(format_CStr(orange_ColorEscape "%s", err->title), err->info); | 837 | makeMessage_Widget(format_CStr(uiTextCaution_ColorEscape "%s", err->title), err->info); |
838 | removeMediaRequest_DocumentWidget_(d, req->linkId); | 838 | removeMediaRequest_DocumentWidget_(d, req->linkId); |
839 | } | 839 | } |
840 | return iTrue; | 840 | return iTrue; |
@@ -864,6 +864,9 @@ static iBool handleCommand_DocumentWidget_(iDocumentWidget *d, const char *cmd) | |||
864 | refresh_Widget(w); | 864 | refresh_Widget(w); |
865 | updateWindowTitle_DocumentWidget_(d); | 865 | updateWindowTitle_DocumentWidget_(d); |
866 | } | 866 | } |
867 | else if (equal_Command(cmd, "theme.changed")) { | ||
868 | updateTheme_DocumentWidget_(d); | ||
869 | } | ||
867 | else if (equal_Command(cmd, "tabs.changed")) { | 870 | else if (equal_Command(cmd, "tabs.changed")) { |
868 | if (cmp_String(id_Widget(w), suffixPtr_Command(cmd, "id")) == 0) { | 871 | if (cmp_String(id_Widget(w), suffixPtr_Command(cmd, "id")) == 0) { |
869 | /* Set palette for our document. */ | 872 | /* Set palette for our document. */ |
@@ -879,18 +882,18 @@ static iBool handleCommand_DocumentWidget_(iDocumentWidget *d, const char *cmd) | |||
879 | const char *unchecked = red_ColorEscape "\u2610"; | 882 | const char *unchecked = red_ColorEscape "\u2610"; |
880 | const char *checked = green_ColorEscape "\u2611"; | 883 | const char *checked = green_ColorEscape "\u2611"; |
881 | makeMessage_Widget( | 884 | makeMessage_Widget( |
882 | cyan_ColorEscape "CERTIFICATE STATUS", | 885 | uiHeading_ColorEscape "CERTIFICATE STATUS", |
883 | format_CStr("%s%s Domain name %s%s\n" | 886 | format_CStr("%s%s Domain name %s%s\n" |
884 | "%s%s %s (%04d-%02d-%02d %02d:%02d:%02d)\n" | 887 | "%s%s %s (%04d-%02d-%02d %02d:%02d:%02d)\n" |
885 | "%s%s %s", | 888 | "%s%s %s", |
886 | d->certFlags & domainVerified_GmCertFlag ? checked : unchecked, | 889 | d->certFlags & domainVerified_GmCertFlag ? checked : unchecked, |
887 | gray75_ColorEscape, | 890 | uiText_ColorEscape, |
888 | d->certFlags & domainVerified_GmCertFlag ? "matches" : "mismatch", | 891 | d->certFlags & domainVerified_GmCertFlag ? "matches" : "mismatch", |
889 | ~d->certFlags & domainVerified_GmCertFlag | 892 | ~d->certFlags & domainVerified_GmCertFlag |
890 | ? format_CStr(" (%s)", cstr_String(d->certSubject)) | 893 | ? format_CStr(" (%s)", cstr_String(d->certSubject)) |
891 | : "", | 894 | : "", |
892 | d->certFlags & timeVerified_GmCertFlag ? checked : unchecked, | 895 | d->certFlags & timeVerified_GmCertFlag ? checked : unchecked, |
893 | gray75_ColorEscape, | 896 | uiText_ColorEscape, |
894 | d->certFlags & timeVerified_GmCertFlag ? "Not expired" : "Expired", | 897 | d->certFlags & timeVerified_GmCertFlag ? "Not expired" : "Expired", |
895 | d->certExpiry.year, | 898 | d->certExpiry.year, |
896 | d->certExpiry.month, | 899 | d->certExpiry.month, |
@@ -899,7 +902,7 @@ static iBool handleCommand_DocumentWidget_(iDocumentWidget *d, const char *cmd) | |||
899 | d->certExpiry.minute, | 902 | d->certExpiry.minute, |
900 | d->certExpiry.second, | 903 | d->certExpiry.second, |
901 | d->certFlags & trusted_GmCertFlag ? checked : unchecked, | 904 | d->certFlags & trusted_GmCertFlag ? checked : unchecked, |
902 | gray75_ColorEscape, | 905 | uiText_ColorEscape, |
903 | d->certFlags & trusted_GmCertFlag ? "Trusted on first use" | 906 | d->certFlags & trusted_GmCertFlag ? "Trusted on first use" |
904 | : "Not trusted")); | 907 | : "Not trusted")); |
905 | return iTrue; | 908 | return iTrue; |
@@ -1409,7 +1412,7 @@ static void drawRun_DrawContext_(void *context, const iGmRun *run) { | |||
1409 | if (tx + textSize.x > right_Rect(d->widgetBounds)) { | 1412 | if (tx + textSize.x > right_Rect(d->widgetBounds)) { |
1410 | tx = right_Rect(d->widgetBounds) - textSize.x; | 1413 | tx = right_Rect(d->widgetBounds) - textSize.x; |
1411 | fillRect_Paint(&d->paint, (iRect){ init_I2(tx, top_Rect(linkRect)), textSize }, | 1414 | fillRect_Paint(&d->paint, (iRect){ init_I2(tx, top_Rect(linkRect)), textSize }, |
1412 | black_ColorId); | 1415 | uiBackground_ColorId); |
1413 | msg += 4; /* skip the space and dash */ | 1416 | msg += 4; /* skip the space and dash */ |
1414 | tx += measure_Text(metaFont, " \u2014").x / 2; | 1417 | tx += measure_Text(metaFont, " \u2014").x / 2; |
1415 | } | 1418 | } |