highlight urgent workspace
This commit is contained in:
16
src/widgets/date.cpp
Normal file
16
src/widgets/date.cpp
Normal file
@@ -0,0 +1,16 @@
|
||||
#include "widgets/date.hpp"
|
||||
|
||||
#include <chrono>
|
||||
#include <iomanip>
|
||||
|
||||
bool Date::onUpdate() {
|
||||
auto now =
|
||||
std::chrono::system_clock::to_time_t(std::chrono::system_clock::now());
|
||||
|
||||
std::stringstream ss;
|
||||
ss << std::put_time(std::localtime(&now), "%a, %d.%m.%Y");
|
||||
|
||||
set_text(ss.str());
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -31,7 +31,7 @@ WorkspaceIndicator::~WorkspaceIndicator() {
|
||||
}
|
||||
|
||||
void WorkspaceIndicator::on_workspace_update(int monitorId) {
|
||||
if (monitorId != monitorId && monitorId != -1) {
|
||||
if (this->monitorId != monitorId && monitorId != -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -81,13 +81,13 @@ void WorkspaceIndicator::rebuild() {
|
||||
label->add_controller(gesture);
|
||||
|
||||
if (state != nullptr) {
|
||||
if (state->focused) {
|
||||
label->add_css_class("workspace-pill-focused");
|
||||
} else if (state->active) {
|
||||
label->add_css_class("workspace-pill-active");
|
||||
}
|
||||
|
||||
if (state->urgent) {
|
||||
if (state->urgent != true) {
|
||||
if (state->focused) {
|
||||
label->add_css_class("workspace-pill-focused");
|
||||
} else if (state->active) {
|
||||
label->add_css_class("workspace-pill-active");
|
||||
}
|
||||
} else {
|
||||
label->add_css_class("workspace-pill-urgent");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user