Merge remote-tracking branch 'origin/master' into pr-4537
# Conflicts: # include/modules/niri/workspaces.hpp # src/modules/niri/workspaces.cpp
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <gtkmm/button.h>
|
||||
#include <json/value.h>
|
||||
|
||||
#include <regex>
|
||||
#include <vector>
|
||||
|
||||
@@ -13,23 +14,29 @@ namespace waybar::modules::niri {
|
||||
|
||||
class Workspaces : public AModule, public EventHandler {
|
||||
public:
|
||||
Workspaces(const std::string &, const Bar &, const Json::Value &);
|
||||
Workspaces(const std::string&, const Bar&, const Json::Value&);
|
||||
~Workspaces() override;
|
||||
void update() override;
|
||||
|
||||
private:
|
||||
void onEvent(const Json::Value &ev) override;
|
||||
void onEvent(const Json::Value& ev) override;
|
||||
void doUpdate();
|
||||
Gtk::Button &addButton(const Json::Value &ws);
|
||||
std::string getIcon(const std::string &value, const Json::Value &ws);
|
||||
bool isWorkspaceIgnored(const std::string &name);
|
||||
void sortWorkspaces(std::vector<Json::Value>& workspaces) const;
|
||||
Gtk::Button& addButton(const Json::Value& ws);
|
||||
std::string getIcon(const std::string& value, const Json::Value& ws);
|
||||
bool isWorkspaceIgnored(const std::string& name);
|
||||
bool handleScroll(GdkEventScroll* /*unused*/) override;
|
||||
|
||||
const Bar &bar_;
|
||||
const Bar& bar_;
|
||||
Gtk::Box box_;
|
||||
// Map from niri workspace id to button.
|
||||
std::unordered_map<uint64_t, Gtk::Button> buttons_;
|
||||
// Vec of regex rules to ignore workspaces.
|
||||
std::vector<std::regex> ignoreWorkspaces_;
|
||||
|
||||
bool sort_by_id_ = false;
|
||||
bool sort_by_name_ = false;
|
||||
bool sort_by_coordinates_ = false;
|
||||
};
|
||||
|
||||
} // namespace waybar::modules::niri
|
||||
|
||||
Reference in New Issue
Block a user