aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/modules/companion/PhrasesPage.qml
diff options
context:
space:
mode:
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()
}
}