Merge lp:~verzegnassi-stefano/ubuntu-docviewer-app/uitk13-textview into lp:ubuntu-docviewer-app

Proposed by Stefano Verzegnassi
Status: Merged
Approved by: Stefano Verzegnassi
Approved revision: 316
Merged at revision: 325
Proposed branch: lp:~verzegnassi-stefano/ubuntu-docviewer-app/uitk13-textview
Merge into: lp:ubuntu-docviewer-app
Diff against target: 128 lines (+30/-48)
2 files modified
src/app/qml/textView/TextView.qml (+11/-15)
src/app/qml/textView/TextViewDefaultHeader.qml (+19/-33)
To merge this branch: bzr merge lp:~verzegnassi-stefano/ubuntu-docviewer-app/uitk13-textview
Reviewer Review Type Date Requested Status
Roman Shchekin Approve
Jenkins Bot continuous-integration Approve
Review via email: mp+289482@code.launchpad.net

Commit message

[TextView] Switch to UITK 1.3 PageHeader component

Description of the change

[TextView] Switch to UITK 1.3 PageHeader component

To post a comment you must log in.
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
316. By Stefano Verzegnassi

Updated copyright

Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Roman Shchekin (mrqtros) wrote :

Like it.
BTW, did you move all Pages to PageHeader approach? When I was developing Shorts I found that if you mix both old and new approches UITK works in strange way...

review: Approve
Revision history for this message
Stefano Verzegnassi (verzegnassi-stefano) wrote :

Yes, I'm moving all the pages to the new approach (there are already a few MPs for them).

Thanks for the review!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/app/qml/textView/TextView.qml'
2--- src/app/qml/textView/TextView.qml 2015-12-26 18:27:13 +0000
3+++ src/app/qml/textView/TextView.qml 2016-03-26 18:46:16 +0000
4@@ -1,5 +1,5 @@
5 /*
6- * Copyright (C) 2013-2015 Canonical, Ltd.
7+ * Copyright (C) 2013-2016 Canonical, Ltd.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11@@ -23,10 +23,11 @@
12
13 Page {
14 id: textPage
15- title: DocumentViewer.getFileBaseNameFromPath(file.path)
16
17- // Reset night mode shader settings when closing the page
18- // Component.onDestruction: mainView.nightModeEnabled = false
19+ header: TextViewDefaultHeader {
20+ title: DocumentViewer.getFileBaseNameFromPath(file.path)
21+ activityRunning: textAreaMain.isLoading
22+ }
23
24 TextArea {
25 id: textAreaMain
26@@ -34,7 +35,12 @@
27
28 property bool isLoading: true
29
30- anchors.fill: parent
31+ anchors {
32+ top: textPage.header.bottom
33+ left: parent.left
34+ right: parent.right
35+ bottom: parent.bottom
36+ }
37
38 // FIXME: If set to true, some of the keyboard hooks are disabled
39 // And it's not possible to move the cursor with arrow keys.
40@@ -61,14 +67,4 @@
41 background: Rectangle { color: "white" }
42 }
43 }
44-
45- // *** HEADER ***
46- state: "default"
47- states: [
48- TextViewDefaultHeader {
49- name: "default"
50- targetPage: textPage
51- activityRunning: textAreaMain.isLoading
52- }
53- ]
54 }
55
56=== modified file 'src/app/qml/textView/TextViewDefaultHeader.qml'
57--- src/app/qml/textView/TextViewDefaultHeader.qml 2015-11-13 21:19:46 +0000
58+++ src/app/qml/textView/TextViewDefaultHeader.qml 2016-03-26 18:46:16 +0000
59@@ -1,5 +1,5 @@
60 /*
61- * Copyright (C) 2014-2015 Canonical, Ltd.
62+ * Copyright (C) 2014-2016 Canonical, Ltd.
63 *
64 * This program is free software; you can redistribute it and/or modify
65 * it under the terms of the GNU General Public License as published by
66@@ -20,44 +20,30 @@
67 import Ubuntu.Components.Popups 1.3
68 import DocumentViewer 1.0
69
70-PageHeadState {
71+PageHeader {
72 id: rootItem
73
74- property Page targetPage
75 property alias activityRunning: activity.running
76
77- head: targetPage.head
78-
79- contents: RowLayout {
80- anchors.fill: parent
81- spacing: units.gu(1)
82-
83- ActivityIndicator { id: activity; visible: running }
84-
85- Column {
86- id: layout
87- Layout.fillWidth: true
88-
89- Label {
90- width: parent.width
91- //horizontalAlignment: Text.AlignHCenter
92- elide: Text.ElideMiddle
93-
94- font.weight: Font.DemiBold
95- text: targetPage.title
96- }
97- Label {
98- width: parent.width
99- //horizontalAlignment: Text.AlignHCenter
100- elide: Text.ElideMiddle
101-
102- textSize: Label.Small
103- text: file.mimetype.description
104- }
105- }
106+ contents: ListItemLayout {
107+ anchors.centerIn: parent
108+
109+ ActivityIndicator {
110+ id: activity
111+ SlotsLayout.position: SlotsLayout.Leading
112+ visible: running
113+ }
114+
115+ title {
116+ font.weight: Font.DemiBold
117+ elide: Text.ElideMiddle
118+ text: rootItem.title
119+ }
120+
121+ subtitle.text: file.mimetype.description
122 }
123
124- actions: [
125+ trailingActionBar.actions: [
126 Action {
127 iconName: "night-mode"
128 text: mainView.nightModeEnabled ? i18n.tr("Disable night mode") : i18n.tr("Enable night mode")

Subscribers

People subscribed via source and target branches