Merge pull request #751 from l3nkz/tabkbar-fixes

Fixes for wlr/taskbar
This commit is contained in:
Alex 2020-06-24 11:10:45 +02:00 committed by GitHub
commit fa6bf597cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -187,7 +187,7 @@ Task::Task(const waybar::Bar &bar, const Json::Value &config, Taskbar *tbar,
with_icon_ = true; with_icon_ = true;
format_after_ = format.substr(6); format_after_ = format.substr(6);
} else if (icon_pos == std::string::npos) { } else if (icon_pos == std::string::npos) {
format_after_ = format; format_before_ = format;
} else { } else {
with_icon_ = true; with_icon_ = true;
format_before_ = format.substr(0, icon_pos); format_before_ = format.substr(0, icon_pos);
@ -214,7 +214,7 @@ Task::Task(const waybar::Bar &bar, const Json::Value &config, Taskbar *tbar,
/* Handle click events if configured */ /* Handle click events if configured */
if (config_["on-click"].isString() || config_["on-click-middle"].isString() if (config_["on-click"].isString() || config_["on-click-middle"].isString()
|| config_["on-click-left"].isString()) { || config_["on-click-right"].isString()) {
button_.add_events(Gdk::BUTTON_PRESS_MASK); button_.add_events(Gdk::BUTTON_PRESS_MASK);
button_.signal_button_press_event().connect( button_.signal_button_press_event().connect(
sigc::mem_fun(*this, &Task::handle_clicked), false); sigc::mem_fun(*this, &Task::handle_clicked), false);
@ -421,7 +421,7 @@ void Task::update()
} }
if (!format_after_.empty()) { if (!format_after_.empty()) {
text_after_.set_label( text_after_.set_label(
fmt::format(format_before_, fmt::format(format_after_,
fmt::arg("title", title_), fmt::arg("title", title_),
fmt::arg("app_id", app_id_), fmt::arg("app_id", app_id_),
fmt::arg("state", state_string()), fmt::arg("state", state_string()),