on xenial help sign in
Merge
commit058d56bd07a998ced9abfb1db4be4844f8e18179 authorAlbert Astals Cid <albert.astals@canonical.com> dateThu 3 Mar 2016, 17:47 (11 years ago) parentdf5011c0d80eee
5 files changed+27−42
qml/Dash/DashNavigation.qml+2−8 qml/Dash/DashNavigationList.qml+3−3 qml/Dash/DashPageHeader.qml+20−30 qml/Dash/GenericScopeView.qml+1 qml/Dash/PageHeaderExtraPanel.qml+1−1
qml/Dash/DashNavigation.qml+2−8
@@ -74,7 +74,7 @@ Item {
7474 delegate: DashNavigationHeader {
7575 objectName: "dashNavigationHeader" + index
7676 height: index == 0 && headersModel.count > 1 ? 0 : units.gu(5)
77− width: parent.width
77+ width: headersColumn.width
7878
7979 backVisible: index != 0
8080 text: headerText
@@ -115,12 +115,7 @@ Item {
115115 left: parent.left
116116 right: parent.right
117117 }
118− property int maxHeight: -1
119− Component.onCompleted: updateMaxHeight();
120− function updateMaxHeight()
121− {
122− maxHeight = root.availableHeight - mapToItem(root, 0, 0).y;
123− }
118+ readonly property int maxHeight: root.availableHeight - navigationListView.y
124119 property int prevHeight: maxHeight
125120 height: currentItem ? currentItem.height : maxHeight
126121
@@ -137,7 +132,6 @@ Item {
137132 property real desiredHeight: {
138133 if (navigation && navigation.loaded && x == navigationListView.contentX)
139134 {
140− navigationListView.updateMaxHeight();
141135 return Math.min(implicitHeight, navigationListView.maxHeight);
142136 } else {
143137 return navigationListView.prevHeight;
qml/Dash/DashNavigationList.qml+3−3
@@ -55,10 +55,10 @@ Item {
5555 delegate: ListItem {
5656 objectName: root.objectName + "child" + index
5757 height: root.itemHeight
58− width: parent.width
58+ width: column.width
5959 anchors {
60− left: parent.left
61− right: parent.right
60+ left: column.left
61+ right: column.right
6262 leftMargin: units.gu(2)
6363 rightMargin: units.gu(2)
6464 }
qml/Dash/DashPageHeader.qml+20−30
@@ -261,8 +261,9 @@ Item {
261261 visible: width > 0
262262 anchors {
263263 top: parent.top
264− right: cancelLabel.left
264+ right: cancelButton.left
265265 bottom: parent.bottom
266+ rightMargin: units.gu(-1)
266267 }
267268
268269 Icon {
@@ -277,25 +278,28 @@ Item {
277278 }
278279 }
279280
280− Label {
281− id: cancelLabel
282− text: i18n.tr("Cancel")
283− color: header.panelForegroundColor
284− verticalAlignment: Text.AlignVCenter
281+ AbstractButton {
282+ id: cancelButton
283+ width: cancelLabel.width + cancelLabel.anchors.rightMargin + cancelLabel.anchors.leftMargin
285284 anchors {
286285 top: parent.top
287286 right: parent.right
288287 bottom: parent.bottom
289− margins: units.gu(2)
290288 }
291− AbstractButton {
292− anchors.fill: parent
293− // So that clicking in the empty area on the left of Cancel
294− // has the same effect as clicking on the empty area on the right
295− anchors.leftMargin: units.gu(-2)
296− onClicked: {
297− root.clearSearch(false);
298− headerContainer.showSearch = false;
289+ onClicked: {
290+ root.clearSearch(false);
291+ headerContainer.showSearch = false;
292+ }
293+ Label {
294+ id: cancelLabel
295+ text: i18n.tr("Cancel")
296+ color: header.panelForegroundColor
297+ verticalAlignment: Text.AlignVCenter
298+ anchors {
299+ verticalCenter: parent.verticalCenter
300+ right: parent.right
301+ rightMargin: units.gu(2)
302+ leftMargin: units.gu(1)
299303 }
300304 }
301305 }
@@ -314,6 +318,7 @@ Item {
314318 property color panelColor: background.topColor
315319 panelForegroundColor: config.foregroundColor
316320 config: PageHeadConfiguration {
321+ title: root.title
317322 foregroundColor: root.scopeStyle ? root.scopeStyle.headerForeground : theme.palette.normal.baseText
318323 backAction: Action {
319324 iconName: backIsClose ? "close" : "back"
@@ -354,21 +359,6 @@ Item {
354359 onTriggered: root.favoriteClicked()
355360 }
356361 ]
357−
358− contents: Label {
359− visible: header.contents === null
360− LayoutMirroring.enabled: Qt.application.layoutDirection == Qt.RightToLeft
361− anchors {
362− left: parent.left
363− right: parent.right
364− verticalCenter: parent.verticalCenter
365− }
366− text: root.title
367− font.weight: header.fontWeight
368− fontSize: header.fontSize
369− color: header.panelForegroundColor
370− elide: Text.ElideRight
371− }
372362 }
373363
374364 property var contents: null
qml/Dash/GenericScopeView.qml+1
@@ -671,6 +671,7 @@ FocusScope {
671671 }
672672 }
673673 onShowFiltersPopup: { // item
674+ extraPanel.visible = false;
674675 scopeView.filtersPopover = PopupUtils.open(Qt.resolvedUrl("FiltersPopover.qml"), item, { "contentWidth": scopeView.width - units.gu(2) } );
675676 }
676677 }
qml/Dash/PageHeaderExtraPanel.qml+1−1
@@ -22,7 +22,7 @@ import "Filters" as Filters
2222Item {
2323 id: root
2424
25− readonly property real searchesHeight: recentSearchesRepeater.count > 0 ? searchColumn.height + recentSearchesLabels.height + recentSearchesLabels.anchors.margins : 0
25+ readonly property real searchesHeight: recentSearchesRepeater.count > 0 ? searchColumn.height + recentSearchesLabels.height + recentSearchesLabels.anchors.topMargin : 0
2626
2727 implicitHeight: searchesHeight + dashNavigation.implicitHeight + dashNavigation.anchors.topMargin + primaryFilter.height + primaryFilter.anchors.topMargin
2828