Changeset View
Changeset View
Standalone View
Standalone View
notifier/plasmoid/contents/ui/Full.qml
Show All 17 Lines | |||||
18 | ***************************************************************************/ | 18 | ***************************************************************************/ | ||
19 | 19 | | |||
20 | import QtQuick 2.1 | 20 | import QtQuick 2.1 | ||
21 | import QtQuick.Layouts 1.1 | 21 | import QtQuick.Layouts 1.1 | ||
22 | import org.kde.plasma.extras 2.0 as PlasmaExtras | 22 | import org.kde.plasma.extras 2.0 as PlasmaExtras | ||
23 | import org.kde.plasma.components 2.0 | 23 | import org.kde.plasma.components 2.0 | ||
24 | import org.kde.discovernotifier 1.0 | 24 | import org.kde.discovernotifier 1.0 | ||
25 | 25 | | |||
26 | ColumnLayout | 26 | Item { | ||
27 | { | 27 | anchors.fill: parent | ||
broulik: We typically do that where the component is used, not in its definition | |||||
28 | | ||||
28 | PlasmaExtras.Heading { | 29 | PlasmaExtras.Heading { | ||
29 | Layout.fillWidth: true | 30 | anchors.left: parent.left | ||
width: parent.width instead of those nachors broulik: `width: parent.width` instead of those nachors
Otherwise the label won't wrap if it's too long… | |||||
31 | anchors.top: parent.top | ||||
broulik: That's the default anyway | |||||
30 | level: 3 | 32 | level: 3 | ||
31 | wrapMode: Text.WordWrap | 33 | wrapMode: Text.WordWrap | ||
32 | text: DiscoverNotifier.message | 34 | text: DiscoverNotifier.message | ||
33 | } | 35 | } | ||
34 | 36 | | |||
35 | Label { | 37 | Label { | ||
I would prefer if you still used a ColumnLayout for those two elements instead of a gazillion anchors broulik: I would prefer if you still used a `ColumnLayout` for those two elements instead of a gazillion… | |||||
38 | id: numberOfUpdatesLabel | ||||
36 | visible: !DiscoverNotifier.isSystemUpToDate | 39 | visible: !DiscoverNotifier.isSystemUpToDate | ||
37 | Layout.fillWidth: true | 40 | Layout.fillWidth: true | ||
38 | Layout.fillHeight: true | 41 | anchors.horizontalCenter: parent.horizontalCenter | ||
42 | anchors.verticalCenter: parent.verticalCenter | ||||
39 | wrapMode: Text.WordWrap | 43 | wrapMode: Text.WordWrap | ||
40 | horizontalAlignment: Text.AlignHCenter | | |||
broulik: Keep the `horizontalAlignment` | |||||
41 | text: DiscoverNotifier.extendedMessage | 44 | text: DiscoverNotifier.extendedMessage | ||
42 | } | 45 | } | ||
43 | Button { | 46 | Button { | ||
47 | anchors.horizontalCenter: parent.horizontalCenter | ||||
48 | anchors.top: numberOfUpdatesLabel.bottom | ||||
49 | anchors.topMargin: units.smallSpacing * 2 | ||||
44 | visible: !DiscoverNotifier.isSystemUpToDate | 50 | visible: !DiscoverNotifier.isSystemUpToDate | ||
45 | Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter | 51 | iconSource: DiscoverNotifier.iconName | ||
46 | text: i18n("Update") | 52 | text: i18n("View Updates") | ||
47 | tooltip: i18n("Launches the software to perform the update") | 53 | tooltip: i18n("Launches Discover to update the software") | ||
48 | onClicked: DiscoverNotifier.showDiscoverUpdates() | 54 | onClicked: DiscoverNotifier.showDiscoverUpdates() | ||
49 | } | 55 | } | ||
50 | Item { | | |||
51 | Layout.fillHeight: true | | |||
52 | width: 5 | | |||
53 | } | | |||
54 | } | 56 | } | ||
broulik: `anchors.centerIn: parent` does both at once :) |
We typically do that where the component is used, not in its definition