From f0e555b97f6adffbd8288ca3208934547a93af42 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Wed, 9 Dec 2020 20:57:34 +0200 Subject: DocumentWidget: Clicking on certificate warning Show the Certificate Status dialog. IssueID #93 --- src/ui/documentwidget.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/ui') diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c index 7a297aa7..c9eda18f 100644 --- a/src/ui/documentwidget.c +++ b/src/ui/documentwidget.c @@ -2447,8 +2447,17 @@ static iBool processEvent_DocumentWidget_(iDocumentWidget *d, const SDL_Event *e refresh_Widget(w); } /* Clicking on the top/side banner navigates to site root. */ - if (contains_Rect(siteBannerRect_DocumentWidget_(d), pos_Click(&d->click))) { - postCommand_Widget(d, "navigate.root"); + const iRect banRect = siteBannerRect_DocumentWidget_(d); + if (contains_Rect(banRect, pos_Click(&d->click))) { + /* Clicking on a warning? */ + if (bannerType_DocumentWidget_(d) == certificateWarning_GmDocumentBanner && + pos_Click(&d->click).y - top_Rect(banRect) > + lineHeight_Text(banner_FontId) * 2) { + postCommand_App("server.showcert"); + } + else { + postCommand_Widget(d, "navigate.root"); + } } } return iTrue; -- cgit v1.2.3