mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-13 06:19:21 +03:00
Internal content: Restyle certificate viewer page.
This commit is contained in:
parent
14286b381b
commit
0e6ba162b2
@ -31,6 +31,8 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
|
#include "netsurf/plot_style.h"
|
||||||
|
|
||||||
#include "utils/log.h"
|
#include "utils/log.h"
|
||||||
#include "testament.h"
|
#include "testament.h"
|
||||||
#include "utils/corestrings.h"
|
#include "utils/corestrings.h"
|
||||||
@ -44,6 +46,8 @@
|
|||||||
#include "content/fetchers/about.h"
|
#include "content/fetchers/about.h"
|
||||||
#include "image/image_cache.h"
|
#include "image/image_cache.h"
|
||||||
|
|
||||||
|
#include "desktop/system_colour.h"
|
||||||
|
|
||||||
struct fetch_about_context;
|
struct fetch_about_context;
|
||||||
|
|
||||||
typedef bool (*fetch_about_handler)(struct fetch_about_context *);
|
typedef bool (*fetch_about_handler)(struct fetch_about_context *);
|
||||||
@ -577,6 +581,28 @@ static bool fetch_about_certificate_handler(struct fetch_about_context *ctx)
|
|||||||
nserror res;
|
nserror res;
|
||||||
struct cert_chain *chain = NULL;
|
struct cert_chain *chain = NULL;
|
||||||
|
|
||||||
|
colour bg;
|
||||||
|
colour fg;
|
||||||
|
colour border;
|
||||||
|
colour outside;
|
||||||
|
|
||||||
|
res = ns_system_colour_char("Window", &bg);
|
||||||
|
if (res != NSERROR_OK) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
res = ns_system_colour_char("WindowText", &fg);
|
||||||
|
if (res != NSERROR_OK) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
outside = mix_colour(fg, bg, 0x0c);
|
||||||
|
border = mix_colour(fg, bg, 0x40);
|
||||||
|
|
||||||
|
bg = colour_rb_swap(bg);
|
||||||
|
fg = colour_rb_swap(fg);
|
||||||
|
border = colour_rb_swap(border);
|
||||||
|
outside = colour_rb_swap(outside);
|
||||||
|
|
||||||
/* content is going to return ok */
|
/* content is going to return ok */
|
||||||
fetch_set_http_code(ctx->fetchh, code);
|
fetch_set_http_code(ctx->fetchh, code);
|
||||||
@ -591,13 +617,23 @@ static bool fetch_about_certificate_handler(struct fetch_about_context *ctx)
|
|||||||
"<title>NetSurf Browser Certificate Viewer</title>\n"
|
"<title>NetSurf Browser Certificate Viewer</title>\n"
|
||||||
"<link rel=\"stylesheet\" type=\"text/css\" "
|
"<link rel=\"stylesheet\" type=\"text/css\" "
|
||||||
"href=\"resource:internal.css\">\n"
|
"href=\"resource:internal.css\">\n"
|
||||||
|
"<style>\n"
|
||||||
|
"html {\n"
|
||||||
|
"\tbackground-color: #%06x;\n"
|
||||||
|
"}\n"
|
||||||
|
"body {\n"
|
||||||
|
"\tcolor: #%06x;\n"
|
||||||
|
"\tbackground-color: #%06x;\n"
|
||||||
|
"\tborder-color: #%06x;\n"
|
||||||
|
"}\n"
|
||||||
|
"h2 {\n"
|
||||||
|
"\tborder-color: #%06x;\n"
|
||||||
|
"}\n"
|
||||||
|
"</style>\n"
|
||||||
"</head>\n"
|
"</head>\n"
|
||||||
"<body id =\"certificate\">\n"
|
"<body id =\"certificate\">\n"
|
||||||
"<p class=\"banner\">"
|
"<h1>Certificate</h1>\n",
|
||||||
"<a href=\"http://www.netsurf-browser.org/\">"
|
outside, fg, bg, border, border);
|
||||||
"<img src=\"resource:netsurf.png\" alt=\"NetSurf\"></a>"
|
|
||||||
"</p>\n"
|
|
||||||
"<h1>NetSurf Browser Certificate Viewer</h1>\n");
|
|
||||||
if (res != NSERROR_OK) {
|
if (res != NSERROR_OK) {
|
||||||
goto fetch_about_certificate_handler_aborted;
|
goto fetch_about_certificate_handler_aborted;
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,8 @@ h1 {
|
|||||||
h2 {
|
h2 {
|
||||||
font-size: 160%;
|
font-size: 160%;
|
||||||
padding-top: 5mm;
|
padding-top: 5mm;
|
||||||
border-top: 1px solid black; }
|
border-top-width: 1px;
|
||||||
|
border-top-style: solid; }
|
||||||
|
|
||||||
h3 {
|
h3 {
|
||||||
font-size: 140%;
|
font-size: 140%;
|
||||||
|
Loading…
Reference in New Issue
Block a user