aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFederico Angelilli <code@fedang.net>2024-11-29 12:12:39 +0100
committerFederico Angelilli <code@fedang.net>2024-11-29 12:12:39 +0100
commit8ad2993b9e6679a669b80154639b4941ed2fafb4 (patch)
tree4ec62786a4d549600f549e38d96b9b9a9ebe85b0 /src
parent32f4f9e071cb2a6966edaac512ae11598c5b1f7e (diff)
Refactor
Diffstat (limited to 'src')
-rw-r--r--src/blocks/slider.c4
-rw-r--r--src/config.c14
-rw-r--r--src/layout.c2
3 files changed, 8 insertions, 12 deletions
diff --git a/src/blocks/slider.c b/src/blocks/slider.c
index 8495ecf..9311274 100644
--- a/src/blocks/slider.c
+++ b/src/blocks/slider.c
@@ -79,7 +79,7 @@ static void block_slider_render(layout_t *layout, cairo_t *cr)
pattern = slider->line_color.pattern;
if (pattern != NULL) {
- int line_radius = radius + slider->line_width / 2;
+ int line_radius = radius;
render_capsule_fast(cr, bar_x, bar_y, slider->width, radius, line_radius);
cairo_pattern_set_matrix(pattern, &matrix);
@@ -152,7 +152,7 @@ static void block_slider_render(layout_t *layout, cairo_t *cr)
switch (slider->knob) {
case KNOB_CAPSULE: {
- int line_radius = knob_radius + slider->knob_line_width / 2;
+ int line_radius = knob_radius;
render_capsule(cr, knob_x, knob_y, knob_width, knob_radius, line_radius);
break;
}
diff --git a/src/config.c b/src/config.c
index ea59761..439a869 100644
--- a/src/config.c
+++ b/src/config.c
@@ -325,8 +325,7 @@ static bool config_read_list(const char *value, char ***result)
return true;
}
-static config_status_t config_read_block(const block_scheme_t *scheme, block_t *block, const char **type,
- const char *key, const char *value)
+static config_status_t config_read_block(block_t *block, const char **type, const char *key, const char *value)
{
const char *section = "block";
size_t index = 0;
@@ -342,10 +341,10 @@ static config_status_t config_read_block(const block_scheme_t *scheme, block_t *
status = config_read_entry(block_text_entries, block, &index, section, block->label, key, value);
*type = config_type_to_string(block_entries[index].type);
- if (status != CONFIG_UNKNOWN || scheme->entries == NULL)
+ if (status != CONFIG_UNKNOWN || block->scheme->entries == NULL)
return status;
- status = config_read_entry(scheme->entries, block, &index, section, block->label, key, value);
+ status = config_read_entry(block->scheme->entries, block, &index, section, block->label, key, value);
*type = config_type_to_string(block_entries[index].type);
return status;
}
@@ -544,8 +543,6 @@ int config_read(config_t *config, FILE *file)
bool bar_section = false;
action_t *action = NULL;
-
- const block_scheme_t *scheme = NULL;
block_t *block = NULL;
if (section != NULL) {
@@ -596,8 +593,7 @@ int config_read(config_t *config, FILE *file)
if (strcmp(block_schemes[i]->name, value))
continue;
- scheme = block_schemes[i];
- block = config_alloc_block(config, scheme, label);
+ block = config_alloc_block(config, block_schemes[i], label);
goto skip_pair;
}
@@ -668,7 +664,7 @@ int config_read(config_t *config, FILE *file)
}
if (block != NULL) {
- status = config_read_block(scheme, block, &type, key, value);
+ status = config_read_block(block, &type, key, value);
}
if (action != NULL) {
diff --git a/src/layout.c b/src/layout.c
index 73243c5..ee82f83 100644
--- a/src/layout.c
+++ b/src/layout.c
@@ -119,7 +119,7 @@ void layout_render(layout_t *layout, cairo_t *cr)
// Render border
pattern = layout->block->line_color.pattern;
if (pattern != NULL) {
- int line_radius = radius + layout->line_width / 2;
+ int line_radius = radius;
render_capsule_fast(cr, block_x, block_y, layout->width - layout->x_padding, radius, line_radius);
cairo_pattern_set_matrix(pattern, &matrix);