Add tooltip selection based on name and state

One can set different tooltips for different workspaces. Selection works
the same as it does for Icons.
Also refactored the `selectIcon` function to a more general
`selectString` function.
Man page is updated too.
This commit is contained in:
Marc Meier
2024-03-20 15:54:52 +01:00
parent 01dce4609c
commit fe1d49518b
3 changed files with 77 additions and 40 deletions
+4 -2
View File
@@ -62,7 +62,7 @@ class Workspace {
public:
explicit Workspace(const Json::Value& workspace_data, Workspaces& workspace_manager,
const Json::Value& clients_data = Json::Value::nullRef);
std::string& selectIcon(std::map<std::string, std::string>& icons_map);
std::string& selectString(std::map<std::string, std::string>& string_map);
Gtk::Button& button() { return m_button; };
int id() const { return m_id; };
@@ -199,7 +199,9 @@ class Workspaces : public AModule, public EventHandler {
{"DEFAULT", SortMethod::DEFAULT}};
std::string m_format;
std::string m_tooltipFormat;
std::map<std::string, std::string> m_tooltipMap;
bool m_withTooltip;
std::map<std::string, std::string> m_iconsMap;
util::RegexCollection m_windowRewriteRules;