From b7a8e8e5443ffc95811db405a2c7c57d801fafc3 Mon Sep 17 00:00:00 2001 From: Till Smejkal Date: Wed, 24 Jun 2020 09:47:34 +0200 Subject: [PATCH] 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. --- src/modules/wlr/taskbar.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/wlr/taskbar.cpp b/src/modules/wlr/taskbar.cpp index 361eddcf..f5889702 100644 --- a/src/modules/wlr/taskbar.cpp +++ b/src/modules/wlr/taskbar.cpp @@ -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()),