2020-08-20 00:14:19 +02:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: 2014 David Edmundson <kde@davidedmundson.co.uk>
|
|
|
|
* SPDX-FileCopyrightText: 2015 Marco Martin <notmart@gmail.com>
|
|
|
|
* SPDX-FileCopyrightText: 2020 Nate Graham <nate@kde.org>
|
|
|
|
* 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
|
|
|
|
*/
|
2014-09-22 17:02:10 +02:00
|
|
|
import QtQuick 2.0
|
2015-09-15 14:25:20 +02:00
|
|
|
import QtQuick.Layouts 1.2
|
2020-08-18 11:45:23 +02:00
|
|
|
import QtQuick.Controls 1.2
|
|
|
|
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
|
|
import org.kde.plasma.components 2.0 as PlasmaComponents
|
2014-09-22 17:02:10 +02:00
|
|
|
|
2019-12-09 17:33:23 +01:00
|
|
|
ComponentBase {
|
2020-08-18 11:45:23 +02:00
|
|
|
id: root
|
|
|
|
title: "Plasma Components 2 Button"
|
|
|
|
contentItem: GridLayout {
|
|
|
|
rowSpacing: PlasmaCore.Units.smallSpacing
|
|
|
|
columnSpacing: PlasmaCore.Units.largeSpacing
|
2015-09-12 22:25:53 +02:00
|
|
|
columns: 2
|
|
|
|
|
2020-08-18 11:45:23 +02:00
|
|
|
PlasmaComponents.Label {
|
2015-09-12 22:25:53 +02:00
|
|
|
text: "icon + text"
|
|
|
|
}
|
2014-09-22 17:02:10 +02:00
|
|
|
|
|
|
|
PlasmaComponents.Button {
|
2020-08-18 11:45:23 +02:00
|
|
|
iconSource: "start-here-kde-plasma"
|
2014-09-22 17:02:10 +02:00
|
|
|
text: "test"
|
|
|
|
}
|
2015-09-12 22:25:53 +02:00
|
|
|
|
2020-08-18 11:45:23 +02:00
|
|
|
PlasmaComponents.Label {
|
2015-09-12 22:25:53 +02:00
|
|
|
text: "icon alone, should look small and square"
|
|
|
|
}
|
|
|
|
|
2014-09-22 17:02:10 +02:00
|
|
|
PlasmaComponents.Button {
|
2020-08-18 11:45:23 +02:00
|
|
|
iconSource: "start-here-kde-plasma"
|
2014-09-22 17:02:10 +02:00
|
|
|
}
|
2015-09-12 22:25:53 +02:00
|
|
|
|
2020-08-18 11:45:23 +02:00
|
|
|
PlasmaComponents.Label {
|
2020-07-29 21:33:26 +02:00
|
|
|
text: "text alone, should be about as wide as the text itself"
|
2015-09-12 22:25:53 +02:00
|
|
|
}
|
|
|
|
|
2014-09-22 17:02:10 +02:00
|
|
|
PlasmaComponents.Button {
|
|
|
|
text: "test"
|
|
|
|
}
|
|
|
|
|
2020-08-18 11:45:23 +02:00
|
|
|
PlasmaComponents.Label {
|
2020-01-09 17:35:26 +01:00
|
|
|
text: "This should look highlighted on load"
|
|
|
|
}
|
|
|
|
|
|
|
|
PlasmaComponents.Button {
|
|
|
|
text: "test"
|
|
|
|
focus: true
|
|
|
|
}
|
|
|
|
|
2015-09-12 22:25:53 +02:00
|
|
|
|
2020-08-18 11:45:23 +02:00
|
|
|
PlasmaComponents.Label {
|
2015-09-12 22:25:53 +02:00
|
|
|
text: "long text, should expand to fit"
|
|
|
|
}
|
|
|
|
|
|
|
|
PlasmaComponents.Button {
|
2020-08-18 11:45:23 +02:00
|
|
|
iconSource: "start-here-kde-plasma"
|
2015-09-12 22:25:53 +02:00
|
|
|
text: "This is a really really really really long button"
|
|
|
|
}
|
|
|
|
|
2020-08-18 11:45:23 +02:00
|
|
|
PlasmaComponents.Label {
|
2015-09-12 22:25:53 +02:00
|
|
|
text: "long text but constrained, should be 150px and elided"
|
|
|
|
}
|
|
|
|
|
|
|
|
PlasmaComponents.Button {
|
2020-08-18 11:45:23 +02:00
|
|
|
iconSource: "start-here-kde-plasma"
|
2015-09-12 22:25:53 +02:00
|
|
|
text: "This is a really really really really long button"
|
2020-08-18 11:45:23 +02:00
|
|
|
Layout.maximumWidth: 150
|
2015-09-12 22:25:53 +02:00
|
|
|
}
|
|
|
|
|
2020-08-18 11:45:23 +02:00
|
|
|
PlasmaComponents.Label {
|
2015-09-12 22:25:53 +02:00
|
|
|
text: "button with menu"
|
|
|
|
}
|
|
|
|
|
|
|
|
PlasmaComponents.Button {
|
2014-09-22 17:02:10 +02:00
|
|
|
text: "test"
|
|
|
|
menu: Menu {
|
|
|
|
MenuItem {
|
|
|
|
text: "Cut"
|
|
|
|
shortcut: "Ctrl+X"
|
|
|
|
}
|
|
|
|
|
|
|
|
MenuItem {
|
|
|
|
text: "Copy"
|
|
|
|
shortcut: "Ctrl+C"
|
|
|
|
}
|
|
|
|
|
|
|
|
MenuItem {
|
|
|
|
text: "Paste"
|
|
|
|
shortcut: "Ctrl+V"
|
|
|
|
}
|
|
|
|
|
|
|
|
MenuSeparator { }
|
|
|
|
|
|
|
|
Menu {
|
|
|
|
title: "More Stuff"
|
|
|
|
|
|
|
|
MenuItem {
|
|
|
|
text: "Do Nothing"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2015-09-15 14:25:20 +02:00
|
|
|
|
2020-08-18 11:45:23 +02:00
|
|
|
PlasmaComponents.Label {
|
2019-05-13 10:54:44 +02:00
|
|
|
text: "button (with or without icon) and textfield should have the same height"
|
2015-09-15 14:25:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
PlasmaComponents.Button {
|
|
|
|
text: "test"
|
|
|
|
}
|
2019-05-13 10:54:44 +02:00
|
|
|
PlasmaComponents.Button {
|
|
|
|
iconSource: "application-menu"
|
|
|
|
text: "test"
|
|
|
|
}
|
2015-09-15 14:25:20 +02:00
|
|
|
PlasmaComponents.TextField {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-18 11:45:23 +02:00
|
|
|
PlasmaComponents.Label {
|
2015-10-19 00:52:00 +02:00
|
|
|
text: "minimum width property. Should be two letters wide"
|
|
|
|
}
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
PlasmaComponents.Button {
|
|
|
|
text: "AA"
|
|
|
|
implicitWidth: minimumWidth
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-09-22 17:02:10 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|