Panel.qml keeps the state, the CLI calls and the stage switch (889 lines, was 2360); each stage is its own file taking the panel as a required property. The omarchy installer copies every QML/JS file and clears stale ones. tests/static.sh filters qmllint on [syntax], not the word error. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
76 lines
2.2 KiB
QML
76 lines
2.2 KiB
QML
import QtQuick
|
|
import qs.Commons
|
|
import qs.Ui
|
|
|
|
// RenameStage.qml - Rename: the file moves, and state.json follows if it is in use.
|
|
//
|
|
// One stage of the claude-mode panel. Panel.qml hands itself in as `panel`
|
|
// and owns all the state and actions; this file only draws them.
|
|
Column {
|
|
id: stage
|
|
required property var panel
|
|
|
|
width: parent.width
|
|
visible: stage.panel.stage === "presetRename"
|
|
spacing: Style.space(7)
|
|
|
|
Text {
|
|
width: parent.width
|
|
text: "Rename '" + stage.panel.editPreset + "'"
|
|
color: Color.popups.text
|
|
elide: Text.ElideRight
|
|
font.family: stage.panel.uiFont
|
|
font.pixelSize: Style.space(13)
|
|
font.bold: true
|
|
}
|
|
|
|
TextField {
|
|
id: renameField
|
|
width: parent.width
|
|
text: stage.panel.renameTo
|
|
placeholderText: "new name"
|
|
foreground: Color.popups.text
|
|
font.family: stage.panel.uiFont
|
|
font.pixelSize: Style.space(11)
|
|
onTextChanged: stage.panel.renameTo = text
|
|
onAccepted: stage.panel.renamePreset()
|
|
}
|
|
|
|
Text {
|
|
width: parent.width
|
|
readonly property string problem: stage.panel.stage === "presetRename" ? stage.panel.nameProblem(stage.panel.renameTo, stage.panel.editPreset) : ""
|
|
visible: problem !== ""
|
|
text: problem
|
|
color: stage.panel.urgentColor
|
|
wrapMode: Text.WordWrap
|
|
font.family: stage.panel.uiFont
|
|
font.pixelSize: Style.space(10)
|
|
}
|
|
|
|
Text {
|
|
width: parent.width
|
|
visible: stage.panel.editIsActive
|
|
text: "It is the preset in use. The switch follows the new name, and running sessions keep working."
|
|
color: Color.muted
|
|
wrapMode: Text.WordWrap
|
|
font.family: stage.panel.uiFont
|
|
font.pixelSize: Style.space(10)
|
|
}
|
|
|
|
Flow {
|
|
width: parent.width
|
|
spacing: Style.space(7)
|
|
|
|
PillButton { fontFamily: stage.panel.uiFont; label: "Rename"; primary: true; onTriggered: stage.panel.renamePreset() }
|
|
PillButton { fontFamily: stage.panel.uiFont; label: "Back"; onTriggered: { stage.panel.lastError = ""; stage.panel.stage = "preset" } }
|
|
}
|
|
|
|
Connections {
|
|
target: stage.panel
|
|
function onRenameOpened() {
|
|
renameField.text = stage.panel.renameTo
|
|
Qt.callLater(function () { renameField.forceActiveFocus(); renameField.selectAll() })
|
|
}
|
|
}
|
|
}
|