From e93529131e8677a4b0d3beff972467259e252e0f Mon Sep 17 00:00:00 2001 From: Symeon Huang Date: Sun, 30 Aug 2020 11:00:30 +0100 Subject: [PATCH] Fix the location of footer. Show last update in the tooltip --- plasmoid/contents/ui/main.qml | 45 +++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/plasmoid/contents/ui/main.qml b/plasmoid/contents/ui/main.qml index 3e233a2..6cfe34b 100644 --- a/plasmoid/contents/ui/main.qml +++ b/plasmoid/contents/ui/main.qml @@ -20,6 +20,7 @@ import QtQuick 2.12 import QtQuick.Layouts 1.12 import QtQml.Models 2.12 import org.kde.plasma.plasmoid 2.0 +import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 2.0 as PlasmaComponents import org.kde.plasma.components 3.0 as PlasmaComponents3 import org.kde.plasma.extras 2.0 as PlasmaExtras @@ -112,8 +113,9 @@ Item { top: headerRow.bottom left: parent.left right: parent.right - bottom: parent.bottom + bottom: footer.top topMargin: units.smallSpacing + bottomMargin: units.smallSpacing } } @@ -138,30 +140,31 @@ Item { stack.push(profileComponent, {symbol, stack}); } } - - footer: RowLayout { - PlasmaComponents3.Label { - Layout.fillWidth: true - font.pointSize: theme.smallestFont.pointSize - font.weight: Font.Thin - font.underline: true - opacity: 0.7 - linkColor: theme.textColor - text: "Powered by Yahoo! Finance" - onLinkActivated: Qt.openUrlExternally(link) - } - PlasmaComponents3.Label { - Layout.alignment: Qt.AlignRight - font.pointSize: theme.smallestFont.pointSize - font.weight: Font.Thin - visible: !!lastUpdated - text: "Last Updated: " + lastUpdated - } - } } } } + PlasmaComponents3.Label { + id: footer + anchors.bottom: parent.bottom + anchors.right: parent.right + + font.pointSize: theme.smallestFont.pointSize + font.weight: Font.Thin + font.underline: true + opacity: 0.7 + linkColor: theme.textColor + text: "Powered by Yahoo! Finance" + onLinkActivated: Qt.openUrlExternally(link) + + PlasmaCore.ToolTipArea { + id: tooltip + anchors.fill: parent + mainText: "Last Updated" + subText: lastUpdated + } + } + Component { id: profileComponent ProfilePage {}