mirror of
https://github.com/polybar/polybar.git
synced 2024-11-25 13:55:47 -05:00
fix(renderer): Only draw text bg if color differs from bar bg (#831)
Fixes #759 by only drawing text background when its color is different from the background color of the bar itself. Explicitly setting a module's background to `background-0` now stops working.
This commit is contained in:
parent
3092a1b18f
commit
5d2deb1a99
1 changed files with 5 additions and 1 deletions
|
@ -602,7 +602,11 @@ void renderer::draw_text(const string& contents) {
|
|||
block.y_advance = &m_blocks[m_align].y;
|
||||
block.bg_rect = cairo::rect{0.0, 0.0, 0.0, 0.0};
|
||||
|
||||
if (m_bg) {
|
||||
// Only draw text background if the color differs from
|
||||
// the background color of the bar itself
|
||||
// Note: this means that if the user explicitly set text
|
||||
// background color equal to background-0 it will be ignored
|
||||
if (m_bg != m_bar.background) {
|
||||
block.bg = m_bg;
|
||||
block.bg_operator = m_comp_bg;
|
||||
block.bg_rect.x = m_rect.x;
|
||||
|
|
Loading…
Reference in a new issue