Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/52bfae17822d289dcf165...
...commit
http://git.netsurf-browser.org/netsurf.git/commit/52bfae17822d289dcf16566...
...tree
http://git.netsurf-browser.org/netsurf.git/tree/52bfae17822d289dcf16566ac...
The branch, master has been updated
via 52bfae17822d289dcf16566acfa3eac2539d66d5 (commit)
via 1e6b0f1d76198cf1770d92684bd70ed35d981d0d (commit)
from 4c256408c5b21d20bf703571ba106f7bb6101ada (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=52bfae17822d289dcf1...
commit 52bfae17822d289dcf16566acfa3eac2539d66d5
Author: Michael Drake <michael.drake(a)codethink.co.uk>
Commit: Michael Drake <michael.drake(a)codethink.co.uk>
Internal pages: Update directory listing style.
diff --git a/content/dirlist.c b/content/dirlist.c
index 1d7a67e..d34d3ff 100644
--- a/content/dirlist.c
+++ b/content/dirlist.c
@@ -28,7 +28,11 @@
#include "utils/nsurl.h"
#include "utils/messages.h"
+#include "netsurf/types.h"
+#include "netsurf/plot_style.h"
+
#include "content/dirlist.h"
+#include "desktop/system_colour.h"
static int dirlist_filesize_calculate(unsigned long *bytesize);
static int dirlist_filesize_value(unsigned long bytesize);
@@ -136,18 +140,68 @@ bool dirlist_generate_hide_columns(int flags, char *buffer, int
buffer_length)
bool dirlist_generate_title(const char *title, char *buffer, int buffer_length)
{
+ nserror err;
int error;
+ colour bg;
+ colour fg;
+ colour odd;
+ colour even;
+ colour border;
+
+ err = ns_system_colour_char("Window", &bg);
+ if (err != NSERROR_OK) {
+ return false;
+ }
+
+ err = ns_system_colour_char("WindowText", &fg);
+ if (err != NSERROR_OK) {
+ return false;
+ }
+
+ odd = mix_colour(fg, bg, 0x18);
+ even = mix_colour(fg, bg, 0x0c);
+ border = mix_colour(fg, bg, 0x40);
+
+ bg = colour_rb_swap(bg);
+ fg = colour_rb_swap(fg);
+ odd = colour_rb_swap(odd);
+ even = colour_rb_swap(even);
+ border = colour_rb_swap(border);
+
if (title == NULL)
title = "";
error = snprintf(buffer, buffer_length,
"</style>\n"
"<title>%s</title>\n"
+ "<style>\n"
+ "html {\n"
+ "\tbackground-color: #%06x;\n"
+ "}\n"
+ "body {\n"
+ "\tcolor: #%06x;\n"
+ "\tbackground-color: #%06x;\n"
+ "\tborder-color: #%06x;\n"
+ "}\n"
+ "body#dirlist h1 {\n"
+ "\tborder-color: #%06x;\n"
+ "}\n"
+ "body#dirlist a.odd {\n"
+ "\tbackground-color: #%06x;\n"
+ "}\n"
+ "body#dirlist a.even {\n"
+ "\tbackground-color: #%06x;\n"
+ "}\n"
+ "body#dirlist a + a>span {\n"
+ "\tborder-color: #%06x;\n"
+ "}\n"
+ "</style>\n"
"</head>\n"
"<body id=\"dirlist\">\n"
"<h1>%s</h1>\n",
- title, title);
+ title, even, fg, bg, border, border, odd,
+ even, border, title);
if (error < 0 || error >= buffer_length)
/* Error or buffer too small */
return false;
diff --git a/resources/internal.css b/resources/internal.css
index ded56ee..f98f0cc 100644
--- a/resources/internal.css
+++ b/resources/internal.css
@@ -2,13 +2,17 @@ html, body {
margin: 0;
padding: 0; }
+html {
+ padding: 2em;
+}
+
body {
- color: #000;
- background-color: #fff;
font-family: sans-serif;
font-size: 94%;
margin: 0 auto;
- position: relative; }
+ position: relative;
+ border-width: 2px;
+ border-style: solid; }
h1, h2, h3, h4, h5, h6, h7, p, ul, dl, ol, table {
margin-left: 5mm;
@@ -108,13 +112,13 @@ input.default-action {
*/
body#dirlist {
- background-color: #abf;
padding-bottom: 2em; }
body#dirlist h1 {
padding: 5mm;
margin: 0;
- border-bottom: 2px solid #bcf; }
+ border-bottom-width: 2px;
+ border-bottom-style: solid; }
body#dirlist p {
padding: 2px 5mm;
@@ -126,26 +130,31 @@ body#dirlist div {
margin: 5mm auto 2em auto;
padding: 0; }
-body#dirlist a, strong {
+body#dirlist strong {
display: table-row;
margin: 0;
- padding: 0; }
-
-body#dirlist a.odd {
- background-color: #bcf; }
+ padding: 0;
+ font-size: 120%;
+}
-body#dirlist a.even {
- background-color: #b2c3ff; }
+body#dirlist a {
+ display: table-row;
+ margin: 0;
+ padding: 0; }
body#dirlist span {
display: table-cell;
vertical-align: middle; }
+body#dirlist a > span {
+ padding-top: 0.1em; }
+
body#dirlist em > span {
padding-bottom: 1px; }
body#dirlist a + a>span {
- border-top: 1px solid #9af; }
+ border-top-width: 1px;
+ border-top-style: solid; }
body#dirlist a {
background-position: 4px 50%;
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=1e6b0f1d76198cf1770...
commit 1e6b0f1d76198cf1770d92684bd70ed35d981d0d
Author: Michael Drake <michael.drake(a)codethink.co.uk>
Commit: Michael Drake <michael.drake(a)codethink.co.uk>
Plot style: Add helper to swap red and blue channels.
diff --git a/include/netsurf/plot_style.h b/include/netsurf/plot_style.h
index bc86041..fee7a10 100644
--- a/include/netsurf/plot_style.h
+++ b/include/netsurf/plot_style.h
@@ -188,6 +188,12 @@ typedef struct plot_font_style {
#define blue_from_colour(c) \
((c >> 16) & 0xff)
+/* Swap red and blue channels in a colour */
+#define colour_rb_swap(c) \
+ (((0x000000ff & c) << 16) | \
+ ((0x0000ff00 & c) ) | \
+ ((0x00ff0000 & c) >> 16))
+
/** Colour components */
enum plot_colour_component {
PLOT_COLOUR_COMPONENT_RED,
-----------------------------------------------------------------------
Summary of changes:
content/dirlist.c | 56 +++++++++++++++++++++++++++++++++++++++++-
include/netsurf/plot_style.h | 6 +++++
resources/internal.css | 35 ++++++++++++++++----------
3 files changed, 83 insertions(+), 14 deletions(-)
diff --git a/content/dirlist.c b/content/dirlist.c
index 1d7a67e..d34d3ff 100644
--- a/content/dirlist.c
+++ b/content/dirlist.c
@@ -28,7 +28,11 @@
#include "utils/nsurl.h"
#include "utils/messages.h"
+#include "netsurf/types.h"
+#include "netsurf/plot_style.h"
+
#include "content/dirlist.h"
+#include "desktop/system_colour.h"
static int dirlist_filesize_calculate(unsigned long *bytesize);
static int dirlist_filesize_value(unsigned long bytesize);
@@ -136,18 +140,68 @@ bool dirlist_generate_hide_columns(int flags, char *buffer, int
buffer_length)
bool dirlist_generate_title(const char *title, char *buffer, int buffer_length)
{
+ nserror err;
int error;
+ colour bg;
+ colour fg;
+ colour odd;
+ colour even;
+ colour border;
+
+ err = ns_system_colour_char("Window", &bg);
+ if (err != NSERROR_OK) {
+ return false;
+ }
+
+ err = ns_system_colour_char("WindowText", &fg);
+ if (err != NSERROR_OK) {
+ return false;
+ }
+
+ odd = mix_colour(fg, bg, 0x18);
+ even = mix_colour(fg, bg, 0x0c);
+ border = mix_colour(fg, bg, 0x40);
+
+ bg = colour_rb_swap(bg);
+ fg = colour_rb_swap(fg);
+ odd = colour_rb_swap(odd);
+ even = colour_rb_swap(even);
+ border = colour_rb_swap(border);
+
if (title == NULL)
title = "";
error = snprintf(buffer, buffer_length,
"</style>\n"
"<title>%s</title>\n"
+ "<style>\n"
+ "html {\n"
+ "\tbackground-color: #%06x;\n"
+ "}\n"
+ "body {\n"
+ "\tcolor: #%06x;\n"
+ "\tbackground-color: #%06x;\n"
+ "\tborder-color: #%06x;\n"
+ "}\n"
+ "body#dirlist h1 {\n"
+ "\tborder-color: #%06x;\n"
+ "}\n"
+ "body#dirlist a.odd {\n"
+ "\tbackground-color: #%06x;\n"
+ "}\n"
+ "body#dirlist a.even {\n"
+ "\tbackground-color: #%06x;\n"
+ "}\n"
+ "body#dirlist a + a>span {\n"
+ "\tborder-color: #%06x;\n"
+ "}\n"
+ "</style>\n"
"</head>\n"
"<body id=\"dirlist\">\n"
"<h1>%s</h1>\n",
- title, title);
+ title, even, fg, bg, border, border, odd,
+ even, border, title);
if (error < 0 || error >= buffer_length)
/* Error or buffer too small */
return false;
diff --git a/include/netsurf/plot_style.h b/include/netsurf/plot_style.h
index bc86041..fee7a10 100644
--- a/include/netsurf/plot_style.h
+++ b/include/netsurf/plot_style.h
@@ -188,6 +188,12 @@ typedef struct plot_font_style {
#define blue_from_colour(c) \
((c >> 16) & 0xff)
+/* Swap red and blue channels in a colour */
+#define colour_rb_swap(c) \
+ (((0x000000ff & c) << 16) | \
+ ((0x0000ff00 & c) ) | \
+ ((0x00ff0000 & c) >> 16))
+
/** Colour components */
enum plot_colour_component {
PLOT_COLOUR_COMPONENT_RED,
diff --git a/resources/internal.css b/resources/internal.css
index ded56ee..f98f0cc 100644
--- a/resources/internal.css
+++ b/resources/internal.css
@@ -2,13 +2,17 @@ html, body {
margin: 0;
padding: 0; }
+html {
+ padding: 2em;
+}
+
body {
- color: #000;
- background-color: #fff;
font-family: sans-serif;
font-size: 94%;
margin: 0 auto;
- position: relative; }
+ position: relative;
+ border-width: 2px;
+ border-style: solid; }
h1, h2, h3, h4, h5, h6, h7, p, ul, dl, ol, table {
margin-left: 5mm;
@@ -108,13 +112,13 @@ input.default-action {
*/
body#dirlist {
- background-color: #abf;
padding-bottom: 2em; }
body#dirlist h1 {
padding: 5mm;
margin: 0;
- border-bottom: 2px solid #bcf; }
+ border-bottom-width: 2px;
+ border-bottom-style: solid; }
body#dirlist p {
padding: 2px 5mm;
@@ -126,26 +130,31 @@ body#dirlist div {
margin: 5mm auto 2em auto;
padding: 0; }
-body#dirlist a, strong {
+body#dirlist strong {
display: table-row;
margin: 0;
- padding: 0; }
-
-body#dirlist a.odd {
- background-color: #bcf; }
+ padding: 0;
+ font-size: 120%;
+}
-body#dirlist a.even {
- background-color: #b2c3ff; }
+body#dirlist a {
+ display: table-row;
+ margin: 0;
+ padding: 0; }
body#dirlist span {
display: table-cell;
vertical-align: middle; }
+body#dirlist a > span {
+ padding-top: 0.1em; }
+
body#dirlist em > span {
padding-bottom: 1px; }
body#dirlist a + a>span {
- border-top: 1px solid #9af; }
+ border-top-width: 1px;
+ border-top-style: solid; }
body#dirlist a {
background-position: 4px 50%;
--
NetSurf Browser