Advance Wayland and KDE package bring-up
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
import org.kde.kirigami as Kirigami
|
||||
|
||||
Item {
|
||||
width: 600
|
||||
height: 600
|
||||
|
||||
Kirigami.Card {
|
||||
width: 300
|
||||
anchors.centerIn: parent
|
||||
|
||||
banner.title: "Card"
|
||||
banner.titleIcon: "document-new"
|
||||
banner.titleAlignment: alignCombo.currentValue
|
||||
banner.source: "/usr/share/wallpapers/Next/contents/screenshot.png"
|
||||
|
||||
contentItem: Label {
|
||||
text: "Card Contents"
|
||||
}
|
||||
|
||||
actions: [
|
||||
Kirigami.Action {
|
||||
icon.name: "document-new"
|
||||
text: "Action 1"
|
||||
},
|
||||
Kirigami.Action {
|
||||
icon.name: "document-new"
|
||||
text: "Action 2"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
ComboBox {
|
||||
id: alignCombo
|
||||
|
||||
model: [
|
||||
{ text: "Top Left", align: Qt.AlignLeft | Qt.AlignTop },
|
||||
{ text: "Top Center", align: Qt.AlignHCenter | Qt.AlignTop },
|
||||
{ text: "Top Right", align: Qt.AlignRight | Qt.AlignTop },
|
||||
{ text: "Center Left", align: Qt.AlignLeft | Qt.AlignVCenter },
|
||||
{ text: "Center", align: Qt.AlignHCenter | Qt.AlignVCenter },
|
||||
{ text: "Center Right", align: Qt.AlignRight | Qt.AlignVCenter },
|
||||
{ text: "Bottom Left", align: Qt.AlignLeft | Qt.AlignBottom },
|
||||
{ text: "Bottom Center", align: Qt.AlignHCenter | Qt.AlignBottom },
|
||||
{ text: "Bottom Right", align: Qt.AlignRight | Qt.AlignBottom }
|
||||
]
|
||||
|
||||
textRole: "text"
|
||||
valueRole: "align"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023 Marco Martin <mart@kde.org>
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.0-or-later
|
||||
*/
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
import org.kde.kirigami as Kirigami
|
||||
|
||||
ColumnLayout {
|
||||
width: 600
|
||||
height: 600
|
||||
|
||||
Text {
|
||||
text: `Implicit width: ${hfLayout.implicitWidth}\nImplicit height: ${hfLayout.implicitHeight}`
|
||||
}
|
||||
Kirigami.HeaderFooterLayout {
|
||||
id: hfLayout
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
header: ToolBar {
|
||||
contentItem: Rectangle {
|
||||
color: "red"
|
||||
implicitWidth: 20
|
||||
implicitHeight: 20
|
||||
}
|
||||
}
|
||||
contentItem: Rectangle {
|
||||
color: "lightgreen"
|
||||
implicitWidth: 300
|
||||
implicitHeight: 50
|
||||
}
|
||||
footer: ToolBar {
|
||||
contentItem: Rectangle {
|
||||
color: "blue"
|
||||
height: 30
|
||||
}
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
color: "yellow"
|
||||
Layout.preferredHeight: 40
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2016 Aleix Pol Gonzalez <aleixpol@kde.org>
|
||||
* SPDX-FileCopyrightText: 2016 Marco Martin <mart@kde.org>
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.0-or-later
|
||||
*/
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
import org.kde.kirigami as Kirigami
|
||||
|
||||
Kirigami.ApplicationWindow {
|
||||
id: main
|
||||
|
||||
pageStack.initialPage: Kirigami.ScrollablePage {
|
||||
ListView {
|
||||
model: 10
|
||||
delegate: Rectangle {
|
||||
width: 100
|
||||
height: 30
|
||||
color: "white"
|
||||
border.color: ListView.isCurrentItem ? "#1EA8F7" : "transparent"
|
||||
border.width: 4
|
||||
radius: 4
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2016 Aleix Pol Gonzalez <aleixpol@kde.org>
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.0-or-later
|
||||
*/
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
import org.kde.kirigami as Kirigami
|
||||
|
||||
Kirigami.ApplicationWindow {
|
||||
id: main
|
||||
|
||||
Component {
|
||||
id: keyPage
|
||||
Kirigami.Page {
|
||||
id: page
|
||||
|
||||
// Don't remove, used in autotests
|
||||
readonly property alias lastKey: see.text
|
||||
|
||||
Label {
|
||||
id: see
|
||||
anchors.centerIn: parent
|
||||
color: page.activeFocus ? Kirigami.Theme.focusColor : Kirigami.Theme.textColor
|
||||
}
|
||||
|
||||
Keys.onPressed: event => {
|
||||
if (event.text) {
|
||||
see.text = event.text
|
||||
} else {
|
||||
see.text = event.key
|
||||
}
|
||||
}
|
||||
|
||||
Keys.onEnterPressed: main.showPassiveNotification("page!")
|
||||
}
|
||||
}
|
||||
|
||||
header: Label {
|
||||
padding: Kirigami.Units.largeSpacing
|
||||
text: `focus: ${main.activeFocusItem}, current: ${main.pageStack.currentIndex}`
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
main.pageStack.push(keyPage)
|
||||
main.pageStack.push(keyPage)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,469 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021 Nate Graham <nate@kde.org>
|
||||
* SPDX-FileCopyrightText: 2023 Arjen Hiemstra <ahiemstra@heimr.nl>
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.0-or-later
|
||||
*/
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls as QQC2
|
||||
|
||||
import org.kde.kirigami as Kirigami
|
||||
import org.kde.kirigami.delegates as KD
|
||||
|
||||
Kirigami.ApplicationWindow {
|
||||
GridLayout {
|
||||
anchors.fill: parent
|
||||
anchors.margins: Kirigami.Units.gridUnit
|
||||
|
||||
rows: 3
|
||||
rowSpacing: Kirigami.Units.gridUnit
|
||||
columns: 3
|
||||
columnSpacing: Kirigami.Units.gridUnit
|
||||
|
||||
Kirigami.Theme.inherit: false
|
||||
Kirigami.Theme.colorSet: Kirigami.Theme.View
|
||||
|
||||
// Icon + Label
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredWidth: 1
|
||||
|
||||
Kirigami.Heading {
|
||||
text: "Icon + Label"
|
||||
level: 3
|
||||
Layout.fillWidth: true
|
||||
wrapMode: Text.Wrap
|
||||
}
|
||||
|
||||
KD.SubtitleDelegate {
|
||||
Layout.fillWidth: true
|
||||
|
||||
icon.name: "edit-bomb"
|
||||
text: "Boom!"
|
||||
}
|
||||
KD.CheckSubtitleDelegate {
|
||||
Layout.fillWidth: true
|
||||
|
||||
icon.name: "edit-bomb"
|
||||
text: "Boom!"
|
||||
}
|
||||
KD.RadioSubtitleDelegate {
|
||||
Layout.fillWidth: true
|
||||
|
||||
icon.name: "edit-bomb"
|
||||
text: "Boom!"
|
||||
}
|
||||
KD.SwitchSubtitleDelegate {
|
||||
Layout.fillWidth: true
|
||||
|
||||
icon.name: "edit-bomb"
|
||||
text: "Boom!"
|
||||
}
|
||||
}
|
||||
|
||||
// Label + space reserved for icon
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredWidth: 1
|
||||
|
||||
Kirigami.Heading {
|
||||
text: "Icon + Label + space reserved for icon"
|
||||
level: 3
|
||||
Layout.fillWidth: true
|
||||
wrapMode: Text.Wrap
|
||||
}
|
||||
|
||||
KD.SubtitleDelegate {
|
||||
Layout.fillWidth: true
|
||||
text: "Boom!"
|
||||
icon.width: Kirigami.Units.iconSizes.smallMedium
|
||||
}
|
||||
KD.CheckSubtitleDelegate {
|
||||
Layout.fillWidth: true
|
||||
text: "Boom!"
|
||||
icon.width: Kirigami.Units.iconSizes.smallMedium
|
||||
}
|
||||
KD.RadioSubtitleDelegate {
|
||||
Layout.fillWidth: true
|
||||
text: "Boom!"
|
||||
icon.width: Kirigami.Units.iconSizes.smallMedium
|
||||
}
|
||||
KD.SwitchSubtitleDelegate {
|
||||
Layout.fillWidth: true
|
||||
text: "Boom!"
|
||||
icon.width: Kirigami.Units.iconSizes.smallMedium
|
||||
}
|
||||
}
|
||||
|
||||
// Icon + Label + leading and trailing items
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredWidth: 1
|
||||
|
||||
Kirigami.Heading {
|
||||
text: "Icon + Label + leading and trailing items"
|
||||
level: 3
|
||||
Layout.fillWidth: true
|
||||
wrapMode: Text.Wrap
|
||||
}
|
||||
|
||||
QQC2.ItemDelegate {
|
||||
id: plainDelegate
|
||||
Layout.fillWidth: true
|
||||
|
||||
icon.name: "edit-bomb"
|
||||
text: "Boom!"
|
||||
|
||||
contentItem: RowLayout {
|
||||
spacing: Kirigami.Units.smallSpacing
|
||||
Rectangle {
|
||||
radius: height
|
||||
Layout.preferredWidth: Kirigami.Units.largeSpacing
|
||||
Layout.preferredHeight: Kirigami.Units.largeSpacing
|
||||
color: Kirigami.Theme.neutralTextColor
|
||||
}
|
||||
|
||||
KD.IconTitleSubtitle {
|
||||
Layout.fillWidth: true
|
||||
title: plainDelegate.text
|
||||
icon: icon.fromControlsIcon(plainDelegate.icon)
|
||||
}
|
||||
|
||||
QQC2.Button {
|
||||
icon.name: "edit-delete"
|
||||
text: "Defuse the bomb!"
|
||||
}
|
||||
}
|
||||
}
|
||||
QQC2.CheckDelegate {
|
||||
id: checkDelegate
|
||||
Layout.fillWidth: true
|
||||
|
||||
icon.name: "edit-bomb"
|
||||
text: "Boom!"
|
||||
|
||||
contentItem: RowLayout {
|
||||
spacing: Kirigami.Units.smallSpacing
|
||||
Rectangle {
|
||||
radius: height
|
||||
Layout.preferredWidth: Kirigami.Units.largeSpacing
|
||||
Layout.preferredHeight: Kirigami.Units.largeSpacing
|
||||
color: Kirigami.Theme.neutralTextColor
|
||||
}
|
||||
|
||||
KD.IconTitleSubtitle {
|
||||
Layout.fillWidth: true
|
||||
title: checkDelegate.text
|
||||
icon: icon.fromControlsIcon(checkDelegate.icon)
|
||||
}
|
||||
|
||||
QQC2.Button {
|
||||
icon.name: "edit-delete"
|
||||
text: "Defuse the bomb!"
|
||||
}
|
||||
}
|
||||
}
|
||||
QQC2.RadioDelegate {
|
||||
id: radioDelegate
|
||||
Layout.fillWidth: true
|
||||
|
||||
icon.name: "edit-bomb"
|
||||
text: "Boom!"
|
||||
|
||||
contentItem: RowLayout {
|
||||
spacing: Kirigami.Units.smallSpacing
|
||||
Rectangle {
|
||||
radius: height
|
||||
Layout.preferredWidth: Kirigami.Units.largeSpacing
|
||||
Layout.preferredHeight: Kirigami.Units.largeSpacing
|
||||
color: Kirigami.Theme.neutralTextColor
|
||||
}
|
||||
|
||||
KD.IconTitleSubtitle {
|
||||
Layout.fillWidth: true
|
||||
title: radioDelegate.text
|
||||
icon: icon.fromControlsIcon(radioDelegate.icon)
|
||||
}
|
||||
|
||||
QQC2.Button {
|
||||
icon.name: "edit-delete"
|
||||
text: "Defuse the bomb!"
|
||||
}
|
||||
}
|
||||
}
|
||||
QQC2.SwitchDelegate {
|
||||
id: switchDelegate
|
||||
Layout.fillWidth: true
|
||||
|
||||
icon.name: "edit-bomb"
|
||||
text: "Boom!"
|
||||
|
||||
contentItem: RowLayout {
|
||||
spacing: Kirigami.Units.smallSpacing
|
||||
Rectangle {
|
||||
radius: height
|
||||
Layout.preferredWidth: Kirigami.Units.largeSpacing
|
||||
Layout.preferredHeight: Kirigami.Units.largeSpacing
|
||||
color: Kirigami.Theme.neutralTextColor
|
||||
}
|
||||
|
||||
KD.IconTitleSubtitle {
|
||||
Layout.fillWidth: true
|
||||
title: switchDelegate.text
|
||||
icon: icon.fromControlsIcon(switchDelegate.icon)
|
||||
}
|
||||
|
||||
QQC2.Button {
|
||||
icon.name: "edit-delete"
|
||||
text: "Defuse the bomb!"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Icon + Label + subtitle
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredWidth: 1
|
||||
|
||||
Kirigami.Heading {
|
||||
text: "Icon + Label + subtitle"
|
||||
level: 3
|
||||
Layout.fillWidth: true
|
||||
wrapMode: Text.Wrap
|
||||
}
|
||||
|
||||
KD.SubtitleDelegate {
|
||||
Layout.fillWidth: true
|
||||
|
||||
icon.name: "edit-bomb"
|
||||
text: "Boom!"
|
||||
subtitle: "smaller boom"
|
||||
}
|
||||
KD.CheckSubtitleDelegate {
|
||||
Layout.fillWidth: true
|
||||
|
||||
icon.name: "edit-bomb"
|
||||
text: "Boom!"
|
||||
subtitle: "smaller boom"
|
||||
}
|
||||
KD.RadioSubtitleDelegate {
|
||||
Layout.fillWidth: true
|
||||
|
||||
icon.name: "edit-bomb"
|
||||
text: "Boom!"
|
||||
subtitle: "smaller boom"
|
||||
}
|
||||
KD.SwitchSubtitleDelegate {
|
||||
Layout.fillWidth: true
|
||||
|
||||
icon.name: "edit-bomb"
|
||||
text: "Boom!"
|
||||
subtitle: "smaller boom"
|
||||
}
|
||||
}
|
||||
|
||||
// Icon + Label + space reserved for subtitle
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredWidth: 1
|
||||
|
||||
Kirigami.Heading {
|
||||
text: "Icon + Label + space reserved for subtitle"
|
||||
level: 3
|
||||
Layout.fillWidth: true
|
||||
wrapMode: Text.Wrap
|
||||
}
|
||||
|
||||
KD.SubtitleDelegate {
|
||||
Layout.fillWidth: true
|
||||
|
||||
icon.name: "edit-bomb"
|
||||
text: "Boom!"
|
||||
|
||||
contentItem: KD.IconTitleSubtitle {
|
||||
title: parent.text
|
||||
icon: icon.fromControlsIcon(parent.icon)
|
||||
reserveSpaceForSubtitle: true
|
||||
}
|
||||
}
|
||||
KD.CheckSubtitleDelegate {
|
||||
Layout.fillWidth: true
|
||||
|
||||
icon.name: "edit-bomb"
|
||||
text: "Boom!"
|
||||
|
||||
contentItem: KD.IconTitleSubtitle {
|
||||
title: parent.text
|
||||
icon: icon.fromControlsIcon(parent.icon)
|
||||
reserveSpaceForSubtitle: true
|
||||
}
|
||||
}
|
||||
KD.RadioSubtitleDelegate {
|
||||
Layout.fillWidth: true
|
||||
|
||||
icon.name: "edit-bomb"
|
||||
text: "Boom!"
|
||||
|
||||
contentItem: KD.IconTitleSubtitle {
|
||||
title: parent.text
|
||||
icon: icon.fromControlsIcon(parent.icon)
|
||||
reserveSpaceForSubtitle: true
|
||||
}
|
||||
}
|
||||
KD.SwitchSubtitleDelegate {
|
||||
Layout.fillWidth: true
|
||||
|
||||
icon.name: "edit-bomb"
|
||||
text: "Boom!"
|
||||
|
||||
contentItem: KD.IconTitleSubtitle {
|
||||
title: parent.text
|
||||
icon: icon.fromControlsIcon(parent.icon)
|
||||
reserveSpaceForSubtitle: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Icon + Label + subtitle + leading and trailing items
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredWidth: 1
|
||||
|
||||
Kirigami.Heading {
|
||||
text: "Icon + Label + subtitle + leading/trailing"
|
||||
level: 3
|
||||
Layout.fillWidth: true
|
||||
wrapMode: Text.Wrap
|
||||
}
|
||||
|
||||
KD.SubtitleDelegate {
|
||||
id: subtitleDelegate
|
||||
Layout.fillWidth: true
|
||||
|
||||
icon.name: "edit-bomb"
|
||||
text: "Boom!"
|
||||
subtitle: "smaller boom"
|
||||
|
||||
contentItem: RowLayout {
|
||||
spacing: Kirigami.Units.smallSpacing
|
||||
Rectangle {
|
||||
radius: height
|
||||
Layout.preferredWidth: Kirigami.Units.largeSpacing
|
||||
Layout.preferredHeight: Kirigami.Units.largeSpacing
|
||||
color: Kirigami.Theme.neutralTextColor
|
||||
}
|
||||
|
||||
KD.IconTitleSubtitle {
|
||||
Layout.fillWidth: true
|
||||
title: subtitleDelegate.text
|
||||
subtitle: subtitleDelegate.subtitle
|
||||
selected: subtitleDelegate.highlighted || subtitleDelegate.down
|
||||
icon: icon.fromControlsIcon(subtitleDelegate.icon)
|
||||
}
|
||||
|
||||
QQC2.Button {
|
||||
icon.name: "edit-delete"
|
||||
text: "Defuse the bomb!"
|
||||
}
|
||||
}
|
||||
}
|
||||
KD.CheckSubtitleDelegate {
|
||||
id: subtitleCheckDelegate
|
||||
Layout.fillWidth: true
|
||||
|
||||
icon.name: "edit-bomb"
|
||||
text: "Boom!"
|
||||
subtitle: "smaller boom"
|
||||
|
||||
contentItem: RowLayout {
|
||||
spacing: Kirigami.Units.smallSpacing
|
||||
Rectangle {
|
||||
radius: height
|
||||
Layout.preferredWidth: Kirigami.Units.largeSpacing
|
||||
Layout.preferredHeight: Kirigami.Units.largeSpacing
|
||||
color: Kirigami.Theme.neutralTextColor
|
||||
}
|
||||
|
||||
KD.IconTitleSubtitle {
|
||||
Layout.fillWidth: true
|
||||
title: subtitleCheckDelegate.text
|
||||
subtitle: subtitleCheckDelegate.subtitle
|
||||
selected: subtitleCheckDelegate.highlighted || subtitleCheckDelegate.down
|
||||
icon: icon.fromControlsIcon(subtitleCheckDelegate.icon)
|
||||
}
|
||||
|
||||
QQC2.Button {
|
||||
icon.name: "edit-delete"
|
||||
text: "Defuse the bomb!"
|
||||
}
|
||||
}
|
||||
}
|
||||
KD.RadioSubtitleDelegate {
|
||||
id: subtitleRadioDelegate
|
||||
Layout.fillWidth: true
|
||||
|
||||
icon.name: "edit-bomb"
|
||||
text: "Boom!"
|
||||
subtitle: "smaller boom"
|
||||
|
||||
contentItem: RowLayout {
|
||||
spacing: Kirigami.Units.smallSpacing
|
||||
Rectangle {
|
||||
radius: height
|
||||
Layout.preferredWidth: Kirigami.Units.largeSpacing
|
||||
Layout.preferredHeight: Kirigami.Units.largeSpacing
|
||||
color: Kirigami.Theme.neutralTextColor
|
||||
}
|
||||
|
||||
KD.IconTitleSubtitle {
|
||||
Layout.fillWidth: true
|
||||
title: subtitleRadioDelegate.text
|
||||
subtitle: subtitleRadioDelegate.subtitle
|
||||
selected: subtitleRadioDelegate.highlighted || subtitleRadioDelegate.down
|
||||
icon: icon.fromControlsIcon(subtitleRadioDelegate.icon)
|
||||
}
|
||||
|
||||
QQC2.Button {
|
||||
icon.name: "edit-delete"
|
||||
text: "Defuse the bomb!"
|
||||
}
|
||||
}
|
||||
}
|
||||
KD.SwitchSubtitleDelegate {
|
||||
id: subtitleSwitchDelegate
|
||||
Layout.fillWidth: true
|
||||
|
||||
icon.name: "edit-bomb"
|
||||
text: "Boom!"
|
||||
subtitle: "smaller boom"
|
||||
|
||||
contentItem: RowLayout {
|
||||
spacing: Kirigami.Units.smallSpacing
|
||||
Rectangle {
|
||||
radius: height
|
||||
Layout.preferredWidth: Kirigami.Units.largeSpacing
|
||||
Layout.preferredHeight: Kirigami.Units.largeSpacing
|
||||
color: Kirigami.Theme.neutralTextColor
|
||||
}
|
||||
|
||||
KD.IconTitleSubtitle {
|
||||
Layout.fillWidth: true
|
||||
title: subtitleSwitchDelegate.text
|
||||
subtitle: subtitleSwitchDelegate.subtitle
|
||||
selected: subtitleSwitchDelegate.highlighted || subtitleSwitchDelegate.down
|
||||
icon: icon.fromControlsIcon(subtitleSwitchDelegate.icon)
|
||||
}
|
||||
|
||||
QQC2.Button {
|
||||
icon.name: "edit-delete"
|
||||
text: "Defuse the bomb!"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
/* SPDX-FileCopyrightText: 2021 Noah Davis <noahadvs@gmail.com>
|
||||
* SPDX-License-Identifier: LGPL-2.0-or-later
|
||||
*/
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls as QQC2
|
||||
|
||||
import org.kde.kirigami as Kirigami
|
||||
|
||||
QQC2.ApplicationWindow {
|
||||
width: 640
|
||||
height: 480
|
||||
visible: true
|
||||
|
||||
QQC2.SwipeView {
|
||||
id: swipeView
|
||||
|
||||
anchors.fill: parent
|
||||
currentIndex: navTabBar.currentIndex
|
||||
|
||||
QQC2.Page {
|
||||
contentItem: QQC2.Label {
|
||||
text: "page1"
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
}
|
||||
}
|
||||
QQC2.Page {
|
||||
contentItem: QQC2.Label {
|
||||
text: "page2"
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
}
|
||||
}
|
||||
QQC2.Page {
|
||||
contentItem: QQC2.Label {
|
||||
text: "page3"
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
}
|
||||
}
|
||||
QQC2.Page {
|
||||
contentItem: QQC2.Label {
|
||||
text: "page4"
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
}
|
||||
}
|
||||
onCurrentIndexChanged: navTabBar.currentIndex = swipeView.currentIndex
|
||||
}
|
||||
|
||||
footer: Kirigami.NavigationTabBar {
|
||||
id: navTabBar
|
||||
|
||||
currentIndex: swipeView.currentIndex
|
||||
|
||||
Kirigami.NavigationTabButton {
|
||||
visible: true
|
||||
width: navTabBar.buttonWidth
|
||||
icon.name: "document-save"
|
||||
text: `test ${tabIndex + 1}`
|
||||
QQC2.ButtonGroup.group: navTabBar.tabGroup
|
||||
}
|
||||
Kirigami.NavigationTabButton {
|
||||
visible: false
|
||||
width: navTabBar.buttonWidth
|
||||
icon.name: "document-send"
|
||||
text: `test ${tabIndex + 1}`
|
||||
QQC2.ButtonGroup.group: navTabBar.tabGroup
|
||||
}
|
||||
actions: [
|
||||
Kirigami.Action {
|
||||
visible: true
|
||||
icon.name: "edit-copy"
|
||||
icon.height: 32
|
||||
icon.width: 32
|
||||
text: "test 3"
|
||||
checked: true
|
||||
},
|
||||
Kirigami.Action {
|
||||
visible: true
|
||||
icon.name: "edit-cut"
|
||||
text: "test 4"
|
||||
checkable: true
|
||||
},
|
||||
Kirigami.Action {
|
||||
visible: false
|
||||
icon.name: "edit-paste"
|
||||
text: "test 5"
|
||||
},
|
||||
Kirigami.Action {
|
||||
visible: true
|
||||
icon.source: "../logo.png"
|
||||
text: "test 6"
|
||||
checkable: true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021 Ismael Asensio <isma.af@gmail.com>
|
||||
* SPDX-FileCopyrightText: 2021 David Edmundson <davidedmundson@kde.org>
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.0-or-later
|
||||
*/
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls as QQC2
|
||||
|
||||
import org.kde.kirigami as Kirigami
|
||||
|
||||
Rectangle {
|
||||
id: background
|
||||
|
||||
implicitWidth: 600
|
||||
implicitHeight: 600
|
||||
color: Kirigami.Theme.backgroundColor
|
||||
|
||||
Kirigami.FormLayout {
|
||||
id: layout
|
||||
anchors.centerIn: parent
|
||||
|
||||
QQC2.Button {
|
||||
Layout.fillWidth: true
|
||||
text: "Open overlay sheet"
|
||||
onClicked: sheet.open()
|
||||
}
|
||||
}
|
||||
|
||||
Kirigami.OverlaySheet {
|
||||
id: sheet
|
||||
parent: background
|
||||
|
||||
header: QQC2.TextField {
|
||||
id: headerText
|
||||
focus: true
|
||||
}
|
||||
footer: QQC2.TextField {
|
||||
id: footerText
|
||||
}
|
||||
|
||||
ListView {
|
||||
id: content
|
||||
model: 10
|
||||
|
||||
delegate: QQC2.ItemDelegate {
|
||||
text: "Item " + modelData
|
||||
width: parent.width
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2022 Aleix Pol <aleixpol@kde.org>
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.0-or-later
|
||||
*/
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls as QQC2
|
||||
|
||||
import org.kde.kirigami as Kirigami
|
||||
|
||||
Kirigami.ApplicationWindow {
|
||||
height: 720
|
||||
width: 360
|
||||
visible: true
|
||||
|
||||
Kirigami.OverlaySheet {
|
||||
id: sheet
|
||||
|
||||
title: "Certificate Viewer"
|
||||
|
||||
ColumnLayout {
|
||||
QQC2.DialogButtonBox {
|
||||
Layout.fillWidth: true
|
||||
|
||||
QQC2.Button {
|
||||
QQC2.DialogButtonBox.buttonRole: QQC2.DialogButtonBox.ActionRole
|
||||
text: "Export…"
|
||||
}
|
||||
|
||||
QQC2.Button {
|
||||
QQC2.DialogButtonBox.buttonRole: QQC2.DialogButtonBox.DestructiveRole
|
||||
text: "Close"
|
||||
icon.name: "dialog-close"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Timer {
|
||||
interval: 150
|
||||
running: true
|
||||
onTriggered: sheet.open()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2020 Arjen Hiemstra <ahiemstra@heimr.nl>
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.0-or-later
|
||||
*/
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
import org.kde.kirigami as Kirigami
|
||||
|
||||
Kirigami.ApplicationWindow {
|
||||
width: 600
|
||||
height: 800
|
||||
visible: true
|
||||
|
||||
pageStack.initialPage: Kirigami.Page {
|
||||
leftPadding: 0
|
||||
rightPadding: 0
|
||||
topPadding: 0
|
||||
bottomPadding: 0
|
||||
|
||||
Column {
|
||||
anchors.centerIn: parent
|
||||
|
||||
Kirigami.ShadowedImage {
|
||||
width: 400
|
||||
height: 300
|
||||
|
||||
color: Kirigami.Theme.highlightColor
|
||||
|
||||
source: "/usr/share/wallpapers/Next/contents/images/1024x768.jpg"
|
||||
|
||||
radius: radiusSlider.value
|
||||
|
||||
shadow.size: sizeSlider.value
|
||||
shadow.xOffset: xOffsetSlider.value
|
||||
shadow.yOffset: yOffsetSlider.value
|
||||
|
||||
border.width: borderWidthSlider.value
|
||||
border.color: Kirigami.Theme.textColor
|
||||
|
||||
corners.topLeftRadius: topLeftSlider.value
|
||||
corners.topRightRadius: topRightSlider.value
|
||||
corners.bottomLeftRadius: bottomLeftSlider.value
|
||||
corners.bottomRightRadius: bottomRightSlider.value
|
||||
}
|
||||
|
||||
Kirigami.FormLayout {
|
||||
Item { Kirigami.FormData.isSection: true }
|
||||
|
||||
Slider { id: radiusSlider; from: 0; to: 200; Kirigami.FormData.label: "Overall Radius" }
|
||||
Slider { id: topLeftSlider; from: -1; to: 200; value: -1; Kirigami.FormData.label: "Top Left Radius" }
|
||||
Slider { id: topRightSlider; from: -1; to: 200; value: -1; Kirigami.FormData.label: "Top Right Radius" }
|
||||
Slider { id: bottomLeftSlider; from: -1; to: 200; value: -1; Kirigami.FormData.label: "Bottom Left Radius" }
|
||||
Slider { id: bottomRightSlider; from: -1; to: 200; value: -1; Kirigami.FormData.label: "Bottom Right Radius" }
|
||||
|
||||
Slider { id: sizeSlider; from: 0; to: 100; Kirigami.FormData.label: "Shadow Size" }
|
||||
Slider { id: xOffsetSlider; from: -100; to: 100; Kirigami.FormData.label: "Shadow X-Offset" }
|
||||
Slider { id: yOffsetSlider; from: -100; to: 100; Kirigami.FormData.label: "Shadow Y-Offset" }
|
||||
|
||||
Slider { id: borderWidthSlider; from: 0; to: 50; Kirigami.FormData.label: "Border Width" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2020 Arjen Hiemstra <ahiemstra@heimr.nl>
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.0-or-later
|
||||
*/
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
import org.kde.kirigami as Kirigami
|
||||
|
||||
Kirigami.ApplicationWindow {
|
||||
width: 600
|
||||
height: 800
|
||||
visible: true
|
||||
|
||||
pageStack.initialPage: Kirigami.Page {
|
||||
leftPadding: 0
|
||||
rightPadding: 0
|
||||
topPadding: 0
|
||||
bottomPadding: 0
|
||||
|
||||
Column {
|
||||
anchors.centerIn: parent
|
||||
|
||||
Kirigami.ShadowedRectangle {
|
||||
width: 400
|
||||
height: 300
|
||||
|
||||
color: Kirigami.Theme.highlightColor
|
||||
|
||||
radius: radiusSlider.value
|
||||
|
||||
shadow.size: sizeSlider.value
|
||||
shadow.xOffset: xOffsetSlider.value
|
||||
shadow.yOffset: yOffsetSlider.value
|
||||
|
||||
border.width: borderWidthSlider.value
|
||||
border.color: Kirigami.Theme.textColor
|
||||
|
||||
corners.topLeftRadius: topLeftSlider.value
|
||||
corners.topRightRadius: topRightSlider.value
|
||||
corners.bottomLeftRadius: bottomLeftSlider.value
|
||||
corners.bottomRightRadius: bottomRightSlider.value
|
||||
}
|
||||
|
||||
Kirigami.FormLayout {
|
||||
Item { Kirigami.FormData.isSection: true }
|
||||
|
||||
Slider { id: radiusSlider; from: 0; to: 200; Kirigami.FormData.label: "Overall Radius" }
|
||||
Slider { id: topLeftSlider; from: -1; to: 200; value: -1; Kirigami.FormData.label: "Top Left Radius" }
|
||||
Slider { id: topRightSlider; from: -1; to: 200; value: -1; Kirigami.FormData.label: "Top Right Radius" }
|
||||
Slider { id: bottomLeftSlider; from: -1; to: 200; value: -1; Kirigami.FormData.label: "Bottom Left Radius" }
|
||||
Slider { id: bottomRightSlider; from: -1; to: 200; value: -1; Kirigami.FormData.label: "Bottom Right Radius" }
|
||||
|
||||
Slider { id: sizeSlider; from: 0; to: 100; Kirigami.FormData.label: "Shadow Size" }
|
||||
Slider { id: xOffsetSlider; from: -100; to: 100; Kirigami.FormData.label: "Shadow X-Offset" }
|
||||
Slider { id: yOffsetSlider; from: -100; to: 100; Kirigami.FormData.label: "Shadow Y-Offset" }
|
||||
|
||||
Slider { id: borderWidthSlider; from: 0; to: 50; Kirigami.FormData.label: "Border Width" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2016 Aleix Pol Gonzalez <aleixpol@kde.org>
|
||||
* SPDX-FileCopyrightText: 2016 Marco Martin <mart@kde.org>
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.0-or-later
|
||||
*/
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls as QQC2
|
||||
import org.kde.kirigami as Kirigami
|
||||
|
||||
Kirigami.ApplicationWindow {
|
||||
id: main
|
||||
|
||||
pageStack.initialPage: Kirigami.Page {
|
||||
QQC2.Button {
|
||||
text: "button"
|
||||
onClicked: menu.popup()
|
||||
QQC2.Menu {
|
||||
id: menu
|
||||
|
||||
QQC2.MenuItem { text: "xxx" }
|
||||
QQC2.MenuItem { text: "xxx" }
|
||||
QQC2.Menu {
|
||||
title: "yyy"
|
||||
QQC2.MenuItem { text: "yyy" }
|
||||
QQC2.MenuItem { text: "yyy" }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
title: "aaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa"
|
||||
|
||||
QQC2.ActionGroup {
|
||||
id: group
|
||||
}
|
||||
|
||||
actions: [
|
||||
Kirigami.Action {
|
||||
text: "submenus"
|
||||
icon.name: "kalgebra"
|
||||
|
||||
Kirigami.Action { text: "xxx"; onTriggered: console.log("xxx") }
|
||||
Kirigami.Action { text: "xxx"; onTriggered: console.log("xxx") }
|
||||
Kirigami.Action { text: "xxx"; onTriggered: console.log("xxx") }
|
||||
Kirigami.Action {
|
||||
text: "yyy"
|
||||
Kirigami.Action { text: "yyy" }
|
||||
Kirigami.Action { text: "yyy" }
|
||||
Kirigami.Action { text: "yyy" }
|
||||
Kirigami.Action { text: "yyy" }
|
||||
}
|
||||
},
|
||||
Kirigami.Action {
|
||||
id: optionsAction
|
||||
text: "Options"
|
||||
icon.name: "kate"
|
||||
|
||||
Kirigami.Action {
|
||||
QQC2.ActionGroup.group: group
|
||||
text: "A"
|
||||
checkable: true
|
||||
checked: true
|
||||
}
|
||||
Kirigami.Action {
|
||||
QQC2.ActionGroup.group: group
|
||||
text: "B"
|
||||
checkable: true
|
||||
}
|
||||
Kirigami.Action {
|
||||
QQC2.ActionGroup.group: group
|
||||
text: "C"
|
||||
checkable: true
|
||||
}
|
||||
},
|
||||
Kirigami.Action { text: "stuffing..." },
|
||||
Kirigami.Action { text: "stuffing..." },
|
||||
Kirigami.Action { text: "stuffing..." },
|
||||
Kirigami.Action { text: "stuffing..." },
|
||||
Kirigami.Action { text: "stuffing..." }
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2018 Aleix Pol Gonzalez <aleixpol@kde.org>
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.0-or-later
|
||||
*/
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
import org.kde.kirigami as Kirigami
|
||||
|
||||
Kirigami.ApplicationWindow {
|
||||
|
||||
Component {
|
||||
id: delegateComponent
|
||||
Kirigami.Card {
|
||||
contentItem: Label { text: ourlist.prefix + index }
|
||||
}
|
||||
}
|
||||
|
||||
pageStack.initialPage: Kirigami.ScrollablePage {
|
||||
|
||||
Kirigami.CardsListView {
|
||||
id: ourlist
|
||||
property string prefix: "ciao "
|
||||
|
||||
delegate: delegateComponent
|
||||
|
||||
model: 100
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2018 Aleix Pol Gonzalez <aleixpol@kde.org>
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.0-or-later
|
||||
*/
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
|
||||
import org.kde.kirigami as Kirigami
|
||||
|
||||
Kirigami.ApplicationWindow {
|
||||
|
||||
Component {
|
||||
id: delegateComponent
|
||||
Kirigami.Card {
|
||||
contentItem: Label { text: ourlist.prefix + index }
|
||||
}
|
||||
}
|
||||
|
||||
pageStack.initialPage: Kirigami.Page {
|
||||
actions: [
|
||||
Kirigami.Action {
|
||||
text: "Switch Icon"
|
||||
onTriggered: {
|
||||
if (icon.source === "home") {
|
||||
icon.source = "window-new";
|
||||
} else {
|
||||
icon.source = "home";
|
||||
}
|
||||
}
|
||||
},
|
||||
Kirigami.Action {
|
||||
text: "Enabled"
|
||||
checkable: true
|
||||
checked: icon.enabled
|
||||
onTriggered: icon.enabled = !icon.enabled
|
||||
},
|
||||
Kirigami.Action {
|
||||
text: "Animated"
|
||||
checkable: true
|
||||
checked: icon.animated
|
||||
onTriggered: icon.animated = !icon.animated
|
||||
},
|
||||
Kirigami.Action {
|
||||
displayComponent: RowLayout {
|
||||
Label {
|
||||
text: "Size:"
|
||||
}
|
||||
SpinBox {
|
||||
from: 0
|
||||
to: Kirigami.Units.iconSizes.enormous
|
||||
value: Kirigami.Units.iconSizes.large
|
||||
onValueModified: {
|
||||
icon.width = value;
|
||||
icon.height = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
Kirigami.Icon {
|
||||
id: icon
|
||||
width: Kirigami.Units.iconSizes.Large
|
||||
height: width
|
||||
source: "home"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2016 Aleix Pol Gonzalez <aleixpol@kde.org>
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.0-or-later
|
||||
*/
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
import org.kde.kirigami as Kirigami
|
||||
|
||||
Kirigami.ApplicationWindow {
|
||||
id: main
|
||||
|
||||
pageStack.initialPage: Kirigami.ScrollablePage {
|
||||
ListView {
|
||||
model: 25
|
||||
delegate: Kirigami.SwipeListItem {
|
||||
supportsMouseEvents: false
|
||||
actions: [
|
||||
Kirigami.Action {
|
||||
icon.name: "go-up"
|
||||
}
|
||||
]
|
||||
contentItem: Label {
|
||||
elide: Text.ElideRight
|
||||
text: "big banana big banana big banana big banana big banana big banana big banana big banana big banana big banana big banana big banana big banana big banana big banana big banana big banana big banana big banana big banana"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/* SPDX-FileCopyrightText: 2021 Noah Davis <noahadvs@gmail.com>
|
||||
* SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
|
||||
*/
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Templates as T
|
||||
import QtQuick.Controls as QQC2
|
||||
|
||||
import org.kde.kirigami as Kirigami
|
||||
|
||||
T.ScrollView {
|
||||
id: control
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
contentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
contentHeight + topPadding + bottomPadding)
|
||||
|
||||
leftPadding: mirrored && T.ScrollBar.vertical && T.ScrollBar.vertical.visible && !Kirigami.Settings.isMobile ? T.ScrollBar.vertical.width : 0
|
||||
rightPadding: !mirrored && T.ScrollBar.vertical && T.ScrollBar.vertical.visible && !Kirigami.Settings.isMobile ? T.ScrollBar.vertical.width : 0
|
||||
bottomPadding: T.ScrollBar.horizontal && T.ScrollBar.horizontal.visible && !Kirigami.Settings.isMobile ? T.ScrollBar.horizontal.height : 0
|
||||
|
||||
data: [
|
||||
Kirigami.WheelHandler {
|
||||
id: wheelHandler
|
||||
target: control.contentItem
|
||||
}
|
||||
]
|
||||
|
||||
T.ScrollBar.vertical: QQC2.ScrollBar {
|
||||
parent: control
|
||||
x: control.mirrored ? 0 : control.width - width
|
||||
y: control.topPadding
|
||||
height: control.availableHeight
|
||||
active: control.T.ScrollBar.horizontal.active
|
||||
stepSize: wheelHandler.verticalStepSize / control.contentHeight
|
||||
}
|
||||
|
||||
T.ScrollBar.horizontal: QQC2.ScrollBar {
|
||||
parent: control
|
||||
x: control.leftPadding
|
||||
y: control.height - height
|
||||
width: control.availableWidth
|
||||
active: control.T.ScrollBar.vertical.active
|
||||
stepSize: wheelHandler.horizontalStepSize / control.contentWidth
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
/* SPDX-FileCopyrightText: 2021 Noah Davis <noahadvs@gmail.com>
|
||||
* SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
|
||||
*/
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls as QQC2
|
||||
|
||||
import org.kde.kirigami as Kirigami
|
||||
|
||||
QQC2.ApplicationWindow {
|
||||
id: root
|
||||
width: flickable.implicitWidth
|
||||
height: flickable.implicitHeight
|
||||
visible: true
|
||||
|
||||
Flickable {
|
||||
id: flickable
|
||||
anchors.fill: parent
|
||||
implicitWidth: wheelHandler.horizontalStepSize * 10 + leftMargin + rightMargin
|
||||
implicitHeight: wheelHandler.verticalStepSize * 10 + topMargin + bottomMargin
|
||||
|
||||
leftMargin: QQC2.ScrollBar.vertical.visible && QQC2.ScrollBar.vertical.mirrored ? QQC2.ScrollBar.vertical.width : 0
|
||||
rightMargin: QQC2.ScrollBar.vertical.visible && !QQC2.ScrollBar.vertical.mirrored ? QQC2.ScrollBar.vertical.width : 0
|
||||
bottomMargin: QQC2.ScrollBar.horizontal.visible ? QQC2.ScrollBar.horizontal.height : 0
|
||||
|
||||
contentWidth: contentItem.childrenRect.width
|
||||
contentHeight: contentItem.childrenRect.height
|
||||
|
||||
Kirigami.WheelHandler {
|
||||
id: wheelHandler
|
||||
target: flickable
|
||||
filterMouseEvents: true
|
||||
keyNavigationEnabled: true
|
||||
}
|
||||
|
||||
QQC2.ScrollBar.vertical: QQC2.ScrollBar {
|
||||
parent: flickable.parent
|
||||
height: flickable.height - flickable.topMargin - flickable.bottomMargin
|
||||
x: mirrored ? 0 : flickable.width - width
|
||||
y: flickable.topMargin
|
||||
active: flickable.QQC2.ScrollBar.horizontal.active
|
||||
stepSize: wheelHandler.verticalStepSize / flickable.contentHeight
|
||||
}
|
||||
|
||||
QQC2.ScrollBar.horizontal: QQC2.ScrollBar {
|
||||
parent: flickable.parent
|
||||
width: flickable.width - flickable.leftMargin - flickable.rightMargin
|
||||
x: flickable.leftMargin
|
||||
y: flickable.height - height
|
||||
active: flickable.QQC2.ScrollBar.vertical.active
|
||||
stepSize: wheelHandler.horizontalStepSize / flickable.contentWidth
|
||||
}
|
||||
|
||||
Grid {
|
||||
columns: Math.sqrt(visibleChildren.length)
|
||||
Repeater {
|
||||
model: 500
|
||||
delegate: Rectangle {
|
||||
implicitWidth: wheelHandler.horizontalStepSize
|
||||
implicitHeight: wheelHandler.verticalStepSize
|
||||
gradient: Gradient {
|
||||
orientation: index % 2 ? Gradient.Vertical : Gradient.Horizontal
|
||||
GradientStop { position: 0; color: Qt.rgba(Math.random(),Math.random(),Math.random(),1) }
|
||||
GradientStop { position: 1; color: Qt.rgba(Math.random(),Math.random(),Math.random(),1) }
|
||||
}
|
||||
}
|
||||
}
|
||||
QQC2.Button {
|
||||
id: enableSliderButton
|
||||
width: wheelHandler.horizontalStepSize
|
||||
height: wheelHandler.verticalStepSize
|
||||
contentItem: QQC2.Label {
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: "Enable Slider"
|
||||
wrapMode: Text.Wrap
|
||||
}
|
||||
checked: true
|
||||
}
|
||||
QQC2.Slider {
|
||||
id: slider
|
||||
enabled: enableSliderButton.checked
|
||||
width: wheelHandler.horizontalStepSize
|
||||
height: wheelHandler.verticalStepSize
|
||||
}
|
||||
Repeater {
|
||||
model: 500
|
||||
delegate: Rectangle {
|
||||
implicitWidth: wheelHandler.horizontalStepSize
|
||||
implicitHeight: wheelHandler.verticalStepSize
|
||||
gradient: Gradient {
|
||||
orientation: index % 2 ? Gradient.Vertical : Gradient.Horizontal
|
||||
GradientStop { position: 0; color: Qt.rgba(Math.random(),Math.random(),Math.random(),1) }
|
||||
GradientStop { position: 1; color: Qt.rgba(Math.random(),Math.random(),Math.random(),1) }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
/* SPDX-FileCopyrightText: 2021 Noah Davis <noahadvs@gmail.com>
|
||||
* SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
|
||||
*/
|
||||
|
||||
import QtQuick
|
||||
import QtQml
|
||||
import QtQuick.Templates as T
|
||||
import QtQuick.Controls as QQC2
|
||||
|
||||
import org.kde.kirigami as Kirigami
|
||||
|
||||
QQC2.ApplicationWindow {
|
||||
id: root
|
||||
width: 200 * Qt.styleHints.wheelScrollLines + scrollView.leftPadding + scrollView.rightPadding
|
||||
height: 200 * Qt.styleHints.wheelScrollLines + scrollView.topPadding + scrollView.bottomPadding
|
||||
visible: true
|
||||
ScrollView {
|
||||
id: scrollView
|
||||
anchors.fill: parent
|
||||
Grid {
|
||||
columns: Math.sqrt(visibleChildren.length)
|
||||
Repeater {
|
||||
model: 500
|
||||
delegate: Rectangle {
|
||||
implicitWidth: 20 * Qt.styleHints.wheelScrollLines
|
||||
implicitHeight: 20 * Qt.styleHints.wheelScrollLines
|
||||
gradient: Gradient {
|
||||
orientation: index % 2 ? Gradient.Vertical : Gradient.Horizontal
|
||||
GradientStop { position: 0; color: Qt.rgba(Math.random(),Math.random(),Math.random(),1) }
|
||||
GradientStop { position: 1; color: Qt.rgba(Math.random(),Math.random(),Math.random(),1) }
|
||||
}
|
||||
}
|
||||
}
|
||||
QQC2.Button {
|
||||
id: enableSliderButton
|
||||
width: 20 * Qt.styleHints.wheelScrollLines
|
||||
height: 20 * Qt.styleHints.wheelScrollLines
|
||||
contentItem: QQC2.Label {
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: "Enable Slider"
|
||||
wrapMode: Text.Wrap
|
||||
}
|
||||
checked: true
|
||||
}
|
||||
QQC2.Slider {
|
||||
id: slider
|
||||
enabled: enableSliderButton.checked
|
||||
width: 20 * Qt.styleHints.wheelScrollLines
|
||||
height: 20 * Qt.styleHints.wheelScrollLines
|
||||
}
|
||||
Repeater {
|
||||
model: 500
|
||||
delegate: Rectangle {
|
||||
implicitWidth: 20 * Qt.styleHints.wheelScrollLines
|
||||
implicitHeight: 20 * Qt.styleHints.wheelScrollLines
|
||||
gradient: Gradient {
|
||||
orientation: index % 2 ? Gradient.Vertical : Gradient.Horizontal
|
||||
GradientStop { position: 0; color: Qt.rgba(Math.random(),Math.random(),Math.random(),1) }
|
||||
GradientStop { position: 1; color: Qt.rgba(Math.random(),Math.random(),Math.random(),1) }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+26
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user