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-11-17 12:54:19 +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 StudioTheme as StudioTheme
|
|
|
|
|
import TextureToolBarAction
|
2022-11-17 12:54:19 +02:00
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
|
id: root
|
|
|
|
|
|
2023-02-03 14:58:01 +01:00
|
|
|
color: StudioTheme.Values.themeToolbarBackground
|
|
|
|
|
height: StudioTheme.Values.toolbarHeight
|
2022-11-17 12:54:19 +02:00
|
|
|
width: row.width
|
|
|
|
|
|
|
|
|
|
signal toolBarAction(int action)
|
|
|
|
|
|
|
|
|
|
Row {
|
|
|
|
|
id: row
|
2023-02-03 14:58:01 +01:00
|
|
|
spacing: StudioTheme.Values.toolbarSpacing
|
2022-11-17 12:54:19 +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-23 16:18:50 +02:00
|
|
|
enabled: hasTexture && hasSingleModelSelection && hasQuick3DImport && hasMaterialLibrary
|
2022-11-17 12:54:19 +02:00
|
|
|
tooltip: qsTr("Apply texture to selected model's material.")
|
2023-02-03 14:58:01 +01:00
|
|
|
onClicked: root.toolBarAction(ToolBarAction.ApplyToSelected)
|
2022-11-17 12:54:19 +02:00
|
|
|
}
|
|
|
|
|
|
2023-02-03 14:58:01 +01:00
|
|
|
HelperWidgets.AbstractButton {
|
|
|
|
|
style: StudioTheme.Values.viewBarButtonStyle
|
|
|
|
|
buttonIcon: StudioTheme.Constants.create_medium
|
2022-11-17 12:54:19 +02:00
|
|
|
enabled: hasQuick3DImport && hasMaterialLibrary
|
|
|
|
|
tooltip: qsTr("Create new texture.")
|
2023-02-03 14:58:01 +01:00
|
|
|
onClicked: root.toolBarAction(ToolBarAction.AddNewTexture)
|
2022-11-17 12:54:19 +02:00
|
|
|
}
|
|
|
|
|
|
2023-02-03 14:58:01 +01:00
|
|
|
HelperWidgets.AbstractButton {
|
|
|
|
|
style: StudioTheme.Values.viewBarButtonStyle
|
|
|
|
|
buttonIcon: StudioTheme.Constants.delete_medium
|
2022-11-17 12:54:19 +02:00
|
|
|
enabled: hasTexture && hasQuick3DImport && hasMaterialLibrary
|
|
|
|
|
tooltip: qsTr("Delete current texture.")
|
2023-02-03 14:58:01 +01:00
|
|
|
onClicked: root.toolBarAction(ToolBarAction.DeleteCurrentTexture)
|
2022-11-17 12:54:19 +02:00
|
|
|
}
|
|
|
|
|
|
2023-02-03 14:58:01 +01:00
|
|
|
HelperWidgets.AbstractButton {
|
|
|
|
|
style: StudioTheme.Values.viewBarButtonStyle
|
|
|
|
|
buttonIcon: StudioTheme.Constants.materialBrowser_medium
|
|
|
|
|
enabled: hasTexture && hasQuick3DImport && hasMaterialLibrary
|
2022-11-17 12:54:19 +02:00
|
|
|
tooltip: qsTr("Open material browser.")
|
2023-02-03 14:58:01 +01:00
|
|
|
onClicked: root.toolBarAction(ToolBarAction.OpenMaterialBrowser)
|
2022-11-17 12:54:19 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|