settings: fix the dot behavior card shadowing its own store

This commit is contained in:
purian23 committed 2026-10-05 02:47:03 -04:00
1 parent dfa19b9237
commit 74628450fc
3 files changed
+6 -6

No files matched your search

+1 -1
View File
@@ -177,7 +177,7 @@ Item {
store: dot
keyPrefix: "dot"
docked: false
dot: true
isDot: true
}
IslandNotificationsCard {
@@ -10,7 +10,7 @@ SettingsCard {
property bool hosted: false
property bool docked: true
// A dot's compact face is a circle, so it never shows the media face.
property bool dot: false
property bool isDot: false
readonly property var routingValues: ["normal", "always", "last-used"]
readonly property var interactionModeValues: ["click", "hybrid"]
@@ -169,7 +169,7 @@ SettingsCard {
SettingsToggleRow {
settingKey: root.keyPrefix + "MediaClockVisible"
tags: ["island", "media", "clock", "compact", "time"]
visible: !root.dot
visible: !root.isDot
resetStore: root.store
resetKeys: ["islandMediaClockVisible"]
text: I18n.tr("Keep clock with media", "island settings: clock in media face toggle")
@@ -369,12 +369,12 @@ SHARED_CARD_ROW_PATTERN = re.compile(r"\b(?:Settings\w*Row|Loader)\s*\{")
def strip_hidden_rows(card_content, hosted, docked, dot):
"""Drop rows the instance hides for good: `visible: !root.hosted` on a hosted page, `visible: root.docked` on an undocked one, `visible: !root.dot` on the dot."""
"""Drop rows the instance hides for good: `visible: !root.hosted` on a hosted page, `visible: root.docked` on an undocked one, `visible: !root.isDot` on the dot."""
result = card_content
for match in reversed(list(SHARED_CARD_ROW_PATTERN.finditer(card_content))):
block = parse_component_block(card_content, match.start(), "")
visible = extract_property(block, "visible") or ""
if (hosted and "!root.hosted" in visible) or (not docked and "root.docked" in visible) or (dot and "!root.dot" in visible):
if (hosted and "!root.hosted" in visible) or (not docked and "root.docked" in visible) or (dot and "!root.isDot" in visible):
result = result[: match.start()] + result[match.start() + len(block):]
return result
@@ -391,7 +391,7 @@ def inline_shared_cards(root_dir, content):
prefix = prefix_match.group(1) if prefix_match else "island"
hosted = "hosted: true" in instance
docked = "docked: false" not in instance
dot = "dot: true" in instance
dot = "isDot: true" in instance
card = strip_hidden_rows(card_file.read_text(encoding="utf-8"), hosted, docked, dot)
content += "\n" + card.replace('settingKey: root.keyPrefix + "', f'settingKey: "{prefix}')
return content