settings: add + item name on every creation fab

settings: stop repeating the page title as the first card label
translations: index untitled cards by their page, not a nested row

fixes #3604
fixes #3609
This commit is contained in:
bbedward committed 2026-09-28 14:38:43 -04:00
1 parent 4ca4e2586e
commit 1142390724
18 files changed
+302 -502

No files matched your search

+1 -1
View File
@@ -428,7 +428,7 @@ Singleton {
{
"id": "user_create",
"hidden": true,
"text": I18n.tr("Create user"),
"text": I18n.tr("Add user"),
"icon": "person_add",
"tabIndex": 61
}
-1
View File
@@ -422,7 +422,6 @@ Item {
SettingsCard {
width: parent.width
iconName: "info"
title: I18n.tr("About")
SettingsRow {
body: StyledText {
@@ -62,7 +62,6 @@ Item {
SettingsCard {
width: parent.width
iconName: "person_add"
title: I18n.tr("Create user")
settingKey: "createUser"
visible: PolkitService.polkitAvailable
@@ -179,7 +178,7 @@ Item {
spacing: Theme.spacingM
DankButton {
text: root.operationPending ? I18n.tr("Working...", "create user button text while the operation runs") : I18n.tr("Create user")
text: root.operationPending ? I18n.tr("Working...", "create user button text while the operation runs") : I18n.tr("Add user")
iconName: "person_add"
backgroundColor: Theme.primary
textColor: Theme.primaryText
+1 -2
View File
@@ -12,7 +12,6 @@ Item {
readonly property var paletteValues: ["default", "bright", "dim"]
readonly property IslandSettingsStore dot: IslandSettingsStore {
barId: SettingsData.dotBarConfig?.id ?? ""
}
@@ -22,7 +21,7 @@ Item {
settingKey: "dotSize"
tags: ["dot", "dankdot", "size", "diameter", "idle", "fade"]
iconName: "blur_on"
title: I18n.tr("Dot", "bar layout: free-floating dot that opens island activities")
title: I18n.tr("General")
SettingsSliderRow {
settingKey: "islandFreeSize"
@@ -148,7 +148,6 @@ Item {
width: parent.width
visible: dock.hasConfig
iconName: "widgets"
title: I18n.tr("Apps & widgets")
settingKey: "dockWidgets"
tags: ["dock", "widgets", "apps", "add", "remove", "order"]
@@ -65,7 +65,6 @@ Item {
SettingsCard {
width: parent.width
iconName: "fingerprint"
title: I18n.tr("Authentication")
settingKey: "greeterAuth"
SettingsToggleRow {
@@ -83,7 +83,7 @@ DankDialog {
opened: false
maximumWidth: SettingsMetrics.formDialogWidth
surfaceColor: Theme.hostSurface
title: isNew ? I18n.tr("New shortcut") : I18n.tr("Edit shortcut", "keybind editor dialog title")
title: isNew ? I18n.tr("Add shortcut") : I18n.tr("Edit shortcut", "keybind editor dialog title")
closeEnabled: !busy
acceptEnabled: canSubmit
onAccepted: save()
+1 -1
View File
@@ -785,7 +785,7 @@ Item {
shown: !KeybindsService.readOnly
DankFab {
text: I18n.tr("New shortcut")
text: I18n.tr("Add shortcut")
iconName: "add"
onClicked: keybindsTab.openNewEditor()
}
@@ -457,7 +457,7 @@ Item {
shown: DMSNetworkService.vpnAvailable
DankFab {
text: I18n.tr("Import")
text: I18n.tr("Import VPN")
iconName: "add"
busy: VPNService.importing
enabled: !VPNService.importing
@@ -115,7 +115,7 @@ Item {
id: notificationRulesCard
width: parent.width
iconName: "rule_settings"
title: I18n.tr("Rules", "noun, notification rules settings section title")
title: I18n.tr("Notification rules")
settingKey: "notificationRules"
tags: ["notification", "rules", "mute", "ignore", "priority", "regex", "history"]
@@ -446,8 +446,8 @@ Item {
SettingsFabBar {
DankFab {
text: I18n.tr("Add rule")
iconName: "add"
Accessible.name: I18n.tr("Add")
onClicked: SettingsData.addNotificationRule()
}
}
@@ -18,7 +18,6 @@ Item {
SettingsCard {
width: parent.width
iconName: "colorize"
title: I18n.tr("Injected palettes")
settingKey: "paletteInject"
tags: ["palette", "matugen", "inject", "namespace", "command", "template", "color"]
visible: Theme.matugenAvailable
@@ -176,8 +175,8 @@ Item {
shown: Theme.matugenAvailable
DankFab {
text: I18n.tr("Add palette")
iconName: "add"
Accessible.name: I18n.tr("Add")
onClicked: PaletteInjectService.addPalette()
}
}
+1 -1
View File
@@ -422,7 +422,7 @@ Item {
SettingsCard {
width: parent.width
iconName: "print"
title: I18n.tr("Printers")
title: I18n.tr("Installed")
visible: CupsService.cupsAvailable
headerActions: [
@@ -73,8 +73,8 @@ Item {
SettingsFabBar {
DankFab {
text: I18n.tr("Add substitution")
iconName: "add"
Accessible.name: I18n.tr("Add")
onClicked: SettingsData.addAppIdSubstitution("", "", "exact")
}
}
+1 -1
View File
@@ -190,7 +190,7 @@ Item {
shown: PolkitService.polkitAvailable
DankFab {
text: I18n.tr("Create user")
text: I18n.tr("Add user")
iconName: "person_add"
onClicked: root.parentModal?.navigateTo("user_create")
}
@@ -19,7 +19,7 @@ Item {
SettingsPage {
SettingsCard {
title: I18n.tr("Weather")
title: I18n.tr("General")
tab: "weather"
settingKey: "weather"
@@ -305,7 +305,6 @@ Item {
id: headerSection
width: parent.width
iconName: "select_window"
title: I18n.tr("Window rules")
SettingsRow {
subtitle: I18n.tr("Define rules for window behavior. Saves to %1", "window rules settings description, %1 is a config file name").arg(root.dmsRulesFileName)
@@ -318,6 +318,26 @@ def extract_property(block, prop_name):
return None
def own_scope(block):
"""The block with every nested component body removed, so a card without a title does not borrow one from its rows."""
depth = 0
kept = []
for char in block:
if char == "{":
depth += 1
if depth <= 1:
kept.append(char)
continue
if char == "}":
depth -= 1
if depth <= 0:
kept.append(char)
continue
if depth <= 1:
kept.append(char)
return "".join(kept)
def load_wrapper_components(root_dir):
widgets_dir = Path(root_dir) / "Modules" / "Settings" / "Widgets"
wrappers = {}
@@ -400,13 +420,17 @@ def find_settings_components(content, filename, wrappers, tab_meta, hub_meta):
tab_index = file_tab_index
title_raw = extract_property(block, "title") or defaults.get("title")
text_raw = extract_property(block, "text") or defaults.get("text")
own = own_scope(block)
title_raw = extract_property(own, "title") or defaults.get("title")
text_raw = extract_property(own, "text") or defaults.get("text")
label = None
if title_raw:
label = extract_i18n_string(title_raw)
if not label and text_raw:
label = extract_i18n_string(text_raw)
if not label and component == "SettingsCard":
page_label = hub_meta.get(file_page) if file_page else tab_meta.get(file_tab_index, TAB_META_DEFAULT)
label = page_label[0]
if not label:
continue
File diff suppressed because it is too large. Load diff