QmlDesigner: Make material editor toolbar fixed on the view

Task-number: QDS-12850
Change-Id: I230478e175e58180fb462943b3eb936f883fcf52
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
Ali Kianian
2024-05-28 08:55:14 +03:00
parent f752178576
commit 934a15b16e
2 changed files with 48 additions and 42 deletions

View File

@@ -4,8 +4,8 @@
import QtQuick import QtQuick
import HelperWidgets import HelperWidgets
PropertyEditorPane { Item {
id: itemPane id: root
width: 420 width: 420
height: 420 height: 420
@@ -34,46 +34,60 @@ PropertyEditorPane {
topSection.previewModel = model topSection.previewModel = model
} }
MaterialEditorTopSection { MaterialEditorToolBar {
id: topSection id: toolbar
onToolBarAction: (action) => itemPane.toolBarAction(action) width: parent.width
onPreviewEnvChanged: itemPane.previewEnvChanged(previewEnv)
onPreviewModelChanged: itemPane.previewModelChanged(previewModel) onToolBarAction: (action) => root.toolBarAction(action)
} }
Item { width: 1; height: 10 } PropertyEditorPane {
id: itemPane
DynamicPropertiesSection { anchors.top: toolbar.bottom
propertiesModel: MaterialEditorDynamicPropertiesModel {} anchors.bottom: parent.bottom
} width: parent.width
Loader { clip: true
id: specificsTwo
property string theSource: specificQmlData MaterialEditorTopSection {
id: topSection
anchors.left: parent.left onPreviewEnvChanged: root.previewEnvChanged(previewEnv)
anchors.right: parent.right onPreviewModelChanged: root.previewModelChanged(previewModel)
visible: specificsTwo.theSource !== "" }
sourceComponent: specificQmlComponent
onTheSourceChanged: { DynamicPropertiesSection {
specificsTwo.active = false propertiesModel: MaterialEditorDynamicPropertiesModel {}
specificsTwo.active = true }
Loader {
id: specificsTwo
property string theSource: specificQmlData
width: parent.width
visible: specificsTwo.theSource !== ""
sourceComponent: specificQmlComponent
onTheSourceChanged: {
specificsTwo.active = false
specificsTwo.active = true
}
}
Item { // spacer
width: 1
height: 10
visible: specificsTwo.visible
}
Loader {
id: specificsOne
anchors.left: parent.left
anchors.right: parent.right
source: specificsUrl
} }
} }
Item {
width: 1
height: 10
visible: specificsTwo.visible
}
Loader {
id: specificsOne
anchors.left: parent.left
anchors.right: parent.right
source: specificsUrl
}
} }

View File

@@ -11,8 +11,6 @@ import StudioTheme as StudioTheme
Column { Column {
id: root id: root
signal toolBarAction(int action)
property string previewEnv property string previewEnv
property string previewModel property string previewModel
property StudioTheme.ControlStyle buttonStyle: StudioTheme.ViewBarButtonStyle { property StudioTheme.ControlStyle buttonStyle: StudioTheme.ViewBarButtonStyle {
@@ -37,12 +35,6 @@ Column {
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
MaterialEditorToolBar {
width: root.width
onToolBarAction: (action) => root.toolBarAction(action)
}
Item { width: 1; height: 10 } // spacer Item { width: 1; height: 10 } // spacer