diff options
Diffstat (limited to 'src/quickcontrols/fusion/ToolButton.qml')
-rw-r--r-- | src/quickcontrols/fusion/ToolButton.qml | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/quickcontrols/fusion/ToolButton.qml b/src/quickcontrols/fusion/ToolButton.qml new file mode 100644 index 0000000000..dd9b628261 --- /dev/null +++ b/src/quickcontrols/fusion/ToolButton.qml @@ -0,0 +1,43 @@ +// Copyright (C) 2017 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls.impl +import QtQuick.Controls.Fusion +import QtQuick.Controls.Fusion.impl + +T.ToolButton { + id: control + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) + + padding: 6 + spacing: 6 + + icon.width: 16 + icon.height: 16 + + contentItem: IconLabel { + spacing: control.spacing + mirrored: control.mirrored + display: control.display + + icon: control.icon + text: control.text + font: control.font + color: control.palette.buttonText + } + + background: ButtonPanel { + implicitWidth: 20 + implicitHeight: 20 + + control: control + visible: control.down || control.checked || control.highlighted || control.visualFocus + || (enabled && control.hovered) + } +} |