2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2022 The Qt Company Ltd.
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
2022-03-18 17:28:28 +02:00
|
|
|
|
|
|
|
|
import QtQuick 2.15
|
|
|
|
|
import QtQuickDesignerTheme 1.0
|
|
|
|
|
import HelperWidgets 2.0
|
|
|
|
|
import StudioTheme 1.0 as StudioTheme
|
2022-11-21 21:10:49 +02:00
|
|
|
import MaterialToolBarAction 1.0
|
2022-03-18 17:28:28 +02:00
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
|
id: root
|
|
|
|
|
|
|
|
|
|
color: StudioTheme.Values.themeSectionHeadBackground
|
|
|
|
|
width: row.width
|
|
|
|
|
height: 40
|
|
|
|
|
|
|
|
|
|
signal toolBarAction(int action)
|
|
|
|
|
|
|
|
|
|
Row {
|
|
|
|
|
id: row
|
|
|
|
|
|
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
|
leftPadding: 6
|
|
|
|
|
|
|
|
|
|
IconButton {
|
|
|
|
|
icon: StudioTheme.Constants.applyMaterialToSelected
|
|
|
|
|
|
2022-08-16 21:19:41 +03:00
|
|
|
normalColor: StudioTheme.Values.themeSectionHeadBackground
|
2022-03-18 17:28:28 +02:00
|
|
|
iconSize: StudioTheme.Values.bigIconFontSize
|
|
|
|
|
buttonSize: root.height
|
2022-11-17 17:52:26 +02:00
|
|
|
enabled: hasMaterial && hasModelSelection && hasQuick3DImport && hasMaterialLibrary
|
2022-03-18 17:28:28 +02:00
|
|
|
onClicked: root.toolBarAction(ToolBarAction.ApplyToSelected)
|
|
|
|
|
tooltip: qsTr("Apply material to selected model.")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
IconButton {
|
|
|
|
|
icon: StudioTheme.Constants.newMaterial
|
|
|
|
|
|
2022-08-16 21:19:41 +03:00
|
|
|
normalColor: StudioTheme.Values.themeSectionHeadBackground
|
2022-03-18 17:28:28 +02:00
|
|
|
iconSize: StudioTheme.Values.bigIconFontSize
|
|
|
|
|
buttonSize: root.height
|
2022-11-17 17:52:26 +02:00
|
|
|
enabled: hasQuick3DImport && hasMaterialLibrary
|
2022-03-18 17:28:28 +02:00
|
|
|
onClicked: root.toolBarAction(ToolBarAction.AddNewMaterial)
|
2022-06-22 12:48:25 +03:00
|
|
|
tooltip: qsTr("Create new material.")
|
2022-03-18 17:28:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
IconButton {
|
|
|
|
|
icon: StudioTheme.Constants.deleteMaterial
|
|
|
|
|
|
2022-08-16 21:19:41 +03:00
|
|
|
normalColor: StudioTheme.Values.themeSectionHeadBackground
|
2022-03-18 17:28:28 +02:00
|
|
|
iconSize: StudioTheme.Values.bigIconFontSize
|
|
|
|
|
buttonSize: root.height
|
2022-11-17 17:52:26 +02:00
|
|
|
enabled: hasMaterial && hasQuick3DImport && hasMaterialLibrary
|
2022-03-18 17:28:28 +02:00
|
|
|
onClicked: root.toolBarAction(ToolBarAction.DeleteCurrentMaterial)
|
|
|
|
|
tooltip: qsTr("Delete current material.")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
IconButton {
|
|
|
|
|
icon: StudioTheme.Constants.openMaterialBrowser
|
|
|
|
|
|
2022-08-16 21:19:41 +03:00
|
|
|
normalColor: StudioTheme.Values.themeSectionHeadBackground
|
2022-03-18 17:28:28 +02:00
|
|
|
iconSize: StudioTheme.Values.bigIconFontSize
|
|
|
|
|
buttonSize: root.height
|
2022-11-17 17:52:26 +02:00
|
|
|
enabled: hasMaterial && hasQuick3DImport && hasMaterialLibrary
|
2022-03-18 17:28:28 +02:00
|
|
|
onClicked: root.toolBarAction(ToolBarAction.OpenMaterialBrowser)
|
|
|
|
|
tooltip: qsTr("Open material browser.")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|