Fix: better formatting

This commit is contained in:
TheRealLorenz 2022-08-10 10:41:18 +02:00
parent 99ed2bb7fa
commit 5b1cd65e20
1 changed files with 7 additions and 9 deletions

View File

@ -175,8 +175,8 @@ auto Window::update() -> void {
bar_.window.get_style_context()->remove_class("solo"); bar_.window.get_style_context()->remove_class("solo");
bar_.window.get_style_context()->remove_class("empty"); bar_.window.get_style_context()->remove_class("empty");
} }
label_.set_markup( label_.set_markup(fmt::format(format_, fmt::arg("title", rewriteTitle(window_)),
fmt::format(format_, fmt::arg("title", rewriteTitle(window_)), fmt::arg("app_id", app_id_), fmt::arg("shell", shell_))); fmt::arg("app_id", app_id_), fmt::arg("shell", shell_)));
if (tooltipEnabled()) { if (tooltipEnabled()) {
label_.set_tooltip_text(window_); label_.set_tooltip_text(window_);
} }
@ -223,14 +223,12 @@ std::tuple<std::size_t, int, std::string, std::string, std::string, std::string>
? node["window_properties"]["class"].asString() ? node["window_properties"]["class"].asString()
: ""; : "";
const auto shell = node["shell"].isString() const auto shell = node["shell"].isString() ? node["shell"].asString() : "";
? node["shell"].asString()
: "";
int nb = node.size(); int nb = node.size();
if (parentWorkspace != 0) nb = leafNodesInWorkspace(parentWorkspace); if (parentWorkspace != 0) nb = leafNodesInWorkspace(parentWorkspace);
return {nb, node["id"].asInt(), Glib::Markup::escape_text(node["name"].asString()), app_id, return {nb, node["id"].asInt(), Glib::Markup::escape_text(node["name"].asString()),
app_class, shell}; app_id, app_class, shell};
} }
} }
// iterate // iterate
@ -250,8 +248,8 @@ std::tuple<std::size_t, int, std::string, std::string, std::string, std::string>
return {0, -1, "", "", "", ""}; return {0, -1, "", "", "", ""};
} }
std::tuple<std::size_t, int, std::string, std::string, std::string, std::string> Window::getFocusedNode( std::tuple<std::size_t, int, std::string, std::string, std::string, std::string>
const Json::Value& nodes, std::string& output) { Window::getFocusedNode(const Json::Value& nodes, std::string& output) {
Json::Value placeholder = 0; Json::Value placeholder = 0;
return gfnWithWorkspace(nodes, output, config_, bar_, placeholder); return gfnWithWorkspace(nodes, output, config_, bar_, placeholder);
} }