From fcc7e9be562bab71f8f64691493f7f4f572f1bf4 Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 26 Sep 2023 21:57:04 -0400 Subject: [PATCH] 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. --- src/bar.c | 6 +++--- src/config.def.h | 3 ++- src/user.h | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/bar.c b/src/bar.c index ee7bcf9..d5ca256 100644 --- a/src/bar.c +++ b/src/bar.c @@ -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 }); diff --git a/src/config.def.h b/src/config.def.h index cc074a6..f87bcec 100644 --- a/src/config.def.h +++ b/src/config.def.h @@ -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}, }; diff --git a/src/user.h b/src/user.h index 367f389..cc42751 100644 --- a/src/user.h +++ b/src/user.h @@ -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 {