aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/modules/companion/PhrasesPage.qml
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-23 20:18:24 +0200
committerDanilo M. <danix@danix.xyz>2026-10-23 20:18:24 +0200
commitb7382da9d2e84dbd1ee29b0be6ffbd595b94c415 (patch)
tree4d4b20e27a6f00b2e687013132edfd7bd7e22586 /desktop/modules/companion/PhrasesPage.qml
parentec4d2a77def6809ebb2e4f8dac461e97b8a8695c (diff)
downloadquickshell-b7382da9d2e84dbd1ee29b0be6ffbd595b94c415.tar.gz
quickshell-b7382da9d2e84dbd1ee29b0be6ffbd595b94c415.zip
companion: artist lines page
PhrasesPage takes its intro, key hint, add-button text and saved set, so the artist set reuses it rather than a copy that would drift. Reset's enabled state read Prefs.companionApps directly and would have tracked the wrong set. ArtistsModule mirrors PhrasesModule on Prefs.companionArtists and Lines.artists. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'desktop/modules/companion/PhrasesPage.qml')
-rw-r--r--desktop/modules/companion/PhrasesPage.qml19
1 files changed, 13 insertions, 6 deletions
diff --git a/desktop/modules/companion/PhrasesPage.qml b/desktop/modules/companion/PhrasesPage.qml
index 67c1e03..1971171 100644
--- a/desktop/modules/companion/PhrasesPage.qml
+++ b/desktop/modules/companion/PhrasesPage.qml
@@ -23,6 +23,15 @@ Column {
// The module, holding the draft. Not named pm, its id (it would bind to
// itself, AGENTS.md).
required property QtObject owner
+ // What the cards are keyed by; the defaults are the app set's, so
+ // PhrasesModule passes nothing.
+ property string intro: "When focus moves to a program she recognizes, she says one of its lines at random, a third "
+ + "of the time and under her 30 s line cooldown. The class is Hyprland's window class, "
+ + "lowercased (hyprctl activewindow shows it). Save applies at once."
+ property string keyHint: "window class, e.g. firefox"
+ property string addText: "Add app"
+ // The saved set, for Reset's enabled state; null means the defaults.
+ property var saved: Prefs.companionApps
readonly property var list: owner.shown
// The app card awaiting a second click on Remove.
property int confirming: -1
@@ -98,9 +107,7 @@ Column {
Small {
width: page.width
wrapMode: Text.Wrap
- text: "When focus moves to a program she recognizes, she says one of its lines at random, a third "
- + "of the time and under her 30 s line cooldown. The class is Hyprland's window class, "
- + "lowercased (hyprctl activewindow shows it). Save applies at once."
+ text: page.intro
}
Repeater {
@@ -129,7 +136,7 @@ Column {
Field {
anchors { left: parent.left; right: del.left; rightMargin: 8; top: parent.top; bottom: parent.bottom }
value: card.modelData.cls
- placeholder: "window class, e.g. firefox"
+ placeholder: page.keyHint
onEdited: t => page.setCls(card.index, t)
}
Button {
@@ -177,11 +184,11 @@ Column {
Row {
spacing: 8
- Button { text: "Add app"; onClicked: page.addApp() }
+ Button { text: page.addText; onClicked: page.addApp() }
Button {
text: "Reset to defaults"
danger: true
- enabled: !page.owner.resetting && (Prefs.companionApps !== null || page.owner.dirty)
+ enabled: !page.owner.resetting && (page.saved !== null || page.owner.dirty)
onClicked: page.owner.reset()
}
}