ui(widgets): replace active indicator in grouped taskbar with a much more visible dot

This commit is contained in:
Ly-sec
2026-05-03 21:23:35 +02:00
parent cc5d81e99e
commit bc82fe6848
5 changed files with 10 additions and 21 deletions
-4
View File
@@ -869,10 +869,6 @@
"text": "Text"
},
"settings": {
"active_indicator_width": {
"label": "Active Indicator Width",
"description": "Width of the active-task underline in pixels; set to 0 to hide"
},
"anchor": {
"label": "Anchor",
"description": "Pin this widget as the center alignment anchor"
+1 -5
View File
@@ -52,7 +52,6 @@
namespace {
constexpr Logger kLog("shell");
constexpr double kTaskbarActiveIndicatorWidthMax = 15.0;
std::string resolveDistroLogo(IconResolver& iconResolver) {
if (const auto info = DistroDetector::detect(); info.has_value()) {
@@ -327,10 +326,7 @@ std::unique_ptr<Widget> WidgetFactory::create(const std::string& name, wl_output
if (type == "taskbar") {
const bool groupByWorkspace = wc != nullptr ? wc->getBool("group_by_workspace", false) : false;
const double rawWidth = wc != nullptr ? wc->getDouble("active_indicator_width", 14.0) : 14.0;
const float activeIndicatorWidth = static_cast<float>(std::clamp(rawWidth, 0.0, kTaskbarActiveIndicatorWidthMax));
auto widget =
std::make_unique<TaskbarWidget>(m_wayland, output, groupByWorkspace, barPosition, activeIndicatorWidth);
auto widget = std::make_unique<TaskbarWidget>(m_wayland, output, groupByWorkspace, barPosition);
widget->setContentScale(contentScale);
return widget;
}
+8 -8
View File
@@ -32,9 +32,9 @@
#include <wayland-client-protocol.h>
TaskbarWidget::TaskbarWidget(WaylandConnection& connection, wl_output* output, bool groupByWorkspace,
std::string barPosition, float activeIndicatorWidth)
std::string barPosition)
: m_connection(connection), m_output(output), m_groupByWorkspace(groupByWorkspace),
m_activeIndicatorWidth(activeIndicatorWidth), m_barPosition(std::move(barPosition)) {
m_barPosition(std::move(barPosition)) {
buildDesktopIconIndex();
}
@@ -194,14 +194,14 @@ void TaskbarWidget::buildTaskButtons(Renderer& renderer) {
area->addChild(std::move(glyph));
}
const float lineWidth = m_activeIndicatorWidth * m_contentScale;
if (task.active && lineWidth > 0.0f) {
const float lineThickness = std::max(1.0f, Style::spaceXs * 0.25f * m_contentScale);
if (task.active) {
const float d = std::max(4.0f, std::round(Style::barGlyphSize * 0.32f * m_contentScale));
const float bottomInset = 0.25f * m_contentScale;
auto indicator = std::make_unique<Box>();
indicator->setFill(colorSpecFromRole(ColorRole::Primary));
indicator->setRadius(lineThickness * 0.5f);
indicator->setFrameSize(lineWidth, lineThickness);
indicator->setPosition(std::round((tileSize - lineWidth) * 0.5f), std::round(tileSize - lineThickness));
indicator->setRadius(d * 0.5f);
indicator->setFrameSize(d, d);
indicator->setPosition(std::round((tileSize - d) * 0.5f), std::round(tileSize - d - bottomInset));
area->addChild(std::move(indicator));
}
return area;
+1 -3
View File
@@ -20,8 +20,7 @@ struct PointerEvent;
class TaskbarWidget : public Widget {
public:
TaskbarWidget(WaylandConnection& connection, wl_output* output, bool groupByWorkspace, std::string barPosition,
float activeIndicatorWidth);
TaskbarWidget(WaylandConnection& connection, wl_output* output, bool groupByWorkspace, std::string barPosition);
~TaskbarWidget() override;
void create() override;
@@ -75,7 +74,6 @@ private:
WaylandConnection& m_connection;
wl_output* m_output = nullptr;
bool m_groupByWorkspace = false;
float m_activeIndicatorWidth = 0.0f;
std::string m_barPosition;
bool m_rebuildPending = true;
bool m_vertical = false;
@@ -473,7 +473,6 @@ namespace settings {
add(segmentedSpec("display", "gauge", sysmonDisplay));
add(boolSpec("show_label", true));
} else if (type == "taskbar") {
add(doubleSpec("active_indicator_width", 14.0, 0.0, 15.0, 1.0));
add(boolSpec("group_by_workspace", false));
} else if (type == "tray") {
add(stringListSpec("hidden"));