From 5af5292808c88c2fdfa096f28c50aee60299f77e Mon Sep 17 00:00:00 2001 From: Michael Carlberg Date: Wed, 17 May 2017 22:20:38 +0200 Subject: [PATCH] Revert "fix(parser): Use value stacks for %{R} tag #585" This reverts commit d141d8b5e44734d54eb54d8953918469b1bb0faf. --- include/components/parser.hpp | 1 - src/components/parser.cpp | 12 +++--------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/include/components/parser.hpp b/include/components/parser.hpp index f933520d..5f113a69 100644 --- a/include/components/parser.hpp +++ b/include/components/parser.hpp @@ -47,7 +47,6 @@ class parser { std::stack m_ul; std::stack m_ol; std::stack m_fonts; - unsigned int m_reversed{0u}; }; POLYBAR_NS_END diff --git a/src/components/parser.cpp b/src/components/parser.cpp index afd5dc7b..af68a645 100644 --- a/src/components/parser.cpp +++ b/src/components/parser.cpp @@ -50,7 +50,6 @@ void parser::parse(const bar_settings& bar, string data) { m_ul = std::stack(); m_ol = std::stack(); m_fonts = std::stack(); - m_reversed = 0u; if (!m_actions.empty()) { 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) { 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; } @@ -111,13 +110,8 @@ void parser::codeblock(string&& data, const bar_settings& bar) { break; case 'R': - if (++m_reversed % 2) { - m_sig.emit(change_background{parse_color(m_fg, value, bar.foreground)}); - 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)}); - } + m_sig.emit(change_background{parse_color_string(value, bar.foreground)}); + m_sig.emit(change_foreground{parse_color_string(value, bar.background)}); break; case 'O':