From eecdc67074fee7fcc55511a539e01b1cb8b85f23 Mon Sep 17 00:00:00 2001 From: Christoph Wolk Date: Thu, 8 Aug 2024 13:37:32 +0200 Subject: [PATCH] plugins/runcommand: use ColumnLayout for ListView The ListView displaying the configured actions currently directly uses a label that is made multi-line by including a newline. As a consequence, eliding the text does not work properly and there is a visual clash with the included action button. It also means that there is a rather pointlessly translatable string that is just there for UI logic. This change modifies the delegate to use a ColumnLayout instead, which enables correct eliding of the labels and more cleanly separates layout and content concerns. --- .../runcommand/kdeconnect_runcommand_config.qml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/plugins/runcommand/kdeconnect_runcommand_config.qml b/plugins/runcommand/kdeconnect_runcommand_config.qml index e6715375f..4a7e04551 100644 --- a/plugins/runcommand/kdeconnect_runcommand_config.qml +++ b/plugins/runcommand/kdeconnect_runcommand_config.qml @@ -5,6 +5,7 @@ */ import QtQuick 2.15 +import QtQuick.Layouts import QtQuick.Controls 2.15 as QQC2 import org.kde.kirigami 2.20 as Kirigami import org.kde.kdeconnect 1.0 @@ -35,8 +36,18 @@ ListView { width: parent.width enabled: true - contentItem: QQC2.Label { - text: i18n("%1
%2", name, command) + contentItem: ColumnLayout { + QQC2.Label { + text: name + Layout.fillWidth: true + elide: Text.ElideRight + } + QQC2.Label { + text: command + font.italic: true + Layout.fillWidth: true + elide: Text.ElideRight + } } actions: Kirigami.Action {