mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
settings: bar setting re-ordering/polishing and tuning
This commit is contained in:
@@ -697,8 +697,7 @@
|
||||
"move-to-lane": "Move to {lane}"
|
||||
},
|
||||
"detail": {
|
||||
"custom": "custom widget",
|
||||
"type": "type: {type}"
|
||||
"custom": "custom widget"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -723,6 +722,7 @@
|
||||
"behavior": "Behavior",
|
||||
"brightness": "Brightness",
|
||||
"built-in": "Built-in",
|
||||
"capsules": "Capsules",
|
||||
"clipboard": "Clipboard",
|
||||
"community": "Community",
|
||||
"control-center": "Control Center:",
|
||||
|
||||
@@ -1711,8 +1711,10 @@ namespace settings {
|
||||
}
|
||||
item->addChild(std::move(itemTop));
|
||||
|
||||
item->addChild(makeLabel(info.detail, Style::fontSizeCaption * ctx.scale,
|
||||
colorSpecFromRole(ColorRole::OnSurfaceVariant), false));
|
||||
if (info.kind != WidgetReferenceKind::BuiltIn && !info.detail.empty()) {
|
||||
item->addChild(makeLabel(info.detail, Style::fontSizeCaption * ctx.scale,
|
||||
colorSpecFromRole(ColorRole::OnSurfaceVariant), false));
|
||||
}
|
||||
if (!capsuleGroup.empty()) {
|
||||
auto groupRow = std::make_unique<Flex>();
|
||||
groupRow->setDirection(FlexDirection::Horizontal);
|
||||
|
||||
@@ -926,35 +926,35 @@ namespace settings {
|
||||
entries.push_back(makeEntry(section, "effects", tr("settings.schema.shared.contact-shadow.label"),
|
||||
tr("settings.schema.bar.contact-shadow.description"), path("contact_shadow"),
|
||||
ToggleSetting{selectedBar->contactShadow}, "shadow contact panel attached"));
|
||||
entries.push_back(makeEntry(section, "widgets", tr("settings.schema.bar.widget-capsules.label"),
|
||||
tr("settings.schema.bar.widget-capsules.description"), path("capsule"),
|
||||
ToggleSetting{selectedBar->widgetCapsuleDefault}, "pill"));
|
||||
entries.push_back(makeEntry(section, "widgets", tr("settings.schema.bar.widget-color.label"),
|
||||
tr("settings.schema.bar.widget-color.description"), path("color"),
|
||||
optionalColorRolePicker(selectedBar->widgetColor), "color role foreground", true));
|
||||
entries.push_back(makeEntry(section, "grouping", tr("settings.schema.bar.capsule-groups.label"),
|
||||
tr("settings.schema.bar.capsule-groups.description"), path("capsule_groups"),
|
||||
ListSetting{.items = selectedBar->widgetCapsuleGroups}, "grouped capsules"));
|
||||
entries.push_back(makeEntry(section, "widgets", tr("settings.schema.bar.capsule-fill.label"),
|
||||
tr("settings.schema.bar.capsule-fill.description"), path("capsule_fill"),
|
||||
colorRolePicker(selectedBar->widgetCapsuleFill), "color role pill", true));
|
||||
entries.push_back(makeEntry(section, "widgets", tr("settings.schema.bar.capsule-foreground.label"),
|
||||
tr("settings.schema.bar.capsule-foreground.description"), path("capsule_foreground"),
|
||||
optionalColorRolePicker(selectedBar->widgetCapsuleForeground),
|
||||
"color role foreground pill", true));
|
||||
entries.push_back(makeEntry(section, "widgets", tr("settings.schema.bar.capsule-border.label"),
|
||||
tr("settings.schema.bar.capsule-border.description"), path("capsule_border"),
|
||||
capsuleBorderRolePicker(selectedBar->widgetCapsuleBorder), "color role pill outline",
|
||||
true));
|
||||
entries.push_back(
|
||||
makeEntry(section, "widgets", tr("settings.schema.bar.widget-spacing.label"),
|
||||
tr("settings.schema.bar.widget-spacing.description"), path("widget_spacing"),
|
||||
SliderSetting{static_cast<float>(selectedBar->widgetSpacing), 0.0f, 32.0f, 1.0f, true}, "gap"));
|
||||
entries.push_back(makeEntry(section, "widgets", tr("settings.schema.bar.capsule-padding.label"),
|
||||
entries.push_back(makeEntry(section, "widgets", tr("settings.schema.bar.widget-color.label"),
|
||||
tr("settings.schema.bar.widget-color.description"), path("color"),
|
||||
optionalColorRolePicker(selectedBar->widgetColor), "color role foreground", true));
|
||||
entries.push_back(makeEntry(section, "capsules", tr("settings.schema.bar.widget-capsules.label"),
|
||||
tr("settings.schema.bar.widget-capsules.description"), path("capsule"),
|
||||
ToggleSetting{selectedBar->widgetCapsuleDefault}, "pill"));
|
||||
entries.push_back(makeEntry(section, "capsules", tr("settings.schema.bar.capsule-groups.label"),
|
||||
tr("settings.schema.bar.capsule-groups.description"), path("capsule_groups"),
|
||||
ListSetting{.items = selectedBar->widgetCapsuleGroups}, "grouped capsules"));
|
||||
entries.push_back(makeEntry(section, "capsules", tr("settings.schema.bar.capsule-fill.label"),
|
||||
tr("settings.schema.bar.capsule-fill.description"), path("capsule_fill"),
|
||||
colorRolePicker(selectedBar->widgetCapsuleFill), "color role pill", true));
|
||||
entries.push_back(makeEntry(section, "capsules", tr("settings.schema.bar.capsule-foreground.label"),
|
||||
tr("settings.schema.bar.capsule-foreground.description"), path("capsule_foreground"),
|
||||
optionalColorRolePicker(selectedBar->widgetCapsuleForeground),
|
||||
"color role foreground pill", true));
|
||||
entries.push_back(makeEntry(section, "capsules", tr("settings.schema.bar.capsule-border.label"),
|
||||
tr("settings.schema.bar.capsule-border.description"), path("capsule_border"),
|
||||
capsuleBorderRolePicker(selectedBar->widgetCapsuleBorder), "color role pill outline",
|
||||
true));
|
||||
entries.push_back(makeEntry(section, "capsules", tr("settings.schema.bar.capsule-padding.label"),
|
||||
tr("settings.schema.bar.capsule-padding.description"), path("capsule_padding"),
|
||||
SliderSetting{selectedBar->widgetCapsulePadding, 0.0f, 48.0f, 1.0f, false},
|
||||
"pill inset", true));
|
||||
entries.push_back(makeEntry(section, "widgets", tr("settings.schema.bar.capsule-opacity.label"),
|
||||
entries.push_back(makeEntry(section, "capsules", tr("settings.schema.bar.capsule-opacity.label"),
|
||||
tr("settings.schema.bar.capsule-opacity.description"), path("capsule_opacity"),
|
||||
SliderSetting{selectedBar->widgetCapsuleOpacity, 0.0f, 1.0f, 0.01f, false},
|
||||
"pill alpha", true));
|
||||
@@ -1057,41 +1057,41 @@ namespace settings {
|
||||
tr("settings.schema.bar.widget-spacing.description"), mpath("widget_spacing"),
|
||||
SliderSetting{static_cast<float>(ovr.widgetSpacing.value_or(bar.widgetSpacing)), 0.0f, 32.0f, 1.0f, true},
|
||||
"gap"));
|
||||
entries.push_back(makeEntry(section, "widgets", tr("settings.schema.bar.widget-capsules.label"),
|
||||
tr("settings.schema.bar.widget-capsules.description"), mpath("capsule"),
|
||||
ToggleSetting{ovr.widgetCapsuleDefault.value_or(bar.widgetCapsuleDefault)}, "pill"));
|
||||
entries.push_back(
|
||||
makeEntry(section, "widgets", tr("settings.schema.bar.widget-color.label"),
|
||||
tr("settings.schema.bar.widget-color.description"), mpath("color"),
|
||||
optionalColorRolePicker(ovr.widgetColor.has_value() ? ovr.widgetColor : bar.widgetColor),
|
||||
"color role foreground", true));
|
||||
entries.push_back(makeEntry(section, "widgets", tr("settings.schema.bar.capsule-fill.label"),
|
||||
entries.push_back(makeEntry(section, "capsules", tr("settings.schema.bar.widget-capsules.label"),
|
||||
tr("settings.schema.bar.widget-capsules.description"), mpath("capsule"),
|
||||
ToggleSetting{ovr.widgetCapsuleDefault.value_or(bar.widgetCapsuleDefault)}, "pill"));
|
||||
entries.push_back(makeEntry(section, "capsules", tr("settings.schema.bar.capsule-groups.label"),
|
||||
tr("settings.schema.bar.capsule-groups.description"), mpath("capsule_groups"),
|
||||
ListSetting{.items = ovr.widgetCapsuleGroups.value_or(bar.widgetCapsuleGroups)},
|
||||
"grouped capsules"));
|
||||
entries.push_back(makeEntry(section, "capsules", tr("settings.schema.bar.capsule-fill.label"),
|
||||
tr("settings.schema.bar.capsule-fill.description"), mpath("capsule_fill"),
|
||||
colorRolePicker(ovr.widgetCapsuleFill.value_or(bar.widgetCapsuleFill)),
|
||||
"color role pill", true));
|
||||
entries.push_back(
|
||||
makeEntry(section, "widgets", tr("settings.schema.bar.capsule-foreground.label"),
|
||||
makeEntry(section, "capsules", tr("settings.schema.bar.capsule-foreground.label"),
|
||||
tr("settings.schema.bar.capsule-foreground.description"), mpath("capsule_foreground"),
|
||||
optionalColorRolePicker(ovr.widgetCapsuleForeground.has_value() ? ovr.widgetCapsuleForeground
|
||||
: bar.widgetCapsuleForeground),
|
||||
"color role foreground pill", true));
|
||||
entries.push_back(makeEntry(
|
||||
section, "widgets", tr("settings.schema.bar.capsule-border.label"),
|
||||
section, "capsules", tr("settings.schema.bar.capsule-border.label"),
|
||||
tr("settings.schema.bar.capsule-border.description"), mpath("capsule_border"),
|
||||
capsuleBorderRolePicker(ovr.widgetCapsuleBorderSpecified ? ovr.widgetCapsuleBorder : bar.widgetCapsuleBorder),
|
||||
"color role pill outline", true));
|
||||
entries.push_back(makeEntry(section, "grouping", tr("settings.schema.bar.capsule-groups.label"),
|
||||
tr("settings.schema.bar.capsule-groups.description"), mpath("capsule_groups"),
|
||||
ListSetting{.items = ovr.widgetCapsuleGroups.value_or(bar.widgetCapsuleGroups)},
|
||||
"grouped capsules"));
|
||||
entries.push_back(
|
||||
makeEntry(section, "widgets", tr("settings.schema.bar.capsule-padding.label"),
|
||||
makeEntry(section, "capsules", tr("settings.schema.bar.capsule-padding.label"),
|
||||
tr("settings.schema.bar.capsule-padding.description"), mpath("capsule_padding"),
|
||||
SliderSetting{static_cast<float>(ovr.widgetCapsulePadding.value_or(bar.widgetCapsulePadding)), 0.0f,
|
||||
48.0f, 1.0f, false},
|
||||
"pill inset", true));
|
||||
entries.push_back(
|
||||
makeEntry(section, "widgets", tr("settings.schema.bar.capsule-opacity.label"),
|
||||
makeEntry(section, "capsules", tr("settings.schema.bar.capsule-opacity.label"),
|
||||
tr("settings.schema.bar.capsule-opacity.description"), mpath("capsule_opacity"),
|
||||
SliderSetting{static_cast<float>(ovr.widgetCapsuleOpacity.value_or(bar.widgetCapsuleOpacity)), 0.0f,
|
||||
1.0f, 0.01f, false},
|
||||
|
||||
@@ -324,7 +324,7 @@ namespace settings {
|
||||
it != cfg.widgets.end() && !it->second.type.empty() && it->second.type != name) {
|
||||
return WidgetReferenceInfo{
|
||||
.title = std::string(name),
|
||||
.detail = tr("settings.entities.widget.detail.type", "type", it->second.type),
|
||||
.detail = it->second.type,
|
||||
.badge = tr("settings.entities.widget.kinds.named"),
|
||||
.kind = WidgetReferenceKind::Named,
|
||||
};
|
||||
@@ -340,8 +340,7 @@ namespace settings {
|
||||
if (const auto it = cfg.widgets.find(std::string(name)); it != cfg.widgets.end()) {
|
||||
return WidgetReferenceInfo{
|
||||
.title = widgetInstanceDisplayLabel(name),
|
||||
.detail = it->second.type.empty() ? tr("settings.entities.widget.detail.custom")
|
||||
: tr("settings.entities.widget.detail.type", "type", it->second.type),
|
||||
.detail = it->second.type.empty() ? tr("settings.entities.widget.detail.custom") : it->second.type,
|
||||
.badge = tr("settings.entities.widget.kinds.named"),
|
||||
.kind = WidgetReferenceKind::Named,
|
||||
};
|
||||
@@ -372,8 +371,7 @@ namespace settings {
|
||||
continue;
|
||||
}
|
||||
addPickerEntry(entries, seen, name, widgetInstanceDisplayLabel(name),
|
||||
widget.type.empty() ? tr("settings.entities.widget.detail.custom")
|
||||
: tr("settings.entities.widget.detail.type", "type", widget.type),
|
||||
widget.type.empty() ? tr("settings.entities.widget.detail.custom") : widget.type,
|
||||
tr("settings.entities.widget.kinds.named"), WidgetReferenceKind::Named);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user