From cb0ee6f01e5f159abca2d1b1b138d53d0d8c61dc 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 473d37c..be7fb1c 100644 --- a/src/bar.c +++ b/src/bar.c @@ -188,7 +188,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; @@ -240,7 +240,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; @@ -271,7 +271,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 16da924..6fc0c0c 100644 --- a/src/config.def.h +++ b/src/config.def.h @@ -28,10 +28,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 f3f031d..1bb3fea 100644 --- a/src/user.h +++ b/src/user.h @@ -17,7 +17,8 @@ enum Clicked { enum ColorScheme { InActive_Scheme = 0, Active_Scheme = 1, - Urgent_Scheme = 2, + Status_Scheme = 2, + Urgent_Scheme = 3, }; enum TouchGesture {