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:
2026-04-14 10:51:06 +01:00
parent 51f3c21121
commit cf12defd28
15214 changed files with 20594243 additions and 269 deletions
@@ -0,0 +1,27 @@
add_library(KirigamiDelegates)
ecm_add_qml_module(KirigamiDelegates URI "org.kde.kirigami.delegates"
GENERATE_PLUGIN_SOURCE
INSTALLED_PLUGIN_TARGET KF6KirigamiDelegates
DEPENDENCIES QtQuick org.kde.kirigami.platform org.kde.kirigami.primitives
)
ecm_target_qml_sources(KirigamiDelegates SOURCES
IconTitleSubtitle.qml
TitleSubtitle.qml
SubtitleDelegate.qml
CheckSubtitleDelegate.qml
RadioSubtitleDelegate.qml
SwitchSubtitleDelegate.qml
)
set_target_properties(KirigamiDelegates PROPERTIES
VERSION ${PROJECT_VERSION}
SOVERSION 6
EXPORT_NAME "KirigamiDelegates"
)
ecm_finalize_qml_module(KirigamiDelegates EXPORT KirigamiTargets)
install(TARGETS KirigamiDelegates EXPORT KirigamiTargets ${KF_INSTALL_TARGETS_DEFAULT_ARGS})
@@ -0,0 +1,47 @@
/*
* SPDX-FileCopyrightText: 2023 Arjen Hiemstra <ahiemstra@heimr.nl>
*
* SPDX-License-Identifier: LGPL-2.0-or-later
*/
import QtQuick
import QtQuick.Controls as QQC2
import org.kde.kirigami.platform as Platform
/**
* A convenience wrapper combining QtQuick Controls CheckDelegate and IconTitleSubtitle
*
* This is an intentionally minimal wrapper that replaces the CheckDelegate's
* contentItem with an IconTitleSubtitle and adds a subtitle property.
*
* If you wish to customize the layout further, create your own `CheckDelegate`
* subclass with the `contentItem:` property set to the content of your choice.
* This can include `IconTitleSubtitle` inside a Layout, for example.
*
* \note If you don't need a subtitle, use `CheckDelegate` directly.
*
* \sa Kirigami::Delegates::TitleSubtitle
* \sa Kirigami::Delegates::IconTitleSubtitle
*/
QQC2.CheckDelegate {
id: delegate
// Please see the developer note in ItemDelegate
/**
* The subtitle to display.
*/
property string subtitle
QQC2.ToolTip.text: text + (subtitle.length > 0 ? "\n\n" + subtitle : "")
QQC2.ToolTip.visible: (Platform.Settings.tabletMode ? down : hovered) && (contentItem?.truncated ?? false)
QQC2.ToolTip.delay: Platform.Units.toolTipDelay
contentItem: IconTitleSubtitle {
icon: icon.fromControlsIcon(delegate.icon)
title: delegate.text
subtitle: delegate.subtitle
selected: delegate.highlighted || delegate.down
font: delegate.font
}
}
@@ -0,0 +1,164 @@
/*
* SPDX-FileCopyrightText: 2010 Marco Martin <notmart@gmail.com>
* SPDX-FileCopyrightText: 2022 ivan tkachenko <me@ratijas.tk>
* SPDX-FileCopyrightText: 2023 Arjen Hiemstra <ahiemstra@heimr.nl>
*
* SPDX-License-Identifier: LGPL-2.0-or-later
*/
import QtQuick
import org.kde.kirigami.platform as Platform
import org.kde.kirigami.primitives as Primitives
import org.kde.kirigami.templates.private as KTP
/**
* A simple item containing an icon, title and subtitle.
*
* This is an extension of TitleSubtitle that adds an icon to the side.
* It is intended as a contentItem for ItemDelegate and related controls.
*
* When using it as a contentItem, make sure to bind the appropriate properties
* to those of the Control. Prefer binding to the Control's properties over
* setting the properties directly, as the Control's properties may affect other
* things like setting accessible names.
*
* This (and TitleSubtitle) can be combined with other controls in a layout to
* create complex content items for controls.
*
* Example usage creating a CheckDelegate with an extra button on the side:
*
* ```qml
* CheckDelegate {
* id: delegate
*
* text: "Example"
* icon.name: "document-new"
*
* contentItem: RowLayout {
* spacing: Kirigami.Units.smallSpacing
*
* Kirigami.IconTitleSubtitle {
* Layout.fillWidth: true
*
* icon: icon.fromControlsIcon(delegate.icon)
* title: delegate.text
* selected: delegate.highlighted || delegate.down
* font: delegate.font
* }
*
* Button {
* icon.name: "document-open"
* text: "Extra Action"
* }
* }
* }
* ```
*
* \sa Kirigami::Delegates::TitleSubtitle
* \sa Kirigami::Delegates::ItemDelegate
*/
Item {
id: root
/**
* @copydoc Kirigami::TitleSubtitle::title
*/
required property string title
/**
* @copydoc Kirigami::TitleSubtitle::subtitle
*/
property alias subtitle: titleSubtitle.subtitle
/**
* @copydoc Kirigami::TitleSubtitle::color
*/
property alias color: titleSubtitle.color
/**
* @copydoc Kirigami::TitleSubtitle::subtitleColor
*/
property alias subtitleColor: titleSubtitle.subtitleColor
/**
* @copydoc Kirigami::TitleSubtitle::font
*/
property alias font: titleSubtitle.font
/**
* @copydoc Kirigami::TitleSubtitle::subtitleFont
*/
property alias subtitleFont: titleSubtitle.subtitleFont
/**
* @copydoc Kirigami::TitleSubtitle::reserveSpaceForSubtitle
*/
property alias reserveSpaceForSubtitle: titleSubtitle.reserveSpaceForSubtitle
/**
* @copydoc Kirigami::TitleSubtitle::selected
*/
property alias selected: titleSubtitle.selected
/**
* @copydoc Kirigami::TitleSubtitle::elide
*/
property alias elide: titleSubtitle.elide
/**
* @copydoc Kirigami::TitleSubtitle::wrapMode
*/
property alias wrapMode: titleSubtitle.wrapMode
/**
* @copydoc Kirigami::TitleSubtitle::truncated
*/
property alias truncated: titleSubtitle.truncated
/**
* Grouped property for icon properties.
*
* \note By default, IconTitleSubtitle will reserve the space for the icon,
* even if it is not set. To remove that space, set `icon.width` to 0.
*/
property KTP.IconPropertiesGroup icon: KTP.IconPropertiesGroup {
width: titleSubtitle.subtitleVisible ? Platform.Units.iconSizes.medium : Platform.Units.iconSizes.smallMedium
height: width
}
/**
* @copydoc Kirigami::TitleSubtitle::linkActivated
*/
signal linkActivated(string link)
/**
* @copydoc Kirigami::TitleSubtitle::linkHovered
*/
signal linkHovered(string link)
implicitWidth: iconItem.implicitWidth + titleSubtitle.anchors.leftMargin + titleSubtitle.implicitWidth
implicitHeight: Math.max(iconItem.implicitHeight, titleSubtitle.implicitHeight)
Primitives.Icon {
id: iconItem
anchors {
left: parent.left
top: parent.top
bottom: parent.bottom
}
source: root.icon.name.length > 0 ? root.icon.name : root.icon.source
implicitWidth: root.icon.width
implicitHeight: root.icon.height
selected: root.selected
color: root.icon.color
}
TitleSubtitle {
id: titleSubtitle
anchors {
left: iconItem.right
leftMargin: root.icon.width > 0 ? Platform.Units.mediumSpacing : 0
top: parent.top
bottom: parent.bottom
right: parent.right
}
title: root.title
onLinkActivated: link => root.linkActivated(link)
onLinkHovered: link => root.linkHovered(link)
}
}
@@ -0,0 +1,12 @@
# Kirigami Delegates Module
This module contains custom delegates and types used to build delegates from.
# What goes here
The following criteria should be used to determine if a type belongs here:
- Custom delegate types.
- Types used to build custom delegate types.
- Types are allowed to depend on QtQuick Controls.
- Types are only allowed to depend on the Platform and Primitives submodules.
@@ -0,0 +1,48 @@
/*
* SPDX-FileCopyrightText: 2023 Arjen Hiemstra <ahiemstra@heimr.nl>
*
* SPDX-License-Identifier: LGPL-2.0-or-later
*/
import QtQuick
import QtQuick.Controls as QQC2
import org.kde.kirigami.platform as Platform
/**
* A convenience wrapper combining QtQuick Controls RadioDelegate and IconTitleSubtitle
*
* This is an intentionally minimal wrapper that replaces the RadioDelegate's
* contentItem with an IconTitleSubtitle and adds a subtitle property.
*
* If you wish to customize the layout further, create your own `RadioDelegate`
* subclass with the `contentItem:` property set to the content of your choice.
* This can include `IconTitleSubtitle` inside a Layout, for example.
*
* \note If you don't need a subtitle, use `RadioDelegate` directly.
*
* \sa Kirigami::Delegates::TitleSubtitle
* \sa Kirigami::Delegates::IconTitleSubtitle
*/
QQC2.RadioDelegate {
id: delegate
// Please see the developer note in ItemDelegate
/**
* The subtitle to display.
*/
property string subtitle
QQC2.ToolTip.text: text + (subtitle.length > 0 ? "\n\n" + subtitle : "")
QQC2.ToolTip.visible: (Platform.Settings.tabletMode ? down : hovered) && (contentItem?.truncated ?? false)
QQC2.ToolTip.delay: Platform.Units.toolTipDelay
contentItem: IconTitleSubtitle {
icon: icon.fromControlsIcon(delegate.icon)
title: delegate.text
subtitle: delegate.subtitle
selected: delegate.highlighted || delegate.down
font: delegate.font
}
}
@@ -0,0 +1,51 @@
/*
* SPDX-FileCopyrightText: 2023 Arjen Hiemstra <ahiemstra@heimr.nl>
*
* SPDX-License-Identifier: LGPL-2.0-or-later
*/
import QtQuick
import QtQuick.Controls as QQC2
import org.kde.kirigami.platform as Platform
/**
* A convenience wrapper combining QtQuick Controls ItemDelegate and IconTitleSubtitle
*
* This is an intentionally minimal wrapper that replaces the ItemDelegate's
* contentItem with an IconTitleSubtitle and adds a subtitle property.
*
* If you wish to customize the layout further, create your own `ItemDelegate`
* subclass with the `contentItem:` property set to the content of your choice.
* This can include `IconTitleSubtitle` inside a Layout, for example.
*
* \note If you don't need a subtitle, use `ItemDelegate` directly.
*
* \sa Kirigami::Delegates::TitleSubtitle
* \sa Kirigami::Delegates::IconTitleSubtitle
*/
QQC2.ItemDelegate {
id: delegate
// Developer note: This is intentional kept incredibly minimal as we want to
// reuse as much of upstream ItemDelegate as possible, the only extra thing
// being the subtitle property. Should that ever become an upstream feature,
// these controls will be removed in favour of using upstream's implementation
// directly.
/**
* The subtitle to display.
*/
property string subtitle
QQC2.ToolTip.text: text + (subtitle.length > 0 ? "\n\n" + subtitle : "")
QQC2.ToolTip.visible: (Platform.Settings.tabletMode ? down : hovered) && (contentItem?.truncated ?? false)
QQC2.ToolTip.delay: Platform.Units.toolTipDelay
contentItem: IconTitleSubtitle {
icon: icon.fromControlsIcon(delegate.icon)
title: delegate.text
subtitle: delegate.subtitle
selected: delegate.highlighted || delegate.down
font: delegate.font
}
}
@@ -0,0 +1,47 @@
/*
* SPDX-FileCopyrightText: 2023 Arjen Hiemstra <ahiemstra@heimr.nl>
*
* SPDX-License-Identifier: LGPL-2.0-or-later
*/
import QtQuick
import QtQuick.Controls as QQC2
import org.kde.kirigami.platform as Platform
/**
* A convenience wrapper combining QtQuick Controls SwitchDelegate and IconTitleSubtitle
*
* This is an intentionally minimal wrapper that replaces the SwitchDelegate's
* contentItem with an IconTitleSubtitle and adds a subtitle property.
*
* If you wish to customize the layout further, create your own `SwitchDelegate`
* subclass with the `contentItem:` property set to the content of your choice.
* This can include `IconTitleSubtitle` inside a Layout, for example.
*
* \note If you don't need a subtitle, use `SwitchDelegate` directly.
*
* \sa Kirigami::Delegates::TitleSubtitle
* \sa Kirigami::Delegates::IconTitleSubtitle
*/
QQC2.SwitchDelegate {
id: delegate
// Please see the developer note in ItemDelegate
/**
* The subtitle to display.
*/
property string subtitle
QQC2.ToolTip.text: text + (subtitle.length > 0 ? "\n\n" + subtitle : "")
QQC2.ToolTip.visible: (Platform.Settings.tabletMode ? down : hovered) && (contentItem?.truncated ?? false)
QQC2.ToolTip.delay: Platform.Units.toolTipDelay
contentItem: IconTitleSubtitle {
icon: icon.fromControlsIcon(delegate.icon)
title: delegate.text
subtitle: delegate.subtitle
selected: delegate.highlighted || delegate.down
font: delegate.font
}
}
@@ -0,0 +1,185 @@
/*
* SPDX-FileCopyrightText: 2010 Marco Martin <notmart@gmail.com>
* SPDX-FileCopyrightText: 2022 ivan tkachenko <me@ratijas.tk>
* SPDX-FileCopyrightText: 2023 Arjen Hiemstra <ahiemstra@heimr.nl>
*
* SPDX-License-Identifier: LGPL-2.0-or-later
*/
import QtQuick
import org.kde.kirigami.platform as Platform
/**
* A simple item containing a title and subtitle label.
*
* This is mainly intended as a replacement for a list delegate content item,
* but can be used as a replacement for other content items as well.
*
* When using it as a contentItem, make sure to bind the appropriate properties
* to those of the Control. Prefer binding to the Control's properties over
* setting the properties directly, as the Control's properties may affect other
* things like setting accessible names.
*
* Example usage as contentItem of an ItemDelegate:
*
* ```qml
* ItemDelegate {
* id: delegate
*
* text: "Example"
*
* contentItem: Kirigami.TitleSubtitle {
* title: delegate.text
* subtitle: "This is an example."
* font: delegate.font
* selected: delegate.highlighted || delegate.down
* }
* }
* ```
*
* \sa Kirigami::Delegates::IconTitleSubtitle
* \sa Kirigami::Delegates::ItemDelegate
*/
Item {
id: root
/**
* The title to display.
*/
required property string title
/**
* The subtitle to display.
*/
property string subtitle
/**
* The color to use for the title.
*
* By default this is `Kirigami.Theme.textColor` unless `selected` is true
* in which case this is `Kirigami.Theme.highlightedTextColor`.
*/
property color color: selected ? Platform.Theme.highlightedTextColor : Platform.Theme.textColor
/**
* The color to use for the subtitle.
*
* By default this is `color` mixed with the background color.
*/
property color subtitleColor: selected
? Platform.Theme.highlightedTextColor
: Platform.ColorUtils.linearInterpolation(color, Platform.Theme.backgroundColor, 0.3)
/**
* The font used to display the title.
*/
property font font: Platform.Theme.defaultFont
/**
* The font used to display the subtitle.
*/
property font subtitleFont: Platform.Theme.smallFont
/**
* The text elision mode used for both the title and subtitle.
*/
property int elide: Text.ElideRight
/**
* The text wrap mode used for both the title and subtitle.
*/
property int wrapMode: Text.NoWrap
/**
* Make the implicit height use the subtitle's height even if no subtitle is set.
*/
property bool reserveSpaceForSubtitle: false
/**
* Should this item be displayed in a selected style?
*/
property bool selected: false
/**
* Is the subtitle visible?
*/
// Note: Don't rely on subtitleItem.visible because visibility is an
// implicitly propagated property, and we don't wanna re-layout on
// hide/show events. Copy-paste its bound expression instead.
readonly property bool subtitleVisible: subtitle.length > 0 || reserveSpaceForSubtitle
/**
* Is the title or subtitle truncated?
*/
readonly property bool truncated: labelItem.truncated || subtitleItem.truncated
/**
* @brief Emitted when the user clicks on a link embedded in the text of the title or subtitle.
*/
signal linkActivated(string link)
/**
* @brief Emitted when the user hovers on a link embedded in the text of the title or subtitle.
*/
signal linkHovered(string link)
implicitWidth: Math.max(labelItem.implicitWidth, subtitleItem.implicitWidth)
implicitHeight: labelItem.implicitHeight + (subtitleVisible ? subtitleItem.implicitHeight : 0)
Text {
id: labelItem
anchors {
left: parent.left
right: parent.right
verticalCenter: parent.verticalCenter
}
// Switch off here as this is expected to be set in the base component.
Accessible.ignored: true
text: root.title
color: root.color
font: root.font
elide: root.elide
wrapMode: root.wrapMode
onLinkActivated: link => root.linkActivated(link)
onLinkHovered: link => root.linkHovered(link)
// Work around Qt bug where left aligned text is not right aligned
// in RTL mode unless horizontalAlignment is explicitly set.
// https://bugreports.qt.io/browse/QTBUG-95873
horizontalAlignment: Text.AlignLeft
// Note: Can't do this through ordinary bindings as the order between
// binding evaluation is not defined which leads to incorrect sizing or
// the QML engine complaining about not being able to anchor to null items.
states: State {
// Note: Same thing about visibility as in subtitleVisible above.
when: root.subtitle.length > 0
AnchorChanges {
target: labelItem
anchors.verticalCenter: undefined
anchors.bottom: subtitleItem.top
}
}
}
Text {
id: subtitleItem
anchors {
left: parent.left
right: parent.right
bottom: parent.bottom
}
text: root.subtitle
color: root.subtitleColor
font: root.subtitleFont
elide: root.elide
wrapMode: root.wrapMode
visible: text.length > 0
onLinkActivated: link => root.linkActivated(link)
onLinkHovered: link => root.linkHovered(link)
// Work around Qt bug where left aligned text is not right aligned
// in RTL mode unless horizontalAlignment is explicitly set.
// https://bugreports.qt.io/browse/QTBUG-95873
horizontalAlignment: Text.AlignLeft
renderType: Text.NativeRendering
}
}