Commit bc25e7c4 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇

[kcmkwin/kwindecoration] Use new API to set cell size properly

Thanks to 5cfdbaa4b081a030a01477fd13c20f710fe58d4b in kdeclarative the implicitCellWidth
and implicitCellHeight of the GridView can be adjusted without hacks.

Differential Revision: https://phabricator.kde.org/D19729
parent 50e74c55
......@@ -24,10 +24,6 @@ import org.kde.kirigami 2.2 as Kirigami
import org.kde.kwin.private.kdecoration 1.0 as KDecoration
KCM.GridView {
property int cellSpacing: 2 * units.largeSpacing
property int previewWidth: 18 * units.gridUnit
property int previewHeight: previewWidth / 1.7
function updateDecoration(item, marginTopLeft, marginBottomRight) {
var mainMargin = units.largeSpacing
var shd = item.shadow
......@@ -42,8 +38,7 @@ KCM.GridView {
view.onCurrentIndexChanged: kcm.theme = view.currentIndex
view.onContentHeightChanged: view.positionViewAtIndex(view.currentIndex, GridView.Visible)
view.cellWidth: previewWidth + cellSpacing
view.cellHeight: previewHeight + cellSpacing
view.implicitCellWidth: Kirigami.Units.gridUnit * 18
view.delegate: KCM.GridDelegate {
text: model.display
......@@ -51,17 +46,9 @@ KCM.GridView {
thumbnailAvailable: true
thumbnail: Rectangle {
anchors.fill: parent
width: previewWidth
height: previewHeight
color: palette.base
clip: true
// Workaround: the thumbnail size can't be otherwise changed
Component.onCompleted: {
parent.parent.width = previewWidth
parent.parent.height = previewHeight
}
KDecoration.Bridge {
id: bridgeItem
plugin: model.plugin
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment