create separate status scheme

Previously, your inactive colorscheme was also the colorscheme for the
title and status portions of the bar. This made darker inactive text
make the rest of the bar look bad. This uses the active color on the
inactive background for a new status colorscheme.
master
Ryan 2023-09-26 21:57:04 -04:00
parent 41781f98e8
commit fcc7e9be56
Signed by: ryan
GPG Key ID: 7D7E2E94267DAD95
3 changed files with 7 additions and 5 deletions

View File

@ -184,7 +184,7 @@ void bar_layout_render(struct Pipeline *pipeline, struct Bar *bar, cairo_t *pain
bar->layout->width = bar_component_width(bar->layout, pipeline);
bar->layout->height = pipeline->shm->height;
pipeline_set_colorscheme(pipeline, schemes[InActive_Scheme]);
pipeline_set_colorscheme(pipeline, schemes[Status_Scheme]);
basic_component_render(bar->layout, pipeline, painter, x, y);
*x += bar->layout->width;
@ -249,7 +249,7 @@ void bar_title_render(struct Pipeline *pipeline, struct Bar *bar, cairo_t *paint
if (bar->active)
pipeline_set_colorscheme(pipeline, schemes[Active_Scheme]);
else
pipeline_set_colorscheme(pipeline, schemes[InActive_Scheme]);
pipeline_set_colorscheme(pipeline, schemes[Status_Scheme]);
bar->title->width = pipeline->shm->width - *x - bar_component_width(bar->status, pipeline) - pipeline_get_future_widths(pipeline);
bar->title->height = pipeline->shm->height;
@ -280,7 +280,7 @@ void bar_status_render(struct Pipeline *pipeline, struct Bar *bar, cairo_t *pain
char *previous_status = NULL;
pipeline_set_colorscheme(pipeline, schemes[InActive_Scheme]);
pipeline_set_colorscheme(pipeline, schemes[Status_Scheme]);
if (!bar->active && status_on_active)
pipeline_set_colorscheme(pipeline, (const int *[4]){ grey1, grey1 });

View File

@ -27,10 +27,11 @@ static const int grey1[4] = { 34, 34, 34, 255 };
static const int grey2[4] = { 187, 187, 187, 255 };
static const int grey3[4] = { 238, 238, 238, 255 };
static const int *schemes[3][2] = {
static const int *schemes[4][2] = {
/* Scheme Type fg, bg */
[InActive_Scheme] = {grey2, grey1},
[Active_Scheme] = {grey3, cyan},
[Status_Scheme] = {grey3, grey1},
[Urgent_Scheme] = {grey1, grey3},
};

View File

@ -16,7 +16,8 @@ enum Clicked {
enum ColorScheme {
InActive_Scheme = 0,
Active_Scheme = 1,
Urgent_Scheme = 2,
Status_Scheme = 2,
Urgent_Scheme = 3,
};
enum TouchGesture {