summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2013-03-09 11:28:32 +0100
committerDavid Herrmann <dh.herrmann@gmail.com>2013-03-09 11:31:11 +0100
commit1658bd82164c50cc048bae5a28cd223a7d45ff1e (patch)
tree6d3bf985b8f7cfbede7c301da1a32af0b3cd2701
parentaeddc5b5528a6308db70b13c54dfae4c5d47cc1f (diff)
wlt: theme: change frame color to white plus black border
It is currently pretty annoying to use multiple wlterm windows stacked on top on each other when the terminal-background is black. The border doesn't use multiple colors so it is hard to distinguish from the main-frame. This patch changes the border color to white (as most terminal-backgrounds are black by default) and additionally draws a black 1px frame around it. This guarantees that the frame is even visible with white terminal backgrounds. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
-rw-r--r--src/wlt_theme.c31
1 files changed, 23 insertions, 8 deletions
diff --git a/src/wlt_theme.c b/src/wlt_theme.c
index 63e8033..863746a 100644
--- a/src/wlt_theme.c
+++ b/src/wlt_theme.c
@@ -168,16 +168,22 @@ static void draw_control(struct wlt_theme *theme)
static void draw_frame(struct wlt_theme *theme)
{
uint8_t *dst;
- uint32_t *line;
+ uint32_t *line, col;
unsigned int i, j, height;
+ col = (0x60 << 24) | (0xaa << 16) | (0xaa << 8) | 0xaa;
+
/* top frame */
dst = theme->buffer.data + theme->buffer.stride *
theme->control_height;
for (i = 0; i < theme->frame_width; ++i) {
line = (uint32_t*)dst;
- for (j = 0; j < theme->buffer.width; ++j)
- line[j] = 0xa0 << 24;
+ for (j = 0; j < theme->buffer.width; ++j) {
+ if (!j || j + 1 == theme->buffer.width)
+ line[j] = 0xff << 24;
+ else
+ line[j] = col;
+ }
dst += theme->buffer.stride;
}
@@ -186,8 +192,13 @@ static void draw_frame(struct wlt_theme *theme)
(theme->buffer.height - theme->frame_width);
for (i = 0; i < theme->frame_width; ++i) {
line = (uint32_t*)dst;
- for (j = 0; j < theme->buffer.width; ++j)
- line[j] = 0xa0 << 24;
+ for (j = 0; j < theme->buffer.width; ++j) {
+ if (!j || j + 1 == theme->buffer.width
+ || i + 1 == theme->frame_width)
+ line[j] = 0xff << 24;
+ else
+ line[j] = col;
+ }
dst += theme->buffer.stride;
}
@@ -199,7 +210,7 @@ static void draw_frame(struct wlt_theme *theme)
for (i = 0; i < height; ++i) {
line = (uint32_t*)dst;
for (j = 0; j < theme->frame_width; ++j)
- line[j] = 0xa0 << 24;
+ line[j] = j ? col : (0xff << 24);
dst += theme->buffer.stride;
}
@@ -211,8 +222,12 @@ static void draw_frame(struct wlt_theme *theme)
for (i = 0; i < height; ++i) {
line = (uint32_t*)dst;
line += theme->buffer.width - theme->frame_width;
- for (j = 0; j < theme->frame_width; ++j)
- line[j] = 0xa0 << 24;
+ for (j = 0; j < theme->frame_width; ++j) {
+ if (j + 1 == theme->frame_width)
+ line[j] = 0xff << 24;
+ else
+ line[j] = col;
+ }
dst += theme->buffer.stride;
}
}