mirror of
https://github.com/swaywm/sway.git
synced 2026-03-30 11:10:59 -04:00
Calculate positions of empty blocks in swaybar
This commit is contained in:
parent
3e3014df4d
commit
efe5a6fc0a
1 changed files with 6 additions and 4 deletions
|
|
@ -97,6 +97,10 @@ static void render_block(struct window *window, struct config *config, struct st
|
||||||
block->x = (int)pos;
|
block->x = (int)pos;
|
||||||
block->width = (int)block_width;
|
block->width = (int)block_width;
|
||||||
|
|
||||||
|
if (!block->full_text || !block->full_text[0]) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// render background
|
// render background
|
||||||
if (block->background != 0x0) {
|
if (block->background != 0x0) {
|
||||||
cairo_set_source_u32(window->cairo, block->background);
|
cairo_set_source_u32(window->cairo, block->background);
|
||||||
|
|
@ -330,12 +334,10 @@ void render(struct output *output, struct config *config, struct status_line *li
|
||||||
bool edge = true;
|
bool edge = true;
|
||||||
for (i = line->block_line->length - 1; i >= 0; --i) {
|
for (i = line->block_line->length - 1; i >= 0; --i) {
|
||||||
struct status_block *block = line->block_line->items[i];
|
struct status_block *block = line->block_line->items[i];
|
||||||
if (block->full_text && block->full_text[0]) {
|
|
||||||
render_block(window, config, block, &pos, edge, is_focused);
|
render_block(window, config, block, &pos, edge, is_focused);
|
||||||
edge = false;
|
edge = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
cairo_set_line_width(cairo, 1.0);
|
cairo_set_line_width(cairo, 1.0);
|
||||||
double x = 0.5;
|
double x = 0.5;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue