Warning, /frameworks/qqc2-desktop-style/tests/ToolButton.qml is written in an unsupported language. File is not indexed.

0001 /*
0002     SPDX-FileCopyrightText: 2020 Arjen Hiemstra <ahiemstra@heimr.nl>
0003     SPDX-FileCopyrightText: 2021 Nate Graham <nate@kde.org>
0004 
0005     SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-or-later
0006 */
0007 
0008 import QtQuick
0009 import QtQuick.Layouts
0010 import QtQuick.Controls
0011 
0012 ApplicationWindow {
0013     visible: true
0014     width: 800
0015     height: 600
0016 
0017     GridLayout {
0018         anchors.fill: parent
0019         anchors.margins: 10
0020         rows: 7
0021         flow: GridLayout.TopToBottom
0022 
0023         Label {
0024             text: "Flat"
0025         }
0026 
0027         ToolButton {
0028             icon.name: "documentinfo"
0029             text: "Tool Button Default"
0030             flat: true
0031         }
0032 
0033         ToolButton {
0034             icon.name: "documentinfo"
0035             text: "Tool Button Icon Only"
0036             display: ToolButton.IconOnly
0037             flat: true
0038         }
0039 
0040         ToolButton {
0041             icon.name: "documentinfo"
0042             text: "Tool Button Text Only"
0043             display: ToolButton.TextOnly
0044             flat: true
0045         }
0046 
0047         ToolButton {
0048             icon.name: "documentinfo"
0049             text: "Tool Button Text Beside Icon"
0050             display: ToolButton.TextBesideIcon
0051             flat: true
0052         }
0053 
0054         ToolButton {
0055             icon.name: "documentinfo"
0056             text: "Tool Button Text Below Icon"
0057             display: ToolButton.TextUnderIcon
0058             flat: true
0059         }
0060 
0061         ToolButton {
0062             icon.name: "documentinfo"
0063             text: "Tool Button highlighted"
0064             flat: true
0065             highlighted: true
0066         }
0067 
0068         Label {
0069             text: "Non-Flat"
0070         }
0071 
0072         ToolButton {
0073             icon.name: "documentinfo"
0074             text: "Tool Button Default"
0075             flat: false
0076         }
0077 
0078         ToolButton {
0079             icon.name: "documentinfo"
0080             text: "Tool Button Icon Only"
0081             display: ToolButton.IconOnly
0082             flat: false
0083         }
0084 
0085         ToolButton {
0086             icon.name: "documentinfo"
0087             text: "Tool Button Text Only"
0088             display: ToolButton.TextOnly
0089             flat: false
0090         }
0091 
0092         ToolButton {
0093             icon.name: "documentinfo"
0094             text: "Tool Button Text Beside Icon"
0095             display: ToolButton.TextBesideIcon
0096             flat: false
0097         }
0098 
0099         ToolButton {
0100             icon.name: "documentinfo"
0101             text: "Tool Button Text Below Icon"
0102             display: ToolButton.TextUnderIcon
0103             flat: false
0104         }
0105         ToolButton {
0106             icon.name: "documentinfo"
0107             text: "Tool Button highlighted"
0108             flat: false
0109             highlighted: true
0110         }
0111 
0112         ToolButton {
0113             text: "Without setting display"
0114         }
0115 
0116         ToolButton {
0117             text: "With Menu decoration"
0118 
0119             Accessible.role: Accessible.ButtonMenu
0120         }
0121     }
0122 }