Skip to content

Commit 5e22f5f

Browse files
committed
ui(settings): group workspaces widget settings into sections
1 parent 1b6d911 commit 5e22f5f

2 files changed

Lines changed: 32 additions & 30 deletions

File tree

assets/translations/en.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -997,7 +997,12 @@
997997
"windows": "Windows",
998998
"workspace-labels": "Workspace Labels"
999999
},
1000-
"widget": "Widget"
1000+
"widget": "Widget",
1001+
"workspaces": {
1002+
"colors": "Colors",
1003+
"list": "Workspaces",
1004+
"pills": "Pill Style"
1005+
}
10011006
}
10021007
}
10031008
}

src/shell/settings/widget_settings_registry.cpp

Lines changed: 26 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,63 +1021,60 @@ namespace settings {
10211021
break;
10221022
}
10231023
}
1024+
1025+
// Workspaces: which workspaces appear, and what each one's label shows.
10241026
{
1025-
auto minimal = boolSpec("minimal", false);
1026-
minimal.descriptionKey = "settings.widgets.settings.minimal.workspaces-description";
1027-
add(std::move(minimal));
1028-
}
1029-
{
1030-
auto focusedOutputOnly = boolSpec("focused_output_only", false);
1031-
focusedOutputOnly.descriptionKey = "settings.widgets.settings.focused-output-only.workspaces-description";
1032-
add(std::move(focusedOutputOnly));
1027+
auto hideWhenEmpty = withGroup(boolSpec("hide_when_empty", false), "workspaces.list");
1028+
hideWhenEmpty.descriptionKey = "settings.widgets.settings.hide-when-empty.workspaces-description";
1029+
add(std::move(hideWhenEmpty));
10331030
}
1034-
add(segmentedSpec("display", "id", workspaceDisplay));
1031+
add(withGroup(segmentedSpec("display", "id", workspaceDisplay), "workspaces.list"));
10351032
{
1036-
auto labelsOnlyWhenOccupied = boolSpec("labels_only_when_occupied", false);
1033+
auto labelsOnlyWhenOccupied = withGroup(boolSpec("labels_only_when_occupied", false), "workspaces.list");
10371034
labelsOnlyWhenOccupied.descriptionKey =
10381035
"settings.widgets.settings.labels-only-when-occupied.workspaces-description";
10391036
add(std::move(labelsOnlyWhenOccupied));
10401037
}
10411038
{
1042-
auto hideWhenEmpty = boolSpec("hide_when_empty", false);
1043-
hideWhenEmpty.descriptionKey = "settings.widgets.settings.hide-when-empty.workspaces-description";
1044-
add(std::move(hideWhenEmpty));
1045-
}
1046-
{
1047-
auto maxLabelChars = intSpec("max_label_chars", 1, 1.0, 20.0, 1.0);
1039+
auto maxLabelChars = withGroup(intSpec("max_label_chars", 1, 1.0, 20.0, 1.0), "workspaces.list");
10481040
maxLabelChars.descriptionKey = "settings.widgets.settings.max-label-chars.workspaces-description";
10491041
add(std::move(maxLabelChars));
10501042
}
1043+
1044+
// Pill style: minimal drops the pills entirely, so the pill sizing options hang off it.
1045+
{
1046+
auto minimal = withGroup(boolSpec("minimal", false), "workspaces.pills");
1047+
minimal.descriptionKey = "settings.widgets.settings.minimal.workspaces-description";
1048+
add(std::move(minimal));
1049+
}
10511050
{
1052-
auto pillScale = doubleSpec("pill_scale", 1.0, 0.1, 1.0, 0.05);
1051+
auto pillScale = withGroup(doubleSpec("pill_scale", 1.0, 0.1, 1.0, 0.05), "workspaces.pills");
10531052
pillScale.descriptionKey = "settings.widgets.settings.pill-scale.workspaces-description";
10541053
pillScale.visibleWhen = pillStyleOnly;
10551054
add(std::move(pillScale));
10561055
}
10571056
{
1058-
auto activePillSize = doubleSpec("active_pill_size", 2.2, 0.25, 8.0, 0.05);
1057+
auto activePillSize = withGroup(doubleSpec("active_pill_size", 2.2, 0.25, 8.0, 0.05), "workspaces.pills");
10591058
activePillSize.descriptionKey = "settings.widgets.settings.active-pill-size.workspaces-description";
10601059
activePillSize.visibleWhen = pillStyleOnly;
10611060
add(std::move(activePillSize));
10621061
}
10631062
{
1064-
auto inactivePillSize = doubleSpec("inactive_pill_size", 1.0, 0.25, 8.0, 0.05);
1063+
auto inactivePillSize = withGroup(doubleSpec("inactive_pill_size", 1.0, 0.25, 8.0, 0.05), "workspaces.pills");
10651064
inactivePillSize.descriptionKey = "settings.widgets.settings.inactive-pill-size.workspaces-description";
10661065
inactivePillSize.visibleWhen = pillStyleOnly;
10671066
add(std::move(inactivePillSize));
10681067
}
1068+
1069+
// Colors: the focused/occupied/empty palette and which monitor gets the focused treatment.
10691070
{
1070-
auto focusedColor = colorSpec("focused_color", "primary");
1071-
add(std::move(focusedColor));
1072-
}
1073-
{
1074-
auto occupiedColor = colorSpec("occupied_color", "secondary");
1075-
add(std::move(occupiedColor));
1076-
}
1077-
{
1078-
auto emptyColor = colorSpec("empty_color", "secondary");
1079-
add(std::move(emptyColor));
1071+
auto focusedOutputOnly = withGroup(boolSpec("focused_output_only", false), "workspaces.colors");
1072+
focusedOutputOnly.descriptionKey = "settings.widgets.settings.focused-output-only.workspaces-description";
1073+
add(std::move(focusedOutputOnly));
10801074
}
1075+
add(withGroup(colorSpec("focused_color", "primary"), "workspaces.colors"));
1076+
add(withGroup(colorSpec("occupied_color", "secondary"), "workspaces.colors"));
1077+
add(withGroup(colorSpec("empty_color", "secondary"), "workspaces.colors"));
10811078
}
10821079

10831080
specs.insert(specs.end(), std::make_move_iterator(commonSpecs.begin()), std::make_move_iterator(commonSpecs.end()));

0 commit comments

Comments
 (0)