window: preserve previous background color if only foreground is pushed

This commit is contained in:
Andrzej Rybczak
2012-10-06 19:14:27 +02:00
parent df9ecabb55
commit d1a0090789

View File

@@ -851,7 +851,12 @@ Window &Window::operator<<(Color color)
setColor(m_base_color, m_base_bg_color);
break;
default:
m_color_stack.push(Colors(color, Color::Default));
Color bg;
if (m_color_stack.empty())
bg = m_bg_color;
else
bg = m_color_stack.top().bg;
m_color_stack.push(Colors(color, bg));
setColor(m_color_stack.top().fg, m_color_stack.top().bg);
}
return *this;