better icon sizing

This commit is contained in:
Marco Martin 2019-02-07 12:49:06 +01:00
parent f3e1ba0abe
commit 56dc2ad23f
3 changed files with 13 additions and 14 deletions

View file

@ -237,6 +237,7 @@ MouseArea {
model: plasmoid.nativeInterface.applicationListModel model: plasmoid.nativeInterface.applicationListModel
delegate: HomeLauncher { delegate: HomeLauncher {
maximumLineCount: 1 maximumLineCount: 1
iconSize: root.iconSize
} }
move: Transition { move: Transition {

View file

@ -1,13 +1,14 @@
import QtQuick 2.0 import QtQuick 2.5
import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.kio 1.0 as Kio import org.kde.kio 1.0 as Kio
import org.kde.plasma.components 2.0 as PlasmaComponents import org.kde.plasma.components 2.0 as PlasmaComponents
Item { Column {
id: delegateRoot id: delegateRoot
width: applicationsView.cellWidth width: applicationsView.cellWidth
height: applicationsView.cellHeight height: applicationsView.cellHeight
property int iconSize
property var modelData: model property var modelData: model
property bool isDropTarget: delegateRoot != dragDelegate && root.reorderingApps && applicationsView.dragData && applicationsView.dragData.ApplicationStorageIdRole == modelData.ApplicationStorageIdRole property bool isDropTarget: delegateRoot != dragDelegate && root.reorderingApps && applicationsView.dragData && applicationsView.dragData.ApplicationStorageIdRole == modelData.ApplicationStorageIdRole
property alias maximumLineCount: label.maximumLineCount property alias maximumLineCount: label.maximumLineCount
@ -16,12 +17,9 @@ Item {
PlasmaCore.IconItem { PlasmaCore.IconItem {
id: icon id: icon
anchors { anchors.horizontalCenter: parent.horizontalCenter
centerIn: parent width: delegateRoot.iconSize
verticalCenterOffset: -theme.mSize(theme.defaultFont).height height: delegateRoot.iconSize
}
width: parent.height - label.height
height: width
source: modelData.ApplicationIconRole source: modelData.ApplicationIconRole
scale: root.reorderingApps && applicationsView.dragData && applicationsView.dragData.ApplicationStorageIdRole != modelData.ApplicationStorageIdRole ? 0.6 : 1 scale: root.reorderingApps && applicationsView.dragData && applicationsView.dragData.ApplicationStorageIdRole != modelData.ApplicationStorageIdRole ? 0.6 : 1
Behavior on scale { Behavior on scale {
@ -36,11 +34,8 @@ Item {
id: label id: label
visible: text.length > 0 visible: text.length > 0
anchors { anchors.horizontalCenter: parent.horizontalCenter
top: icon.bottom width: icon.width
left: icon.left
right: icon.right
}
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
horizontalAlignment: Qt.AlignHCenter horizontalAlignment: Qt.AlignHCenter

View file

@ -34,7 +34,8 @@ Item {
//BEGIN properties //BEGIN properties
property Item toolBox property Item toolBox
property alias appletsSpace: applicationsView.headerItem property alias appletsSpace: applicationsView.headerItem
property int buttonHeight: units.iconSizes.large + units.gridUnit * 2 readonly property int iconSize: units.iconSizes.large
property int buttonHeight: dragDelegate.height
property bool reorderingApps: false property bool reorderingApps: false
property var layoutManager: LayoutManager property var layoutManager: LayoutManager
//END properties //END properties
@ -431,6 +432,7 @@ Item {
z: 999 z: 999
property int xTarget property int xTarget
property int yTarget property int yTarget
iconSize: root.iconSize
Behavior on opacity { Behavior on opacity {
ParallelAnimation { ParallelAnimation {
@ -496,6 +498,7 @@ Item {
//clip: true //clip: true
delegate: HomeLauncher { delegate: HomeLauncher {
visible: index > 3 visible: index > 3
iconSize: root.iconSize
} }
header: AppletsArea {} header: AppletsArea {}
footer: Item { footer: Item {