builder: Never enable over/underline without color
You cannot make polybar emit only the %{+o} tag without a color so that codepath was unused.
This commit is contained in:
parent
325ef4c3b3
commit
6fdc3114f3
2 changed files with 8 additions and 28 deletions
|
@ -33,9 +33,9 @@ class builder {
|
||||||
void background_close();
|
void background_close();
|
||||||
void color(rgba color);
|
void color(rgba color);
|
||||||
void color_close();
|
void color_close();
|
||||||
void overline(const rgba& color = rgba{});
|
void overline(const rgba& color);
|
||||||
void overline_close();
|
void overline_close();
|
||||||
void underline(const rgba& color = rgba{});
|
void underline(const rgba& color);
|
||||||
void underline_close();
|
void underline_close();
|
||||||
void control(tags::controltag tag);
|
void control(tags::controltag tag);
|
||||||
void action(mousebtn index, string action);
|
void action(mousebtn index, string action);
|
||||||
|
@ -49,9 +49,7 @@ class builder {
|
||||||
protected:
|
protected:
|
||||||
void append(const string& text);
|
void append(const string& text);
|
||||||
|
|
||||||
void overline_color(rgba color);
|
|
||||||
void overline_color_close();
|
void overline_color_close();
|
||||||
void underline_color(rgba color);
|
|
||||||
void underline_color_close();
|
void underline_color_close();
|
||||||
|
|
||||||
void tag_open(tags::syntaxtag tag, const string& value);
|
void tag_open(tags::syntaxtag tag, const string& value);
|
||||||
|
|
|
@ -245,15 +245,6 @@ void builder::color_close() {
|
||||||
tag_close(syntaxtag::F);
|
tag_close(syntaxtag::F);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Insert tag to alter the current overline color
|
|
||||||
*/
|
|
||||||
void builder::overline_color(rgba color) {
|
|
||||||
auto hex = color_util::simplify_hex(color);
|
|
||||||
tag_open(syntaxtag::o, hex);
|
|
||||||
tag_open(attribute::OVERLINE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Close underline color tag
|
* Close underline color tag
|
||||||
*/
|
*/
|
||||||
|
@ -261,15 +252,6 @@ void builder::overline_color_close() {
|
||||||
tag_close(syntaxtag::o);
|
tag_close(syntaxtag::o);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Insert tag to alter the current underline color
|
|
||||||
*/
|
|
||||||
void builder::underline_color(rgba color) {
|
|
||||||
auto hex = color_util::simplify_hex(color);
|
|
||||||
tag_open(syntaxtag::u, hex);
|
|
||||||
tag_open(attribute::UNDERLINE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Close underline color tag
|
* Close underline color tag
|
||||||
*/
|
*/
|
||||||
|
@ -278,12 +260,12 @@ void builder::underline_color_close() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Insert tag to enable the overline attribute
|
* Insert tag to enable the overline attribute with the given color
|
||||||
*/
|
*/
|
||||||
void builder::overline(const rgba& color) {
|
void builder::overline(const rgba& color) {
|
||||||
if (color.has_color()) {
|
if (color.has_color()) {
|
||||||
overline_color(color);
|
auto hex = color_util::simplify_hex(color);
|
||||||
} else {
|
tag_open(syntaxtag::o, hex);
|
||||||
tag_open(attribute::OVERLINE);
|
tag_open(attribute::OVERLINE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -296,12 +278,12 @@ void builder::overline_close() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Insert tag to enable the underline attribute
|
* Insert tag to enable the underline attribute with the given color
|
||||||
*/
|
*/
|
||||||
void builder::underline(const rgba& color) {
|
void builder::underline(const rgba& color) {
|
||||||
if (color.has_color()) {
|
if (color.has_color()) {
|
||||||
underline_color(color);
|
auto hex = color_util::simplify_hex(color);
|
||||||
} else {
|
tag_open(syntaxtag::u, hex);
|
||||||
tag_open(attribute::UNDERLINE);
|
tag_open(attribute::UNDERLINE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue