Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

Test with: qmlscene KDecorationButtonTest1.qml

import QtQuick 2.0
import QtQuick.Layouts 1.1
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.kwin.private.kdecoration 1.0 as KDecoration
import org.kde.kquickcontrolsaddons 2.0 as KQuickControlsAddons
Item {
id: main
width: 400
height: 400
KDecoration.Bridge {
id: bridgeItem
plugin: "org.kde.breezeenhanced"
theme: ""
}
KDecoration.Settings {
id: settingsItem
bridge: bridgeItem.bridge
borderSizesIndex: 3 // Normal
}
Item {
id: test1
anchors.left: parent.left
anchors.top: parent.top
anchors.right: parent.right
anchors.margins: units.smallSpacing
height: units.iconSizes.medium
Rectangle {
anchors.fill: buttonPreviewRow
color: theme.backgroundColor
}
RowLayout {
id: buttonPreviewRow
anchors.fill: parent
Repeater {
// https://github.com/KDE/kdecoration/blob/master/src/decorationdefines.h#L33
model: [
5, // Close
4, // Maximize
3, // Minimize
]
KDecoration.Button {
id: button
Layout.fillHeight: true
Layout.preferredWidth: height
bridge: bridgeItem.bridge
settings: settingsItem
type: modelData
}
}
Item { Layout.fillWidth: true }
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.