mirror of
https://github.com/polybar/polybar.git
synced 2024-11-25 13:55:47 -05:00
fix: Make sure background colors are filled
Fixes a bug where alignment changes caused the previous background to bleed over because of the shift. Fixes #141
This commit is contained in:
parent
2a59236441
commit
004d499ce3
1 changed files with 8 additions and 5 deletions
|
@ -842,14 +842,17 @@ void bar::on_action_block_close(mousebtn btn) { // {{{
|
|||
* Handle color change
|
||||
*/
|
||||
void bar::on_color_change(gc gc_, color color_) { // {{{
|
||||
m_log.trace_x("bar: color_change(%i, %s -> %s)", static_cast<int>(gc_), color_.source(), color_);
|
||||
|
||||
if (gc_ == gc::FG) {
|
||||
m_fontmanager->allocate_color(color_);
|
||||
}
|
||||
m_log.trace_x("bar: color_change(%i, %s -> #%07x)", static_cast<int>(gc_), color_.source(),
|
||||
static_cast<uint32_t>(color_));
|
||||
|
||||
const uint32_t value_list[]{color_};
|
||||
m_connection.change_gc(m_gcontexts.at(gc_), XCB_GC_FOREGROUND, value_list);
|
||||
|
||||
if (gc_ == gc::FG) {
|
||||
m_fontmanager->allocate_color(color_);
|
||||
} else if (gc_ == gc::BG) {
|
||||
draw_shift(m_xpos, 0);
|
||||
}
|
||||
} // }}}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue