Commit e730b575 authored by Marco Martin's avatar Marco Martin
Browse files

adapt wallpapers delegates

parent da45db54
......@@ -39,10 +39,10 @@ PlasmaComponents.ItemDelegate {
listView.currentIndex = index
}
leftPadding: units.largeSpacing*2
topPadding: units.largeSpacing*2
rightPadding: units.largeSpacing*2
bottomPadding: units.largeSpacing*2
leftPadding: units.largeSpacing
topPadding: units.largeSpacing
rightPadding: units.largeSpacing
bottomPadding: units.largeSpacing
Keys.onReturnPressed: {
clicked();
......
......@@ -41,6 +41,11 @@ AbstractDelegate {
}
}
leftPadding: units.largeSpacing*2
topPadding: units.largeSpacing*2
rightPadding: units.largeSpacing*2
bottomPadding: units.largeSpacing*2
Kirigami.Theme.inherit: !imagePalette.useColors
Kirigami.Theme.textColor: imagePalette.textColor
Kirigami.Theme.backgroundColor: imagePalette.backgroundColor
......
/*
* Copyright 2019 Aditya Mehra <aix.m@outlook.com>
* Copyright 2019 Marco Martin <mart@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
*/
import QtQuick 2.9
import QtQuick.Layouts 1.3
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 3.0 as PlasmaComponents
import org.kde.kirigami 2.11 as Kirigami
Kirigami.AbstractCard {
id: delegate
implicitWidth: listView.cellWidth
implicitHeight: listView.height
property string icon
readonly property ListView listView: ListView.view
checked: listView.currentIndex == index
z: listView.currentIndex == index ? 2 : 0
onClicked: {
listView.forceActiveFocus()
console.log(index)
listView.currentIndex = index
console.log(listView.currentIndex)
}
contentItem: ColumnLayout {
spacing: 0
PlasmaCore.IconItem {
id: icon
Layout.fillWidth: true
Layout.fillHeight: true
source: delegate.icon
}
PlasmaComponents.Label {
id: label
visible: text.length > 0
Layout.fillWidth: true
Layout.preferredHeight: root.reservedSpaceForLabel
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignHCenter
maximumLineCount: 2
elide: Text.ElideRight
color: PlasmaCore.ColorScope.textColor
text: delegate.text
}
}
}
......@@ -17,19 +17,12 @@
*/
import QtQuick 2.12
import QtQuick.Layouts 1.0
import QtQuick.Controls 2.3 as Controls
import org.kde.plasma.extras 2.0 as PlasmaExtras
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.configuration 2.0
//for the "simple mode"
import org.kde.plasma.wallpapers.image 2.0 as Wallpaper
import org.kde.kquickcontrolsaddons 2.0 as Addons
import org.kde.kcm 1.1 as KCM
import org.kde.kirigami 2.11 as Kirigami
import org.kde.mycroft.bigscreen 1.0 as BigScreen
Kirigami.AbstractCard {
BigScreen.AbstractDelegate {
id: delegate
width: wallpapersView.cellWidth
height: wallpapersView.cellHeight
......
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