No forgetting, deleting or clearing on a single press, anywhere
Claude-Session: https://claude.ai/code/session_01Ms2FbjQy31TVf3CEvQhGM8
This commit is contained in:
@@ -15,11 +15,16 @@ SettingRow {
|
||||
readonly property bool custom: ThemeProfiles.activeProfile.shipped !== true
|
||||
|
||||
label: "Save as"
|
||||
detail: root.custom
|
||||
? "Saving again under a new name keeps both"
|
||||
: "Editing a shipped theme forks it; give the fork a name to keep it"
|
||||
// Armed, the row says what the delete actually costs: a saved theme is the
|
||||
// only copy of its palette, terminal colours and effect values.
|
||||
detail: deleteConfirm.armed
|
||||
? "Deletes “" + String(ThemeProfiles.activeProfile.name ?? "this theme")
|
||||
+ "” — its palette, terminal colours and effects go with it"
|
||||
: (root.custom
|
||||
? "Saving again under a new name keeps both"
|
||||
: "Editing a shipped theme forks it; give the fork a name to keep it")
|
||||
divider: false
|
||||
controlWidth: root.custom ? 380 : 292
|
||||
controlWidth: root.custom ? (deleteConfirm.armed ? 470 : 380) : 292
|
||||
|
||||
Row {
|
||||
anchors.right: parent.right
|
||||
@@ -83,23 +88,14 @@ SettingRow {
|
||||
Keys.onSpacePressed: saveButton.save()
|
||||
}
|
||||
|
||||
SettingsButton {
|
||||
id: deleteButton
|
||||
ConfirmAction {
|
||||
id: deleteConfirm
|
||||
|
||||
visible: root.custom
|
||||
text: "Delete"
|
||||
tone: "danger"
|
||||
activeFocusOnTab: visible
|
||||
border.width: activeFocus ? 2 : 1
|
||||
border.color: activeFocus ? Theme.danger : Theme.alpha(Theme.danger, 0.45)
|
||||
|
||||
function remove(): void {
|
||||
ThemeProfiles.deleteProfile(ThemeProfiles.activeId);
|
||||
}
|
||||
|
||||
onClicked: deleteButton.remove()
|
||||
Keys.onReturnPressed: deleteButton.remove()
|
||||
Keys.onSpacePressed: deleteButton.remove()
|
||||
actionId: "theme-profile-delete:" + ThemeProfiles.activeId
|
||||
armText: "Delete…"
|
||||
confirmText: "Delete it"
|
||||
onConfirmed: ThemeProfiles.deleteProfile(ThemeProfiles.activeId)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user