diff options
author | Thomas Hartmann <thomas.hartmann@qt.io> | 2024-04-11 16:00:51 +0200 |
---|---|---|
committer | Thomas Hartmann <thomas.hartmann@qt.io> | 2024-04-16 11:59:38 +0000 |
commit | b5aac705ea7aa68fce74dd452c2b7c1b5eb0b5f0 (patch) | |
tree | 9df7c35ce286535c74c77cd99179426b5b08b7e6 /share/qtcreator | |
parent | 3f597a5935b49115a6969d65b340359691e611a4 (diff) |
QmlDesigner: Indicate if a file is modified
Task-number: QDS-12361
Change-Id: I7a6c5f112b0f193f5bb975a331e2f0d44d19ddc2
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
Diffstat (limited to 'share/qtcreator')
-rw-r--r-- | share/qtcreator/qmldesigner/toolbar/Main.qml | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/share/qtcreator/qmldesigner/toolbar/Main.qml b/share/qtcreator/qmldesigner/toolbar/Main.qml index 7235028df6..88a9bd744a 100644 --- a/share/qtcreator/qmldesigner/toolbar/Main.qml +++ b/share/qtcreator/qmldesigner/toolbar/Main.qml @@ -190,6 +190,26 @@ Rectangle { onActivated: backend.openFileByIndex(index) } + Text { + parent:currentFile.contentItem + visible: backend.isDocumentDirty + + anchors.right: parent.right + anchors.rightMargin: parent.width - metric.textWidth - 18 + color: StudioTheme.Values.themeTextColor + text: StudioTheme.Constants.wildcard + font.family: StudioTheme.Constants.iconFont.family + font.pixelSize: StudioTheme.Values.smallIconFont + anchors.verticalCenter: parent.verticalCenter + anchors.verticalCenterOffset: -4 + + FontMetrics { + id: metric + font: currentFile.font + property int textWidth: metric.boundingRect(currentFile.currentText).width + } + } + ToolbarButton { id: backButton anchors.verticalCenter: parent.verticalCenter |