2020-08-20 00:14:19 +02:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: 2019 David Edmundson <kde@davidedmundson.co.uk>
|
|
|
|
* SPDX-FileCopyrightText: 2020 Marco Martin <notmart@gmail.com>
|
|
|
|
* SPDX-FileCopyrightText: 2020 Noah Davis <noahadvs@gmail.com>
|
|
|
|
* SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
|
|
|
|
*/
|
2019-09-10 12:35:55 +02:00
|
|
|
import QtQuick 2.0
|
2020-02-19 12:06:03 +01:00
|
|
|
import QtQuick.Layouts 1.4
|
2019-12-09 17:33:23 +01:00
|
|
|
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
|
|
import org.kde.plasma.components 3.0 as PlasmaComponents
|
2019-09-10 12:35:55 +02:00
|
|
|
|
2019-12-09 17:33:23 +01:00
|
|
|
ComponentBase {
|
2020-08-18 11:45:23 +02:00
|
|
|
id: root
|
|
|
|
title: "Plasma Components 3 ToolButton"
|
|
|
|
|
|
|
|
contentItem: ColumnLayout {
|
2020-02-19 12:06:03 +01:00
|
|
|
Flow {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
2020-08-18 11:45:23 +02:00
|
|
|
spacing: PlasmaCore.Units.gridUnit
|
2019-09-10 12:35:55 +02:00
|
|
|
|
2020-02-19 12:06:03 +01:00
|
|
|
PlasmaComponents.ToolButton {
|
2020-08-18 11:45:23 +02:00
|
|
|
icon.name: "start-here-kde-plasma"
|
2020-02-19 12:06:03 +01:00
|
|
|
text: "test"
|
|
|
|
flat: true
|
|
|
|
}
|
|
|
|
PlasmaComponents.ToolButton {
|
2020-08-18 11:45:23 +02:00
|
|
|
icon.name: "start-here-kde-plasma"
|
2020-02-19 12:06:03 +01:00
|
|
|
flat: true
|
|
|
|
}
|
|
|
|
PlasmaComponents.ToolButton {
|
|
|
|
text: "test"
|
|
|
|
flat: true
|
|
|
|
}
|
|
|
|
PlasmaComponents.ToolButton {
|
2020-08-18 11:45:23 +02:00
|
|
|
icon.name: "start-here-kde-plasma"
|
2020-02-19 12:06:03 +01:00
|
|
|
text: "test"
|
|
|
|
flat: false
|
|
|
|
}
|
|
|
|
PlasmaComponents.ToolButton {
|
2020-08-18 11:45:23 +02:00
|
|
|
icon.name: "start-here-kde-plasma"
|
2020-02-19 12:06:03 +01:00
|
|
|
flat: false
|
|
|
|
}
|
|
|
|
PlasmaComponents.ToolButton {
|
|
|
|
text: "test"
|
|
|
|
flat: false
|
|
|
|
}
|
|
|
|
PlasmaComponents.ToolButton {
|
|
|
|
icon.name: "application-menu"
|
|
|
|
text: "Icon Only"
|
|
|
|
display: PlasmaComponents.ToolButton.IconOnly
|
|
|
|
}
|
|
|
|
PlasmaComponents.ToolButton {
|
|
|
|
icon.name: "application-menu"
|
|
|
|
text: "Text Beside Icon"
|
|
|
|
display: PlasmaComponents.ToolButton.TextBesideIcon
|
|
|
|
}
|
|
|
|
PlasmaComponents.ToolButton {
|
|
|
|
icon.name: "application-menu"
|
|
|
|
text: "Text Under Icon"
|
|
|
|
display: PlasmaComponents.ToolButton.TextUnderIcon
|
|
|
|
}
|
|
|
|
PlasmaComponents.ToolButton {
|
|
|
|
icon.name: "application-menu"
|
|
|
|
text: "Text Only"
|
|
|
|
display: PlasmaComponents.ToolButton.TextOnly
|
|
|
|
}
|
2019-09-10 12:35:55 +02:00
|
|
|
}
|
2020-02-19 12:06:03 +01:00
|
|
|
RowLayout {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
PlasmaComponents.Label {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
text: "They should always be square:"
|
|
|
|
}
|
|
|
|
PlasmaComponents.ToolButton {
|
2020-08-18 11:45:23 +02:00
|
|
|
icon.name: "start-here-kde-plasma"
|
2020-02-19 12:06:03 +01:00
|
|
|
}
|
|
|
|
PlasmaComponents.ToolButton {
|
2020-08-18 11:45:23 +02:00
|
|
|
icon.name: "start-here-kde-plasma"
|
2020-02-19 12:06:03 +01:00
|
|
|
}
|
|
|
|
PlasmaComponents.ToolButton {
|
2020-08-18 11:45:23 +02:00
|
|
|
icon.name: "start-here-kde-plasma"
|
2020-02-19 12:06:03 +01:00
|
|
|
}
|
|
|
|
PlasmaComponents.ToolButton {
|
2020-08-18 11:45:23 +02:00
|
|
|
icon.name: "start-here-kde-plasma"
|
2020-02-19 12:06:03 +01:00
|
|
|
}
|
2019-09-10 12:35:55 +02:00
|
|
|
}
|
2020-02-24 17:32:35 +01:00
|
|
|
PlasmaComponents.Label {
|
|
|
|
text: "Fixed size and stretching size buttons"
|
|
|
|
}
|
|
|
|
GridLayout {
|
|
|
|
id: layout
|
|
|
|
rows: 2
|
|
|
|
columns:2
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
|
|
|
PlasmaComponents.ToolButton {
|
|
|
|
id: closeButton
|
|
|
|
icon.name: "window-close"
|
|
|
|
text: "Text"
|
|
|
|
}
|
|
|
|
PlasmaComponents.ToolButton {
|
|
|
|
id: closeButton2
|
|
|
|
icon.name: "window-close"
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
2020-08-18 11:45:23 +02:00
|
|
|
icon.width: PlasmaCore.Units.iconSizes.small
|
|
|
|
icon.height: PlasmaCore.Units.iconSizes.small
|
2020-02-24 17:32:35 +01:00
|
|
|
text: "Text"
|
|
|
|
}
|
|
|
|
PlasmaComponents.ToolButton {
|
|
|
|
id: closeButton3
|
|
|
|
icon.name: "window-close"
|
|
|
|
Layout.fillHeight: true
|
|
|
|
text: "Text"
|
|
|
|
}
|
|
|
|
PlasmaComponents.ToolButton {
|
|
|
|
id: closeButton4
|
|
|
|
icon.name: "window-close"
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
|
|
|
text: "Text"
|
|
|
|
}
|
|
|
|
}
|
2019-09-10 12:35:55 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|