mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
Fix format option for the taskbar module
When using additional format options in addition to {icon} the format is separated into text before and text after the icon. Each of the texts is displayed in a separate label one before and one after the image for the icon. The code updating the labels on changes used the wrong format strings when updating the label after the icon.
This commit is contained in:
parent
7429d1f9cc
commit
b7a8e8e544
@ -187,7 +187,7 @@ Task::Task(const waybar::Bar &bar, const Json::Value &config, Taskbar *tbar,
|
||||
with_icon_ = true;
|
||||
format_after_ = format.substr(6);
|
||||
} else if (icon_pos == std::string::npos) {
|
||||
format_after_ = format;
|
||||
format_before_ = format;
|
||||
} else {
|
||||
with_icon_ = true;
|
||||
format_before_ = format.substr(0, icon_pos);
|
||||
@ -421,7 +421,7 @@ void Task::update()
|
||||
}
|
||||
if (!format_after_.empty()) {
|
||||
text_after_.set_label(
|
||||
fmt::format(format_before_,
|
||||
fmt::format(format_after_,
|
||||
fmt::arg("title", title_),
|
||||
fmt::arg("app_id", app_id_),
|
||||
fmt::arg("state", state_string()),
|
||||
|
Loading…
Reference in New Issue
Block a user