diff options
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/launcher/ActionItem.qml | 60 | ||||
| -rw-r--r-- | modules/launcher/AppItem.qml | 58 |
2 files changed, 65 insertions, 53 deletions
diff --git a/modules/launcher/ActionItem.qml b/modules/launcher/ActionItem.qml index f4f7e2f..800c937 100644 --- a/modules/launcher/ActionItem.qml +++ b/modules/launcher/ActionItem.qml @@ -3,59 +3,65 @@ import "root:/services" import "root:/config" import QtQuick -PaddedRect { +Item { id: root required property Actions.Action modelData required property var list implicitHeight: LauncherConfig.sizes.itemHeight - padding: [Appearance.padding.smaller, Appearance.padding.larger] anchors.left: parent.left anchors.right: parent.right StateLayer { - radius: Appearance.rounding.normal + radius: Appearance.rounding.full function onClicked(): void { root.modelData.onClicked(root.list); } } - MaterialIcon { - id: icon + Item { + anchors.fill: parent + anchors.leftMargin: Appearance.padding.larger + anchors.rightMargin: Appearance.padding.larger + anchors.margins: Appearance.padding.smaller - text: root.modelData.icon - font.pointSize: Appearance.font.size.extraLarge + MaterialIcon { + id: icon - anchors.verticalCenter: parent.verticalCenter - } + text: root.modelData.icon + font.pointSize: Appearance.font.size.extraLarge - Item { - anchors.left: icon.right - anchors.leftMargin: Appearance.spacing.larger - anchors.verticalCenter: icon.verticalCenter + anchors.verticalCenter: parent.verticalCenter + } - implicitWidth: parent.width - icon.width - implicitHeight: childrenRect.height + Item { + anchors.left: icon.right + anchors.leftMargin: Appearance.spacing.larger + anchors.verticalCenter: icon.verticalCenter - StyledText { - id: name + implicitWidth: parent.width - icon.width + implicitHeight: childrenRect.height - text: root.modelData.name - font.pointSize: Appearance.font.size.normal - } + StyledText { + id: name + + text: root.modelData.name + font.pointSize: Appearance.font.size.normal + } - StyledText { - text: root.modelData.desc - font.pointSize: Appearance.font.size.small - color: Colours.alpha(Colours.palette.m3outline, true) + StyledText { + text: root.modelData.desc + font.pointSize: Appearance.font.size.small + color: Colours.alpha(Colours.palette.m3outline, true) - elide: Text.ElideRight - width: root.width - icon.width - Appearance.rounding.normal * 2 + elide: Text.ElideRight + width: root.width - icon.width - Appearance.rounding.normal * 2 - anchors.top: name.bottom + anchors.top: name.bottom + } } } } diff --git a/modules/launcher/AppItem.qml b/modules/launcher/AppItem.qml index 1c4b691..ab815ab 100644 --- a/modules/launcher/AppItem.qml +++ b/modules/launcher/AppItem.qml @@ -5,14 +5,13 @@ import Quickshell import Quickshell.Widgets import QtQuick -PaddedRect { +Item { id: root required property DesktopEntry modelData required property PersistentProperties visibilities implicitHeight: LauncherConfig.sizes.itemHeight - padding: [Appearance.padding.smaller, Appearance.padding.normal] anchors.left: parent.left anchors.right: parent.right @@ -26,39 +25,46 @@ PaddedRect { } } - IconImage { - id: icon + Item { + anchors.fill: parent + anchors.leftMargin: Appearance.padding.larger + anchors.rightMargin: Appearance.padding.larger + anchors.margins: Appearance.padding.smaller - source: Quickshell.iconPath(root.modelData.icon, "image-missing") - implicitSize: parent.height * 0.8 + IconImage { + id: icon - anchors.verticalCenter: parent.verticalCenter - } + source: Quickshell.iconPath(root.modelData.icon, "image-missing") + implicitSize: parent.height * 0.8 - Item { - anchors.left: icon.right - anchors.leftMargin: Appearance.spacing.normal - anchors.verticalCenter: icon.verticalCenter + anchors.verticalCenter: parent.verticalCenter + } - implicitWidth: parent.width - icon.width - implicitHeight: childrenRect.height + Item { + anchors.left: icon.right + anchors.leftMargin: Appearance.spacing.normal + anchors.verticalCenter: icon.verticalCenter - StyledText { - id: name + implicitWidth: parent.width - icon.width + implicitHeight: childrenRect.height - text: root.modelData.name - font.pointSize: Appearance.font.size.normal - } + StyledText { + id: name + + text: root.modelData.name + font.pointSize: Appearance.font.size.normal + } - StyledText { - text: root.modelData.comment || root.modelData.genericName || root.modelData.name - font.pointSize: Appearance.font.size.small - color: Colours.alpha(Colours.palette.m3outline, true) + StyledText { + text: root.modelData.comment || root.modelData.genericName || root.modelData.name + font.pointSize: Appearance.font.size.small + color: Colours.alpha(Colours.palette.m3outline, true) - elide: Text.ElideRight - width: root.width - icon.width - Appearance.rounding.normal * 2 + elide: Text.ElideRight + width: root.width - icon.width - Appearance.rounding.normal * 2 - anchors.top: name.bottom + anchors.top: name.bottom + } } } } |