tooltip-format spaces breaks pango format

Signed-off-by: Viktar Lukashonak <myxabeer@gmail.com>
This commit is contained in:
Viktar Lukashonak 2023-07-29 23:46:35 +03:00
parent d3520536c4
commit 106535e3eb
No known key found for this signature in database
GPG Key ID: 08A413AA87200A6F
1 changed files with 3 additions and 3 deletions

View File

@ -53,15 +53,15 @@ waybar::modules::Clock::Clock(const std::string& id, const Json::Value& config)
// on update. // on update.
if (config_["tooltip-format"].isString()) { if (config_["tooltip-format"].isString()) {
std::string trimmed_format{config_["tooltip-format"].asString()}; std::string trimmed_format{config_["tooltip-format"].asString()};
fmtMap_.insert({5, trimmed_format});
trimmed_format.erase(std::remove_if(trimmed_format.begin(), trimmed_format.end(), trimmed_format.erase(std::remove_if(trimmed_format.begin(), trimmed_format.end(),
[](unsigned char x) { return std::isspace(x); }), [](unsigned char x) { return std::isspace(x); }),
trimmed_format.end()); trimmed_format.end());
fmtMap_.insert({5, trimmed_format});
if (fmtMap_[5].find("{" + kCalendarPlaceholder + "}") != std::string::npos) { if (trimmed_format.find("{" + kCalendarPlaceholder + "}") != std::string::npos) {
is_calendar_in_tooltip_ = true; is_calendar_in_tooltip_ = true;
} }
if (fmtMap_[5].find("{" + KTimezonedTimeListPlaceholder + "}") != std::string::npos) { if (trimmed_format.find("{" + KTimezonedTimeListPlaceholder + "}") != std::string::npos) {
is_timezoned_list_in_tooltip_ = true; is_timezoned_list_in_tooltip_ = true;
} }
} }