mirror of
https://github.com/swaywm/sway.git
synced 2024-11-28 02:41:28 +00:00
swaybar: multiply min_width by the output scale
This is useful for mixed-DPI configurations to make the bar look the same on all outputs.
This commit is contained in:
parent
40bdd0eecf
commit
cb0c04cf46
|
@ -174,8 +174,8 @@ static uint32_t render_status_block(cairo_t *cairo,
|
||||||
output->scale, block->markup, "%s", block->min_width_str);
|
output->scale, block->markup, "%s", block->min_width_str);
|
||||||
block->min_width = w;
|
block->min_width = w;
|
||||||
}
|
}
|
||||||
if (width < block->min_width) {
|
if (width < block->min_width * output->scale) {
|
||||||
width = block->min_width;
|
width = block->min_width * output->scale;
|
||||||
}
|
}
|
||||||
|
|
||||||
double block_width = width;
|
double block_width = width;
|
||||||
|
@ -329,8 +329,8 @@ static void predict_status_block_pos(cairo_t *cairo,
|
||||||
output->scale, block->markup, "%s", block->min_width_str);
|
output->scale, block->markup, "%s", block->min_width_str);
|
||||||
block->min_width = w;
|
block->min_width = w;
|
||||||
}
|
}
|
||||||
if (width < block->min_width) {
|
if (width < block->min_width * output->scale) {
|
||||||
width = block->min_width;
|
width = block->min_width * output->scale;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t ideal_height = text_height + ws_vertical_padding * 2;
|
uint32_t ideal_height = text_height + ws_vertical_padding * 2;
|
||||||
|
|
Loading…
Reference in a new issue