highlight urgent workspace

This commit is contained in:
2025-12-11 00:41:47 +01:00
parent 0a94acb8f4
commit e1eeb370da
9 changed files with 139 additions and 19 deletions

16
src/widgets/date.cpp Normal file
View 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;
}

View File

@@ -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");
}
}