on xenial help sign in
IndicatorsClient: use PageHeader and ListItemLayout's
91236b7Marco Trevisan (Treviño)
qml/Panel/Indicators/client/IndicatorRepresentation.qml+27−23
@@ -20,25 +20,42 @@
20
20
21import QtQuick 2.4
21import QtQuick 2.4
22import Ubuntu.Components 1.3
22import Ubuntu.Components 1.3
23−import Ubuntu.Components.ListItems 1.3 as ListItem
24import "../.."
23import "../.."
25
24
26Page {
25Page {
27 id: root
26 id: root
28−
29− title: indicatorProperties && indicatorProperties.title ? indicatorProperties.title :
30− indicatorProperties && indicatorProperties.accessibleName ? indicatorProperties.accessibleName
31− : ""
32 property variant indicatorProperties
27 property variant indicatorProperties
33
28
29+ header: PageHeader {
30+ title: indicatorProperties && indicatorProperties.title ? indicatorProperties.title :
31+ indicatorProperties && indicatorProperties.accessibleName ? indicatorProperties.accessibleName
32+ : identifier
33+ }
34+
34 anchors.fill: parent
35 anchors.fill: parent
35
36
36− ListItem.Standard {
37+ ListItem {
38+ color: theme.palette.highlighted.background
37 id: visualCheckItem
39 id: visualCheckItem
40+
41+ anchors {
42+ top: header.bottom
43+ left: parent.left
44+ right: parent.right
45+ }
46+
47+ height: selectorLayout.height
48+ onClicked: visualCheck.checked = !visualCheck.checked
49+
50+ ListItemLayout {
51+ id: selectorLayout
38− text: "Enable Visual Representation"
52+ title.text: "Enable Visual Representation"
53+
39− control: Switch {
54+ Switch {
40− id: visualCheck
55+ id: visualCheck
41− checked: true
56+ checked: true
57+ SlotsLayout.position: SlotsLayout.Trailing
58+ }
42 }
59 }
43 }
60 }
44
61
@@ -48,11 +65,6 @@ Page {
48 clip:true
65 clip:true
49 asynchronous: true
66 asynchronous: true
50
67
51− Rectangle {
52− anchors.fill: pageLoader
53− color: "#221e1c" // FIXME not in palette yet
54− }
55−
56 anchors {
68 anchors {
57 top: visualCheckItem.bottom
69 top: visualCheckItem.bottom
58 left: parent.left
70 left: parent.left
@@ -92,13 +104,5 @@ Page {
92 margins: units.gu(1)
104 margins: units.gu(1)
93 }
105 }
94 height: childrenRect.height
106 height: childrenRect.height
95−
96− Button {
97− anchors {
98− left: parent.left
99− }
100− text: "Back"
101− onClicked: root.pageStack.reset()
102− }
103 }
107 }
104}
108}
qml/Panel/Indicators/client/IndicatorsClient.qml+1−1
@@ -21,8 +21,8 @@ import QtQuick 2.4
21import Ubuntu.Components 1.3
21import Ubuntu.Components 1.3
22
22
23Rectangle {
23Rectangle {
24− color: theme.palette.normal.background
25 id: root
24 id: root
25+ color: theme.palette.normal.background
26
26
27 Component.onCompleted: {
27 Component.onCompleted: {
28 theme.name = "Ubuntu.Components.Themes.SuruDark"
28 theme.name = "Ubuntu.Components.Themes.SuruDark"
qml/Panel/Indicators/client/IndicatorsList.qml+18−24
@@ -1,5 +1,5 @@
1/*
1/*
2− * Copyright 2013 Canonical Ltd.
2+ * Copyright 2013-2016 Canonical Ltd.
3 *
3 *
4 * This program is free software; you can redistribute it and/or modify
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
5 * it under the terms of the GNU Lesser General Public License as published by
@@ -15,11 +15,11 @@
15 *
15 *
16 * Authors:
16 * Authors:
17 * Renato Araujo Oliveira Filho <renato@canonical.com>
17 * Renato Araujo Oliveira Filho <renato@canonical.com>
18+ * Marco Trevisan <marco.trevisan@canonical.com>
18 */
19 */
19
20
20import QtQuick 2.4
21import QtQuick 2.4
21import Ubuntu.Components 1.3
22import Ubuntu.Components 1.3
22−import Ubuntu.Components.ListItems 1.3 as ListItem
23import Unity.Indicators 0.1 as Indicators
23import Unity.Indicators 0.1 as Indicators
24import "../.."
24import "../.."
25import "../../../Components"
25import "../../../Components"
@@ -28,7 +28,9 @@ Page {
28 id: page
28 id: page
29 anchors.fill: parent
29 anchors.fill: parent
30 property string profile: ""
30 property string profile: ""
31− title: "Plugin list"
31+ header: PageHeader {
32+ title: "Indicators List"
33+ }
32
34
33 Indicators.IndicatorsModel {
35 Indicators.IndicatorsModel {
34 id: indicatorsModel
36 id: indicatorsModel
@@ -42,32 +44,24 @@ Page {
42 anchors.fill: parent
44 anchors.fill: parent
43 model: indicatorsModel
45 model: indicatorsModel
44
46
45− delegate: Rectangle {
47+ delegate: ListItem {
46− color: "#221e1c"
48+ objectName: identifier
47−
48− anchors.left: parent.left
49− anchors.right: parent.right
50− height: menuItem.height
49+ height: menuItem.height + (divider.visible ? divider.height : 0)
51
50
52− ListItem.Standard {
51+ ListItemLayout {
53 id: menuItem
52 id: menuItem
54− anchors.left: parent.left
55− anchors.right: parent.right
56− objectName: identifier
57−
58− text: identifier
53+ title.text: identifier
59−
54+ }
60− onClicked: {
61− var new_page = Qt.createComponent("IndicatorRepresentation.qml");
62− if (new_page.status !== Component.Ready) {
63− if (new_page.status === Component.Error)
64− console.error("Error: " + new_page.errorString());
65
55
66− return;
56+ onClicked: {
67− }
57+ var new_page = Qt.createComponent("IndicatorRepresentation.qml");
58+ if (new_page.status !== Component.Ready) {
59+ if (new_page.status === Component.Error)
60+ console.error("Error: " + new_page.errorString());
68
61
69− page.pageStack.push(new_page.createObject(pages), {"indicatorProperties" : model.indicatorProperties });
62+ return;
70 }
63 }
64+ page.pageStack.push(new_page.createObject(pages), {"indicatorProperties" : model.indicatorProperties });
71 }
65 }
72 }
66 }
73 }
67 }
qml/Panel/Indicators/client/IndicatorsTree.qml+4−8
@@ -31,14 +31,10 @@ IndicatorBase {
31 model: root.menuModel
31 model: root.menuModel
32 }
32 }
33
33
34− Flickable {
34+ TextArea {
35 anchors.fill: parent
35 anchors.fill: parent
36− contentHeight: all_data.height
36+ anchors.margins: units.gu(0.5)
37− clip:true
38− Text {
39− id: all_data
37+ id: all_data
40− color: "white"
41− text: printer.text
38+ text: printer.text
42− }
43 }
39 }
44}
40}