diff --git a/kcms/cursortheme/package/contents/ui/Delegate.qml b/kcms/cursortheme/package/contents/ui/Delegate.qml index b8ea7f8f7..691408c7a 100644 --- a/kcms/cursortheme/package/contents/ui/Delegate.qml +++ b/kcms/cursortheme/package/contents/ui/Delegate.qml @@ -1,57 +1,66 @@ /* Copyright (c) 2015 Marco Martin This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License version 2 as published by the Free Software Foundation. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.1 +import QtQuick.Window 2.2 import QtQuick.Layouts 1.1 import QtQuick.Controls 2.2 as Controls import QtQuick.Templates 2.2 as T2 import QtGraphicalEffects 1.0 import org.kde.kirigami 2.2 as Kirigami import org.kde.kcm 1.0 import org.kde.private.kcm_cursortheme 1.0 GridDelegate { id: delegate text: model.display toolTip: model.description thumbnail: PreviewWidget { id: previewWidget - anchors.fill: parent + //for cursor themes we must ignore the native scaling, + //as they will be rendered by X11/KWin, ignoring whatever Qt + //scaling + width: parent.width * Screen.devicePixelRatio + height: parent.height * Screen.devicePixelRatio + x: Screen.devicePixelRatio % 1 + y: Screen.devicePixelRatio % 1 + transformOrigin: Item.TopLeft + scale: 1 / Screen.devicePixelRatio themeModel: kcm.cursorsModel currentIndex: index currentSize: parseInt(sizeCombo.currentText) !== NaN ? parseInt(sizeCombo.currentText) : 0 } actions: [ Kirigami.Action { iconName: "edit-delete" tooltip: i18n("Remove Theme") enabled: model.isWritable onTriggered: kcm.removeTheme(index); } ] onClicked: { view.currentIndex = index; view.forceActiveFocus(); } }