summaryrefslogtreecommitdiff
path: root/lib/renderers/cairo.h
diff options
context:
space:
mode:
authorJari Vetoniemi <mailroxas@gmail.com>2015-01-18 01:38:25 +0200
committerJari Vetoniemi <mailroxas@gmail.com>2015-01-18 01:38:25 +0200
commitf2eaf599f6bb585d1a4921f37a073ed09c619de9 (patch)
tree38b825d2e23694856c5f8a8b38ee499b30fecd50 /lib/renderers/cairo.h
parent9c541d0b4261acd656171a03e6bfd2719f91286d (diff)
downloadbemenu-f2eaf599f6bb585d1a4921f37a073ed09c619de9.tar.gz
bemenu-f2eaf599f6bb585d1a4921f37a073ed09c619de9.tar.bz2
bemenu-f2eaf599f6bb585d1a4921f37a073ed09c619de9.zip
Change default scrollbar style and make colors configurable
Diffstat (limited to 'lib/renderers/cairo.h')
-rw-r--r--lib/renderers/cairo.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/renderers/cairo.h b/lib/renderers/cairo.h
index c135a51..1a4f7c2 100644
--- a/lib/renderers/cairo.h
+++ b/lib/renderers/cairo.h
@@ -252,16 +252,17 @@ bm_cairo_paint(struct cairo *cairo, uint32_t width, uint32_t height, uint32_t ma
}
if (menu->scrollbar && count > 0) {
+ bm_cairo_color_from_menu_color(menu, BM_COLOR_SCROLLBAR_BG, &paint.bg);
+ bm_cairo_color_from_menu_color(menu, BM_COLOR_SCROLLBAR_FG, &paint.fg);
+
uint32_t sheight = out_result->height - titleh;
- bm_cairo_color_from_menu_color(menu, BM_COLOR_TITLE_FG, &paint.bg);
cairo_set_source_rgba(cairo->cr, paint.bg.r, paint.bg.b, paint.bg.g, paint.bg.a);
cairo_rectangle(cairo->cr, 0, titleh, 2, sheight);
cairo_fill(cairo->cr);
uint32_t size = sheight / lines;
uint32_t percent = (menu->index / (float)(count - 1)) * (sheight - size);
- bm_cairo_color_from_menu_color(menu, BM_COLOR_BG, &paint.bg);
- cairo_set_source_rgba(cairo->cr, paint.bg.r, paint.bg.b, paint.bg.g, paint.bg.a);
+ cairo_set_source_rgba(cairo->cr, paint.fg.r, paint.fg.b, paint.fg.g, paint.fg.a);
cairo_rectangle(cairo->cr, 0, titleh + percent, 2, size);
cairo_fill(cairo->cr);
}