Added visualization for unclean undo stack. (No safe guard before closing on an unclean stack yet.)
This commit is contained in:
22
Main.qml
22
Main.qml
@ -1,13 +1,19 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls.Material
|
||||
import QtQuick.Layouts
|
||||
import QtQml.Models
|
||||
|
||||
Window {
|
||||
property bool isDataModified: !appUndoStack.isClean
|
||||
|
||||
property string titleClean: `${Application.name}`
|
||||
property string titleDirty: `${Application.name}` + " *"
|
||||
|
||||
id: window
|
||||
width: 480
|
||||
height: 800
|
||||
visible: true
|
||||
title: `${Application.name}`
|
||||
title: appUndoStack.clean ? titleClean : titleDirty
|
||||
|
||||
property int fontSize: 16
|
||||
|
||||
@ -29,4 +35,18 @@ Window {
|
||||
id: listPage
|
||||
anchors.fill: parent
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
// core.displayStatusMessage.connect(displayStatusMessage)
|
||||
appUndoStack.cleanChanged.connect(cleanChanged)
|
||||
// core.userConfigChanged.connect(onUserConfigChanged)
|
||||
}
|
||||
|
||||
function cleanChanged() {
|
||||
let clean = appUndoStack.clean
|
||||
console.debug("Clean state changed to: " + clean)
|
||||
// if (!clean) {
|
||||
// footerText.text = ""
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user