From 077e0b82d7899701b744e087bcb889be649531a6 Mon Sep 17 00:00:00 2001 From: Johan Ouwerkerk Date: Tue, 26 May 2020 21:38:05 +0200 Subject: [PATCH] Sort of fix broken SwipeListItem's on Android by setting an implicit height. Also fix positioning of the health indicator rectangle (should be based off of the root SwipeListItem geometry). --- src/contents/ui/TOTPAccountEntryView.qml | 2 +- src/contents/ui/TokenEntryViewLabels.qml | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/contents/ui/TOTPAccountEntryView.qml b/src/contents/ui/TOTPAccountEntryView.qml index e6a35d7..2c82e8a 100644 --- a/src/contents/ui/TOTPAccountEntryView.qml +++ b/src/contents/ui/TOTPAccountEntryView.qml @@ -85,7 +85,7 @@ AccountEntryViewBase { Rectangle { id: health x: - root.leftPadding - y: Math.max(mainLayout.height, mainLayout.implicitHeight) + y: root.height - health.height - root.bottomPadding radius: health.height height: Kirigami.Units.smallSpacing opacity: timeoutIndicatorAnimation.running ? 0.6 : 0 diff --git a/src/contents/ui/TokenEntryViewLabels.qml b/src/contents/ui/TokenEntryViewLabels.qml index 5bac405..3b3cd96 100644 --- a/src/contents/ui/TokenEntryViewLabels.qml +++ b/src/contents/ui/TokenEntryViewLabels.qml @@ -5,12 +5,23 @@ import QtQuick 2.1 import QtQuick.Controls 2.0 as Controls +import org.kde.kirigami 2.8 as Kirigami Item { property string accountName property string tokenValue id: root + /* + * It appears that Kirigami.SwipeListItem is quite broken (at least on Android): without setting an implicitHeight here + * the SwipeListItem which will eventually contain this item is not tall enough even for its own actions! + * + * The work around is to just sort of guess at what an appropriate implicitHeight might be. + * Note that on desktop this does approximately nothing, on Android it seems to set the height to + * Kirigami.Units.iconSizes.small and that appears to be match with the icon size used for SwipeListItem actions there + * as well. + */ + implicitHeight: Math.max(accountNameLabel.height, tokenValueLabel.height, Kirigami.Units.iconSizes.small) Controls.Label { id: accountNameLabel horizontalAlignment: Text.AlignLeft