@@ -38,14 +38,23 @@ Item {
39 height: visible ? units.gu(5) : 0
39 height: visible ? units.gu(5) : 0
43+ readonly property color foregroundColor: {
44+ if (scopeStyle) return background.luminance > scopeStyle.threshold ? scopeStyle.dark : ScopeStyle.light;
45+ else return background.luminance > 0.7 ? Theme.palette.normal.baseText : "white"
47+ readonly property bool bothVisible: altNavigationButton.visible && navigationButton.visible
48+ readonly property real navigationWidth: root.width >= units.gu(60) ? units.gu(40) : root.width
49+ readonly property real buttonWidth: navigationWidth / (bothVisible ? 2 : 1)
41 Rectangle {
52 Rectangle {
42 id: blackRect
53 id: blackRect
43 color: "black"
54 color: "black"
44 opacity: openList && openList.currentItem && openList.currentItem.visible ? 0.3 : 0
55 opacity: openList && openList.currentItem && openList.currentItem.visible ? 0.3 : 0
45 Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } }
56 Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } }
46− // Doesn't matter if navigationButton or altNavigationButton list, they are both at the same y
47− y: navigationButton.listView.y
48− anchors.right: parent.right
57+ anchors { left: parent.left; right: parent.right }
49 visible: opacity != 0
58 visible: opacity != 0
@@ -59,71 +68,43 @@ Item {
59 id: altNavigationButton
68 id: altNavigationButton
60 objectName: "altNavigationButton"
69 objectName: "altNavigationButton"
61 height: root.height
70 height: root.height
62− width: navigationButton.visible ? root.width / 2 : root.width
71+ width: d.buttonWidth
63 scope: root.scope
72 scope: root.scope
64 scopeStyle: root.scopeStyle
73 scopeStyle: root.scopeStyle
74+ foregroundColor: d.foregroundColor
65− listView.width: root.width
75+ listView.width: d.navigationWidth
66 isAltNavigation: true
76 isAltNavigation: true
70− visible: navigationButton.visible && altNavigationButton.visible
77+ showDivider: navigationButton.visible || root.width > d.navigationWidth
73− bottom: parent.bottom
74− right: navigationButton.left
75− rightMargin: -units.dp(1)
78− color: scopeStyle ? (background.luminance > scopeStyle.threshold ? scopeStyle.dark : scopeStyle.light) : Theme.palette.normal.baseText
82 DashNavigationButton {
80 DashNavigationButton {
83 id: navigationButton
81 id: navigationButton
84 objectName: "navigationButton"
82 objectName: "navigationButton"
85 height: root.height
83 height: root.height
86− width: altNavigationButton.visible ? root.width / 2 : root.width
84+ width: altNavigationButton.visible ? d.buttonWidth : d.navigationWidth
87− x: altNavigationButton.visible ? root.width / 2 : 0
85+ x: altNavigationButton.visible ? d.buttonWidth : 0
88 scope: root.scope
86 scope: root.scope
89 scopeStyle: root.scopeStyle
87 scopeStyle: root.scopeStyle
88+ foregroundColor: d.foregroundColor
90− listView.width: root.width
89+ listView.width: d.navigationWidth
91 listView.x: -x
90 listView.x: -x
91+ showDivider: root.width > d.navigationWidth
96 fillMode: Image.Stretch
95 fillMode: Image.Stretch
97 source: "graphics/navigation_shadow.png"
96 source: "graphics/navigation_shadow.png"
97+ anchors { top: parent.bottom; left: parent.left; right: parent.right }
98+ z: d.bothVisible ? -1 : 0
102+ fillMode: Image.Stretch
103+ source: "graphics/navigation_shadow.png"
99− readonly property bool bothVisible: navigationButton.visible & altNavigationButton.visible
104+ x: navigationButton.listView.height > 0 ? altNavigationButton.x : navigationButton.x
100−
105+ width: d.buttonWidth
101− state: "default"
106+ rotation: 180
102−
107+ anchors.bottom: parent.bottom
103− states: [
108+ visible: d.bothVisible && (navigationButton.listView.height > 0 || altNavigationButton.listView.height > 0)
106− when: !dropShadow.bothVisible || (!altNavigationButton.showList && !navigationButton.showList)
107− PropertyChanges { target: dropShadow; width: root.width; x: 0; rotation: 0 }
108− AnchorChanges { target: dropShadow; anchors.top: parent.bottom; anchors.bottom: undefined }
112− PropertyChanges { target: dropShadow; width: navigationButton.width; rotation: 180 }
113− AnchorChanges { target: dropShadow; anchors.bottom: parent.bottom; anchors.top: undefined }
118− when: dropShadow.bothVisible && navigationButton.showList
119− PropertyChanges { target: dropShadow; x: altNavigationButton.x }
124− when: dropShadow.bothVisible && altNavigationButton.showList
125− PropertyChanges { target: dropShadow; x: navigationButton.x }