aboutsummaryrefslogtreecommitdiff
path: root/src/comet.c
diff options
context:
space:
mode:
authorFederico Angelilli <code@fedang.net>2024-07-12 00:08:18 +0200
committerFederico Angelilli <code@fedang.net>2024-07-12 00:08:18 +0200
commite8cd9d9f83c1f48fd6f71ee7b062173436f78266 (patch)
tree922ff3c115da3a338a19f8713b30f8a3107b73f4 /src/comet.c
parent32aa49a2299ea2bf95b72631dfafac7090c3c6e9 (diff)
Update config
Diffstat (limited to 'src/comet.c')
-rw-r--r--src/comet.c45
1 files changed, 7 insertions, 38 deletions
diff --git a/src/comet.c b/src/comet.c
index 078ff15..c4d9f17 100644
--- a/src/comet.c
+++ b/src/comet.c
@@ -37,9 +37,9 @@ static cairo_surface_t *render_all(layout_t *layout, config_t *config, layout_in
cairo_set_fill_rule(cr, CAIRO_FILL_RULE_EVEN_ODD);
cairo_set_operator(cr, CAIRO_OPERATOR_OVER);
- //color_t color = layout->block->color;
- //cairo_set_source_rgba(cr, color.r, color.g, color.b, color.a);
- //cairo_paint(cr);
+ color_t color = config->background;
+ cairo_set_source_rgba(cr, color.r, color.g, color.b, color.a);
+ cairo_paint(cr);
layout_render(layout, cr);
log_trace("Rendered layouts");
@@ -71,7 +71,8 @@ int main(int argc, char **argv)
window_t window;
window_init(&window, &display, &config);
- config.block.min_width = config.block.max_width = config.width;
+ // FIXME
+ config.main_block.min_width = config.main_block.max_width = config.width;
int x_padding = 10;
int y_padding = 8;
@@ -89,38 +90,6 @@ int main(int argc, char **argv)
window_resize(&window, config.width, config.height);
window_move(&window, x_padding, y_padding);
- //block_t blocks[2] = {
- // {
- // .color = { 0.2, 0.2, 0.2, 1 },
- // .type = BLOCK_TEXT,
- // .text = {
- // .text = "A",
- // .text_color = { 0.8, 0.9, 0.3, 1 },
- // },
- // },
- // {
- // .color = { 0.2, 0.2, 0.2, 1 },
- // .type = BLOCK_TEXT,
- // .min_width = 100,
- // .text = {
- // .text = "B",
- // .text_color = { 0.8, 0.9, 0.3, 1 },
- // },
- // },
- //};
-
- //block_t top = {
- // .hidden = false,
- // .color = { 0.3, 0.2, 0.5, 1 },
- // .min_width = config.width,
- // .type = BLOCK_GROUP,
- // .group = {
- // .spacing = 10,
- // .n_children = 2,
- // .children = blocks,
- // },
- //};
-
// TODO: Allow ondemand rendering
struct timespec rate, start, end, diff;
@@ -131,10 +100,10 @@ int main(int argc, char **argv)
while (true) {
timespec_get(&start, TIME_UTC);
- block_update(&config.block);
+ block_update(&config.main_block);
layout_t layout;
- layout_init(&layout, &config.block, info);
+ layout_init(&layout, &config.main_block, info);
event_dispatch(&display, &layout);