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 | | ||
broulik: We typically do that where the component is used, not in its definition | |||||
28 | PlasmaExtras.Heading { | 28 | PlasmaExtras.Heading { | ||
29 | Layout.fillWidth: true | 29 | anchors.top: parent.top | ||
broulik: That's the default anyway | |||||
30 | width: parent.width | ||||
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… | |||||
30 | level: 3 | 31 | level: 3 | ||
31 | wrapMode: Text.WordWrap | 32 | wrapMode: Text.WordWrap | ||
32 | text: DiscoverNotifier.message | 33 | text: DiscoverNotifier.message | ||
33 | } | 34 | } | ||
34 | 35 | | |||
36 | ColumnLayout { | ||||
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… | |||||
37 | anchors.horizontalCenter: parent.horizontalCenter | ||||
broulik: `anchors.centerIn: parent` does both at once :) | |||||
38 | anchors.verticalCenter: parent.verticalCenter | ||||
39 | spacing: units.smallSpacing * 2 | ||||
40 | | ||||
35 | Label { | 41 | Label { | ||
36 | visible: !DiscoverNotifier.isSystemUpToDate | 42 | visible: !DiscoverNotifier.isSystemUpToDate | ||
37 | Layout.fillWidth: true | 43 | Layout.fillWidth: true | ||
38 | Layout.fillHeight: true | | |||
39 | wrapMode: Text.WordWrap | 44 | wrapMode: Text.WordWrap | ||
40 | horizontalAlignment: Text.AlignHCenter | | |||
broulik: Keep the `horizontalAlignment` | |||||
41 | text: DiscoverNotifier.extendedMessage | 45 | text: DiscoverNotifier.extendedMessage | ||
42 | } | 46 | } | ||
43 | Button { | 47 | Button { | ||
44 | visible: !DiscoverNotifier.isSystemUpToDate | 48 | visible: !DiscoverNotifier.isSystemUpToDate | ||
45 | Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter | 49 | Layout.alignment: Qt.AlignHCenter | ||
46 | text: i18n("Update") | 50 | iconSource: DiscoverNotifier.iconName | ||
47 | tooltip: i18n("Launches the software to perform the update") | 51 | text: i18n("View Updates") | ||
52 | tooltip: i18n("Launches Discover to update the software") | ||||
48 | onClicked: DiscoverNotifier.showDiscoverUpdates() | 53 | onClicked: DiscoverNotifier.showDiscoverUpdates() | ||
49 | } | 54 | } | ||
50 | Item { | | |||
51 | Layout.fillHeight: true | | |||
52 | width: 5 | | |||
53 | } | 55 | } | ||
54 | } | 56 | } |
We typically do that where the component is used, not in its definition