1
0
Fork 0
mirror of https://github.com/polybar/polybar.git synced 2024-11-18 13:55:11 -05:00

fix(renderer): Adjust center block position when using tray

Fixes #551
This commit is contained in:
Michael Carlberg 2017-05-19 17:24:40 +02:00
parent 3f5141bf22
commit 389bae2669

View file

@ -399,6 +399,11 @@ double renderer::block_x(alignment a) const {
if ((min_pos = block_w(alignment::LEFT))) {
min_pos += BLOCK_GAP;
}
if (m_rect.x > 0) {
base_pos -= (m_bar.size.w - m_rect.width) / 2.0;
} else {
base_pos += (m_bar.size.w - m_rect.width) / 2.0;
}
return std::max(base_pos - block_w(a) / 2.0, min_pos);
}
case alignment::RIGHT: {