refactor: simpler code

This commit is contained in:
Alex
2019-05-17 09:59:37 +02:00
parent b45dcdf74e
commit 4d4cadb5ae
4 changed files with 7 additions and 35 deletions

View File

@ -7,8 +7,8 @@
#include "bar.hpp"
#include "client.hpp"
#include "modules/sway/ipc/client.hpp"
#include "util/sleeper_thread.hpp"
#include "util/json.hpp"
#include "util/sleeper_thread.hpp"
namespace waybar::modules::sway {
@ -19,8 +19,6 @@ class Workspaces : public IModule, public sigc::trackable {
auto update() -> void;
operator Gtk::Widget&();
bool handleScroll(GdkEventScroll*);
private:
void onCmd(const struct Ipc::ipc_response&);
void onEvent(const struct Ipc::ipc_response&);
@ -32,6 +30,7 @@ class Workspaces : public IModule, public sigc::trackable {
const std::string getCycleWorkspace(std::vector<Json::Value>::iterator, bool prev) const;
uint16_t getWorkspaceIndex(const std::string& name) const;
std::string trimWorkspaceName(std::string);
bool handleScroll(GdkEventScroll*);
const Bar& bar_;
const Json::Value& config_;