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).
master
Johan Ouwerkerk 2020-05-26 21:38:05 +02:00
parent 2281b5a6e9
commit 077e0b82d7
2 changed files with 12 additions and 1 deletions

View File

@ -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

View File

@ -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