Revert "fix(parser): Use value stacks for %{R} tag #585"

This reverts commit d141d8b5e4.
This commit is contained in:
Michael Carlberg 2017-05-17 22:20:38 +02:00
parent d141d8b5e4
commit 5af5292808
2 changed files with 3 additions and 10 deletions

View File

@ -47,7 +47,6 @@ class parser {
std::stack<unsigned int> m_ul; std::stack<unsigned int> m_ul;
std::stack<unsigned int> m_ol; std::stack<unsigned int> m_ol;
std::stack<int> m_fonts; std::stack<int> m_fonts;
unsigned int m_reversed{0u};
}; };
POLYBAR_NS_END POLYBAR_NS_END

View File

@ -50,7 +50,6 @@ void parser::parse(const bar_settings& bar, string data) {
m_ul = std::stack<unsigned int>(); m_ul = std::stack<unsigned int>();
m_ol = std::stack<unsigned int>(); m_ol = std::stack<unsigned int>();
m_fonts = std::stack<int>(); m_fonts = std::stack<int>();
m_reversed = 0u;
if (!m_actions.empty()) { if (!m_actions.empty()) {
throw unclosed_actionblocks(to_string(m_actions.size()) + " unclosed action block(s)"); throw unclosed_actionblocks(to_string(m_actions.size()) + " unclosed action block(s)");
@ -84,7 +83,7 @@ void parser::codeblock(string&& data, const bar_settings& bar) {
switch (tag) { switch (tag) {
case 'B': { case 'B': {
m_sig.emit(change_background{parse_color(m_bg, value, bar.background)}); m_sig.emit(change_background{parse_color(m_bg, value, 0UL)});
break; break;
} }
@ -111,13 +110,8 @@ void parser::codeblock(string&& data, const bar_settings& bar) {
break; break;
case 'R': case 'R':
if (++m_reversed % 2) { m_sig.emit(change_background{parse_color_string(value, bar.foreground)});
m_sig.emit(change_background{parse_color(m_fg, value, bar.foreground)}); m_sig.emit(change_foreground{parse_color_string(value, bar.background)});
m_sig.emit(change_foreground{parse_color(m_bg, value, bar.background)});
} else {
m_sig.emit(change_foreground{parse_color(m_fg, value, bar.foreground)});
m_sig.emit(change_background{parse_color(m_bg, value, bar.background)});
}
break; break;
case 'O': case 'O':