2023-02-03 14:58:01 +01:00
|
|
|
// Copyright (C) 2023 The Qt Company Ltd.
|
2023-01-04 08:52:22 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2022-03-18 17:28:28 +02:00
|
|
|
|
2023-02-03 14:58:01 +01:00
|
|
|
import QtQuick
|
2024-01-16 12:30:29 +01:00
|
|
|
import HelperWidgets as HelperWidgets
|
|
|
|
|
import StudioControls as StudioControls
|
|
|
|
|
import StudioTheme as StudioTheme
|
|
|
|
|
import MaterialToolBarAction
|
2022-03-18 17:28:28 +02:00
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
|
id: root
|
|
|
|
|
|
2023-02-03 14:58:01 +01:00
|
|
|
color: StudioTheme.Values.themeToolbarBackground
|
|
|
|
|
height: StudioTheme.Values.toolbarHeight
|
2022-03-18 17:28:28 +02:00
|
|
|
|
|
|
|
|
signal toolBarAction(int action)
|
|
|
|
|
|
|
|
|
|
Row {
|
|
|
|
|
id: row
|
2023-02-03 14:58:01 +01:00
|
|
|
spacing: StudioTheme.Values.toolbarSpacing
|
2022-03-18 17:28:28 +02:00
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
|
leftPadding: 6
|
|
|
|
|
|
2023-02-03 14:58:01 +01:00
|
|
|
HelperWidgets.AbstractButton {
|
|
|
|
|
style: StudioTheme.Values.viewBarButtonStyle
|
|
|
|
|
buttonIcon: StudioTheme.Constants.apply_medium
|
2022-11-17 17:52:26 +02:00
|
|
|
enabled: hasMaterial && hasModelSelection && hasQuick3DImport && hasMaterialLibrary
|
2022-03-18 17:28:28 +02:00
|
|
|
tooltip: qsTr("Apply material to selected model.")
|
2023-02-03 14:58:01 +01:00
|
|
|
onClicked: root.toolBarAction(ToolBarAction.ApplyToSelected)
|
2022-03-18 17:28:28 +02:00
|
|
|
}
|
|
|
|
|
|
2023-02-03 14:58:01 +01:00
|
|
|
HelperWidgets.AbstractButton {
|
|
|
|
|
style: StudioTheme.Values.viewBarButtonStyle
|
|
|
|
|
buttonIcon: StudioTheme.Constants.create_medium
|
2022-11-17 17:52:26 +02:00
|
|
|
enabled: hasQuick3DImport && hasMaterialLibrary
|
2022-06-22 12:48:25 +03:00
|
|
|
tooltip: qsTr("Create new material.")
|
2023-02-03 14:58:01 +01:00
|
|
|
onClicked: root.toolBarAction(ToolBarAction.AddNewMaterial)
|
2022-03-18 17:28:28 +02:00
|
|
|
}
|
|
|
|
|
|
2023-02-03 14:58:01 +01:00
|
|
|
HelperWidgets.AbstractButton {
|
|
|
|
|
style: StudioTheme.Values.viewBarButtonStyle
|
|
|
|
|
buttonIcon: StudioTheme.Constants.delete_medium
|
2022-11-17 17:52:26 +02:00
|
|
|
enabled: hasMaterial && hasQuick3DImport && hasMaterialLibrary
|
2022-03-18 17:28:28 +02:00
|
|
|
tooltip: qsTr("Delete current material.")
|
2023-02-03 14:58:01 +01:00
|
|
|
onClicked: root.toolBarAction(ToolBarAction.DeleteCurrentMaterial)
|
2022-03-18 17:28:28 +02:00
|
|
|
}
|
|
|
|
|
|
2023-02-03 14:58:01 +01:00
|
|
|
HelperWidgets.AbstractButton {
|
|
|
|
|
style: StudioTheme.Values.viewBarButtonStyle
|
|
|
|
|
buttonIcon: StudioTheme.Constants.materialBrowser_medium
|
2022-11-17 17:52:26 +02:00
|
|
|
enabled: hasMaterial && hasQuick3DImport && hasMaterialLibrary
|
2022-03-18 17:28:28 +02:00
|
|
|
tooltip: qsTr("Open material browser.")
|
2023-02-03 14:58:01 +01:00
|
|
|
onClicked: root.toolBarAction(ToolBarAction.OpenMaterialBrowser)
|
2022-03-18 17:28:28 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|