Files
qt-creator/share/qtcreator/qmldesigner/edit3dQmlSource/BakeLightsProgressDialog.qml
Miikka Heikkinen 5eeae78fc9 QmlDesigner: Allow copying text from bake lights progress dialog
Fixes: QDS-10052
Change-Id: I6ca030f71c76d4153a715d4e74e9a0a6d6a127a2
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Ali Kianian <ali.kianian@qt.io>
2023-06-22 08:05:10 +00:00

106 lines
2.9 KiB
QML

// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0 WITH Qt-GPL-exception-1.0
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtQuickDesignerTheme
import HelperWidgets
import StudioControls as StudioControls
import StudioTheme as StudioTheme
Rectangle {
id: root
color: StudioTheme.Values.themePanelBackground
Connections {
target: rootView
function onProgress(msg) {
progressText.text += progressText.text === "" ? msg : "\n" + msg
scrollView.ensureVisible()
}
function onFinished() {
cancelButton.text = qsTr("Close")
}
}
Column {
id: col
padding: 5
leftPadding: 10
spacing: 5
Text {
id: title
text: qsTr("Baking lights for 3D view: %1").arg(sceneId)
font.bold: true
font.pixelSize: StudioTheme.Values.myFontSize
color: StudioTheme.Values.themeTextColor
}
Rectangle {
id: rect
width: root.width - 16
height: root.height - title.height - cancelButton.height - 20
color: StudioTheme.Values.themePanelBackground
border.color: StudioTheme.Values.themeControlOutline
border.width: StudioTheme.Values.border
ScrollView {
id: scrollView
anchors.fill: parent
anchors.margins: 4
clip: true
Behavior on contentY {
PropertyAnimation {
easing.type: Easing.InOutQuad
}
}
TextEdit {
id: progressText
width: scrollView.width
font.pixelSize: StudioTheme.Values.myFontSize
color: StudioTheme.Values.themeTextColor
readOnly: true
selectByMouse: true
selectByKeyboard: true
}
function ensureVisible()
{
let newPos = scrollView.contentHeight - scrollView.height
scrollView.contentY = newPos < 0 ? 0 : newPos
}
}
}
Row {
spacing: StudioTheme.Values.dialogButtonSpacing
height: cancelButton.height
anchors.right: rect.right
Button {
id: bakeAgainButton
text: qsTr("Bake Again")
anchors.margins: StudioTheme.Values.dialogButtonPadding
onClicked: rootView.rebake()
}
Button {
id: cancelButton
text: qsTr("Cancel")
anchors.margins: StudioTheme.Values.dialogButtonPadding
onClicked: rootView.cancel()
}
}
}
}