77 lines
2.0 KiB
QML
77 lines
2.0 KiB
QML
|
// Copyright (C) 2024 The Qt Company Ltd.
|
||
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
||
|
|
||
|
import QtQuick
|
||
|
import QtQuick.Controls
|
||
|
import QtQuick.Layouts
|
||
|
|
||
|
Item {
|
||
|
id: root
|
||
|
implicitHeight: 40
|
||
|
implicitWidth: 40
|
||
|
|
||
|
property alias panEnabled: panButton.checked
|
||
|
readonly property int __icon_size: 20
|
||
|
|
||
|
signal helpRequested()
|
||
|
signal cutRequested()
|
||
|
signal copyRequested()
|
||
|
signal pasteRequested()
|
||
|
|
||
|
ToolBar {
|
||
|
anchors.fill: parent
|
||
|
|
||
|
RowLayout {
|
||
|
anchors.fill: parent
|
||
|
|
||
|
ToolButton {
|
||
|
id: helpButton
|
||
|
icon.source: "icons/help.svg"
|
||
|
icon.width: root.__icon_size
|
||
|
icon.height: root.__icon_size
|
||
|
icon.color: palette.text
|
||
|
onClicked: helpRequested()
|
||
|
}
|
||
|
|
||
|
ToolButton {
|
||
|
id: panButton
|
||
|
icon.source: "icons/pan.svg"
|
||
|
icon.color: palette.text
|
||
|
icon.width: root.__icon_size
|
||
|
icon.height: root.__icon_size
|
||
|
flat: true
|
||
|
checkable: true
|
||
|
}
|
||
|
|
||
|
ToolButton {
|
||
|
id: cutButton
|
||
|
icon.source: "icons/cut.svg"
|
||
|
icon.color: palette.text
|
||
|
icon.width: root.__icon_size
|
||
|
icon.height: root.__icon_size
|
||
|
onClicked: cutRequested()
|
||
|
}
|
||
|
|
||
|
ToolButton {
|
||
|
id: copyButton
|
||
|
icon.source: "icons/copy.svg"
|
||
|
icon.color: palette.text
|
||
|
icon.width: root.__icon_size
|
||
|
icon.height: root.__icon_size
|
||
|
onClicked: copyRequested()
|
||
|
}
|
||
|
|
||
|
ToolButton {
|
||
|
id: pasteButton
|
||
|
icon.source: "icons/paste.svg"
|
||
|
icon.color: palette.text
|
||
|
icon.width: root.__icon_size
|
||
|
icon.height: root.__icon_size
|
||
|
onClicked: pasteRequested()
|
||
|
}
|
||
|
|
||
|
Item { Layout.fillWidth: true }
|
||
|
}
|
||
|
}
|
||
|
}
|