Warning, /plasma/libplasma/tests/components/toolbutton3.qml is written in an unsupported language. File is not indexed.
0001 /* 0002 * SPDX-FileCopyrightText: 2019 David Edmundson <kde@davidedmundson.co.uk> 0003 * SPDX-FileCopyrightText: 2020 Marco Martin <notmart@gmail.com> 0004 * SPDX-FileCopyrightText: 2020 Noah Davis <noahadvs@gmail.com> 0005 * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL 0006 */ 0007 import QtQuick 0008 import QtQuick.Layouts 0009 import org.kde.plasma.components as PlasmaComponents 0010 import org.kde.kirigami as Kirigami 0011 0012 ComponentBase { 0013 id: root 0014 title: "Plasma Components 3 ToolButton" 0015 0016 contentItem: ColumnLayout { 0017 Flow { 0018 Layout.fillWidth: true 0019 Layout.fillHeight: true 0020 spacing: Kirigami.Units.gridUnit 0021 0022 PlasmaComponents.ToolButton { 0023 icon.name: "start-here-kde-plasma" 0024 text: "test" 0025 flat: true 0026 } 0027 PlasmaComponents.ToolButton { 0028 icon.name: "start-here-kde-plasma" 0029 flat: true 0030 } 0031 PlasmaComponents.ToolButton { 0032 text: "test" 0033 flat: true 0034 } 0035 PlasmaComponents.ToolButton { 0036 icon.name: "start-here-kde-plasma" 0037 text: "test" 0038 flat: false 0039 } 0040 PlasmaComponents.ToolButton { 0041 icon.name: "start-here-kde-plasma" 0042 flat: false 0043 } 0044 PlasmaComponents.ToolButton { 0045 text: "test" 0046 flat: false 0047 } 0048 PlasmaComponents.ToolButton { 0049 icon.name: "application-menu" 0050 text: "Icon Only" 0051 display: PlasmaComponents.ToolButton.IconOnly 0052 } 0053 PlasmaComponents.ToolButton { 0054 icon.name: "application-menu" 0055 text: "Text Beside Icon" 0056 display: PlasmaComponents.ToolButton.TextBesideIcon 0057 } 0058 PlasmaComponents.ToolButton { 0059 icon.name: "application-menu" 0060 text: "Text Under Icon" 0061 display: PlasmaComponents.ToolButton.TextUnderIcon 0062 } 0063 PlasmaComponents.ToolButton { 0064 icon.name: "application-menu" 0065 text: "Text Only" 0066 display: PlasmaComponents.ToolButton.TextOnly 0067 } 0068 } 0069 RowLayout { 0070 Layout.fillWidth: true 0071 PlasmaComponents.Label { 0072 Layout.fillWidth: true 0073 text: "They should always be square:" 0074 } 0075 PlasmaComponents.ToolButton { 0076 icon.name: "start-here-kde-plasma" 0077 } 0078 PlasmaComponents.ToolButton { 0079 icon.name: "start-here-kde-plasma" 0080 } 0081 PlasmaComponents.ToolButton { 0082 icon.name: "start-here-kde-plasma" 0083 } 0084 PlasmaComponents.ToolButton { 0085 icon.name: "start-here-kde-plasma" 0086 } 0087 } 0088 PlasmaComponents.Label { 0089 text: "Fixed size and stretching size buttons" 0090 } 0091 GridLayout { 0092 id: layout 0093 rows: 2 0094 columns:2 0095 Layout.fillWidth: true 0096 Layout.fillHeight: true 0097 PlasmaComponents.ToolButton { 0098 id: closeButton 0099 icon.name: "window-close" 0100 text: "Text" 0101 } 0102 PlasmaComponents.ToolButton { 0103 id: closeButton2 0104 icon.name: "window-close" 0105 Layout.fillWidth: true 0106 Layout.fillHeight: true 0107 icon.width: Kirigami.Units.iconSizes.small 0108 icon.height: Kirigami.Units.iconSizes.small 0109 text: "Text" 0110 } 0111 PlasmaComponents.ToolButton { 0112 id: closeButton3 0113 icon.name: "window-close" 0114 Layout.fillHeight: true 0115 text: "Text" 0116 } 0117 PlasmaComponents.ToolButton { 0118 id: closeButton4 0119 icon.name: "window-close" 0120 Layout.fillWidth: true 0121 Layout.fillHeight: true 0122 text: "Text" 0123 } 0124 } 0125 } 0126 } 0127