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,16 +34,30 @@ PropertyEditorPane {
topSection.previewModel = model topSection.previewModel = model
} }
MaterialEditorToolBar {
id: toolbar
width: parent.width
onToolBarAction: (action) => root.toolBarAction(action)
}
PropertyEditorPane {
id: itemPane
anchors.top: toolbar.bottom
anchors.bottom: parent.bottom
width: parent.width
clip: true
MaterialEditorTopSection { MaterialEditorTopSection {
id: topSection id: topSection
onToolBarAction: (action) => itemPane.toolBarAction(action) onPreviewEnvChanged: root.previewEnvChanged(previewEnv)
onPreviewEnvChanged: itemPane.previewEnvChanged(previewEnv) onPreviewModelChanged: root.previewModelChanged(previewModel)
onPreviewModelChanged: itemPane.previewModelChanged(previewModel)
} }
Item { width: 1; height: 10 }
DynamicPropertiesSection { DynamicPropertiesSection {
propertiesModel: MaterialEditorDynamicPropertiesModel {} propertiesModel: MaterialEditorDynamicPropertiesModel {}
} }
@@ -53,8 +67,7 @@ PropertyEditorPane {
property string theSource: specificQmlData property string theSource: specificQmlData
anchors.left: parent.left width: parent.width
anchors.right: parent.right
visible: specificsTwo.theSource !== "" visible: specificsTwo.theSource !== ""
sourceComponent: specificQmlComponent sourceComponent: specificQmlComponent
@@ -64,7 +77,7 @@ PropertyEditorPane {
} }
} }
Item { Item { // spacer
width: 1 width: 1
height: 10 height: 10
visible: specificsTwo.visible visible: specificsTwo.visible
@@ -77,3 +90,4 @@ PropertyEditorPane {
source: specificsUrl 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