Skip to content

Commit 5a5b813

Browse files
feat(taskbar): add minimal style option for workspace labels
When enabled, workspace labels in the taskbar show as colored text without the colored disc background. The fill color (primary for active, secondary for occupied) becomes the text color instead. This mirrors the minimal style option already available in the workspaces widget.
1 parent 6e7aa3b commit 5a5b813

5 files changed

Lines changed: 19 additions & 9 deletions

File tree

assets/translations/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3087,7 +3087,8 @@
30873087
"minimal": {
30883088
"description": "Show workspace id or name labels only, without animated pills",
30893089
"label": "Minimal Style",
3090-
"workspaces-description": "Text-only workspace labels without pill backgrounds or slide animation"
3090+
"workspaces-description": "Text-only workspace labels without pill backgrounds or slide animation",
3091+
"taskbar-description": "Text-only workspace labels without colored disc backgrounds"
30913092
},
30923093
"mirrored": {
30933094
"description": "Mirror the visualizer around its center",

src/shell/bar/widget_factory.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,7 @@ std::unique_ptr<Widget> WidgetFactory::create(
533533
.hideEmptyWorkspaces = wc != nullptr ? wc->getBool("hide_empty_workspaces", false) : false,
534534
.workspaceGroupCapsule = wc != nullptr ? wc->getBool("workspace_group_capsule", true) : true,
535535
.focusedOutputOnly = wc != nullptr ? wc->getBool("focused_output_only", false) : false,
536+
.minimal = wc != nullptr ? wc->getBool("minimal", false) : false,
536537
.groupSingleIconPerApp = wc != nullptr ? wc->getBool("group_single_icon_per_app", false) : false,
537538
.showActiveIndicator = wc != nullptr ? wc->getBool("show_active_indicator", true) : true,
538539
.activeOpacity = wc != nullptr ? static_cast<float>(wc->getDouble("active_opacity", 1.0)) : 1.0f,

src/shell/bar/widgets/taskbar_widget.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,12 @@ TaskbarWidget::TaskbarWidget(
166166
)
167167
: m_platform(platform), m_configService(config), m_output(output), m_configOptions(std::move(options)),
168168
m_showAllOutputs(m_configOptions.showAllOutputs), m_focusedOutputOnly(m_configOptions.focusedOutputOnly),
169-
m_showActiveIndicator(m_configOptions.showActiveIndicator), m_activeOpacity(m_configOptions.activeOpacity),
170-
m_inactiveOpacity(m_configOptions.inactiveOpacity), m_focusedColor(m_configOptions.focusedColor),
171-
m_occupiedColor(m_configOptions.occupiedColor), m_emptyColor(m_configOptions.emptyColor),
172-
m_windowTitleMaxWidth(m_configOptions.windowTitleMaxWidth), m_taskbarMaxWidth(m_configOptions.taskbarMaxWidth),
173-
m_barPosition(std::move(m_configOptions.barPosition)), m_shadowConfig(m_configOptions.shadowConfig) {
169+
m_minimal(m_configOptions.minimal), m_showActiveIndicator(m_configOptions.showActiveIndicator),
170+
m_activeOpacity(m_configOptions.activeOpacity), m_inactiveOpacity(m_configOptions.inactiveOpacity),
171+
m_focusedColor(m_configOptions.focusedColor), m_occupiedColor(m_configOptions.occupiedColor),
172+
m_emptyColor(m_configOptions.emptyColor), m_windowTitleMaxWidth(m_configOptions.windowTitleMaxWidth),
173+
m_taskbarMaxWidth(m_configOptions.taskbarMaxWidth), m_barPosition(std::move(m_configOptions.barPosition)),
174+
m_shadowConfig(m_configOptions.shadowConfig) {
174175
syncWorkspaceGroupingCapability();
175176
buildDesktopIconIndex();
176177
}
@@ -607,7 +608,7 @@ void TaskbarWidget::buildTaskButtons(Renderer& renderer) {
607608
const auto styleWorkspaceDisc = [this](Box& badge, float width, float height, const Workspace& workspace) {
608609
badge.setFrameSize(width, height);
609610
badge.setRadius(resolvedBarCapsuleRadius(width, height));
610-
badge.setFill(workspaceFillColor(workspace));
611+
badge.setFill(m_minimal ? clearColorSpec() : workspaceFillColor(workspace));
611612
badge.clearBorder();
612613
};
613614

@@ -647,7 +648,7 @@ void TaskbarWidget::buildTaskButtons(Renderer& renderer) {
647648
.fontSize = badgeFontSize,
648649
.fontWeight = fontWeight,
649650
.fontFamily = fontFamily,
650-
.color = workspaceTextColor(ws.workspace),
651+
.color = m_minimal ? workspaceFillColor(ws.workspace) : workspaceTextColor(ws.workspace),
651652
});
652653
badgeText->measure(renderer);
653654
badgeText->setPosition(
@@ -693,7 +694,7 @@ void TaskbarWidget::buildTaskButtons(Renderer& renderer) {
693694
.fontSize = badgeFontSize,
694695
.fontWeight = fontWeight,
695696
.fontFamily = fontFamily,
696-
.color = workspaceTextColor(ws.workspace),
697+
.color = m_minimal ? workspaceFillColor(ws.workspace) : workspaceTextColor(ws.workspace),
697698
});
698699
badgeText->measure(renderer);
699700
badgeText->setPosition(

src/shell/bar/widgets/taskbar_widget.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ struct TaskbarWidgetOptions {
3535
bool hideEmptyWorkspaces = false;
3636
bool workspaceGroupCapsule = true;
3737
bool focusedOutputOnly = false;
38+
bool minimal = false;
3839
bool groupSingleIconPerApp = false;
3940
bool showActiveIndicator = true;
4041
float activeOpacity = 1.0f;
@@ -131,6 +132,7 @@ class TaskbarWidget : public Widget {
131132
bool m_focusedOutputOnly = false;
132133
bool m_wasFocusedOutput = true;
133134
bool m_activeUsesFocusedColor = true;
135+
bool m_minimal = false;
134136
bool m_groupSingleIconPerApp = false;
135137
bool m_showActiveIndicator = true;
136138
float m_activeOpacity = 1.0f;

src/shell/settings/widget_settings_registry.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,11 @@ namespace settings {
851851
focusedOutputOnly.visibleWhen =
852852
WidgetSettingVisibility{WidgetSettingVisibilityCondition{"show_workspace_label", {"true"}}};
853853
add(std::move(focusedOutputOnly));
854+
auto minimal = boolSpec("minimal", false);
855+
minimal.descriptionKey = "settings.widgets.settings.minimal.taskbar-description";
856+
minimal.visibleWhen =
857+
WidgetSettingVisibility{WidgetSettingVisibilityCondition{"show_workspace_label", {"true"}}};
858+
add(std::move(minimal));
854859
}
855860
{
856861
auto singleIconPerApp = boolSpec("group_single_icon_per_app", false);

0 commit comments

Comments
 (0)