Add hide-active
This commit is contained in:
@@ -36,6 +36,7 @@ class Workspaces : public AModule, public EventHandler {
|
|||||||
auto allOutputs() const -> bool { return m_allOutputs; }
|
auto allOutputs() const -> bool { return m_allOutputs; }
|
||||||
auto showSpecial() const -> bool { return m_showSpecial; }
|
auto showSpecial() const -> bool { return m_showSpecial; }
|
||||||
auto activeOnly() const -> bool { return m_activeOnly; }
|
auto activeOnly() const -> bool { return m_activeOnly; }
|
||||||
|
auto hideActive() const -> bool { return m_hideActive; }
|
||||||
auto specialVisibleOnly() const -> bool { return m_specialVisibleOnly; }
|
auto specialVisibleOnly() const -> bool { return m_specialVisibleOnly; }
|
||||||
auto moveToMonitor() const -> bool { return m_moveToMonitor; }
|
auto moveToMonitor() const -> bool { return m_moveToMonitor; }
|
||||||
|
|
||||||
@@ -121,6 +122,7 @@ class Workspaces : public AModule, public EventHandler {
|
|||||||
bool m_allOutputs = false;
|
bool m_allOutputs = false;
|
||||||
bool m_showSpecial = false;
|
bool m_showSpecial = false;
|
||||||
bool m_activeOnly = false;
|
bool m_activeOnly = false;
|
||||||
|
bool m_hideActive = false;
|
||||||
bool m_specialVisibleOnly = false;
|
bool m_specialVisibleOnly = false;
|
||||||
bool m_moveToMonitor = false;
|
bool m_moveToMonitor = false;
|
||||||
Json::Value m_persistentWorkspaceConfig;
|
Json::Value m_persistentWorkspaceConfig;
|
||||||
|
|||||||
@@ -173,6 +173,15 @@ std::string &Workspace::selectIcon(std::map<std::string, std::string> &icons_map
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Workspace::update(const std::string &format, const std::string &icon) {
|
void Workspace::update(const std::string &format, const std::string &icon) {
|
||||||
|
// clang-format off
|
||||||
|
if (this->m_workspaceManager.hideActive() && \
|
||||||
|
this->isActive() && \
|
||||||
|
!this->isPersistent() && \
|
||||||
|
!this->isSpecial()) {
|
||||||
|
// clang-format on
|
||||||
|
m_button.hide();
|
||||||
|
return;
|
||||||
|
}
|
||||||
// clang-format off
|
// clang-format off
|
||||||
if (this->m_workspaceManager.activeOnly() && \
|
if (this->m_workspaceManager.activeOnly() && \
|
||||||
!this->isActive() && \
|
!this->isActive() && \
|
||||||
|
|||||||
@@ -601,6 +601,7 @@ auto Workspaces::parseConfig(const Json::Value &config) -> void {
|
|||||||
populateBoolConfig(config, "show-special", m_showSpecial);
|
populateBoolConfig(config, "show-special", m_showSpecial);
|
||||||
populateBoolConfig(config, "special-visible-only", m_specialVisibleOnly);
|
populateBoolConfig(config, "special-visible-only", m_specialVisibleOnly);
|
||||||
populateBoolConfig(config, "active-only", m_activeOnly);
|
populateBoolConfig(config, "active-only", m_activeOnly);
|
||||||
|
populateBoolConfig(config, "hide-active", m_hideActive);
|
||||||
populateBoolConfig(config, "move-to-monitor", m_moveToMonitor);
|
populateBoolConfig(config, "move-to-monitor", m_moveToMonitor);
|
||||||
|
|
||||||
m_persistentWorkspaceConfig = config.get("persistent-workspaces", Json::Value());
|
m_persistentWorkspaceConfig = config.get("persistent-workspaces", Json::Value());
|
||||||
|
|||||||
Reference in New Issue
Block a user