Changeset View
Changeset View
Standalone View
Standalone View
src/controls/ToolBarApplicationHeader.qml
Show All 38 Lines | 31 | ApplicationHeader { | |||
---|---|---|---|---|---|
39 | 39 | | |||
40 | pageDelegate: Item { | 40 | pageDelegate: Item { | ||
41 | id: delegateItem | 41 | id: delegateItem | ||
42 | readonly property Page page: applicationWindow().pageStack.get(modelData) | 42 | readonly property Page page: applicationWindow().pageStack.get(modelData) | ||
43 | property ListView view: ListView.view | 43 | property ListView view: ListView.view | ||
44 | readonly property bool current: __appWindow.pageStack.currentIndex == index | 44 | readonly property bool current: __appWindow.pageStack.currentIndex == index | ||
45 | property Row layout | 45 | property Row layout | ||
46 | 46 | | |||
47 | width: { | 47 | implicitWidth: layout.width > 0 ? layout.width : heading.width | ||
48 | //more columns shown? | 48 | width: parent.width | ||
49 | if (__appWindow.wideScreen) { | | |||
50 | if (modelData == 0 && view.x > 0) { | | |||
51 | return page.width - view.x; | | |||
52 | } else { | | |||
53 | return page.width; | | |||
54 | } | | |||
55 | } else { | | |||
56 | return Math.min(view.width, delegateRoot.implicitWidth + Units.smallSpacing); | | |||
57 | } | | |||
58 | } | | |||
59 | height: view.height | 49 | height: view.height | ||
60 | 50 | | |||
61 | Component.onCompleted: { | | |||
62 | layout = toolbarComponent.createObject(delegateItem) | | |||
63 | } | | |||
64 | Component { | | |||
65 | id: toolbarComponent | | |||
66 | Row { | 51 | Row { | ||
67 | id: layout | 52 | id: layout | ||
68 | anchors.verticalCenter: parent.verticalCenter | 53 | anchors.verticalCenter: parent.verticalCenter | ||
69 | x: __appWindow.wideScreen ? (Math.min(delegateItem.width - width, Math.max(0, delegateItem.view.contentX - delegateItem.x))) : 0 | | |||
70 | spacing: 2 | 54 | spacing: 2 | ||
71 | 55 | | |||
72 | Rectangle { | 56 | Rectangle { | ||
73 | anchors.verticalCenter: parent.verticalCenter | 57 | anchors.verticalCenter: parent.verticalCenter | ||
74 | color: Theme.textColor | 58 | color: Theme.textColor | ||
75 | opacity: 0.3 | 59 | opacity: 0.3 | ||
76 | width: Units.devicePixelRatio | 60 | width: Units.devicePixelRatio | ||
77 | height: parent.height * 0.6 | 61 | height: parent.height * 0.6 | ||
Show All 14 Lines | 73 | PrivateActionToolButton { | |||
92 | showText: false | 76 | showText: false | ||
93 | } | 77 | } | ||
94 | Rectangle { | 78 | Rectangle { | ||
95 | anchors.verticalCenter: parent.verticalCenter | 79 | anchors.verticalCenter: parent.verticalCenter | ||
96 | color: Theme.textColor | 80 | color: Theme.textColor | ||
97 | opacity: 0.3 | 81 | opacity: 0.3 | ||
98 | width: Units.devicePixelRatio | 82 | width: Units.devicePixelRatio | ||
99 | height: parent.height * 0.6 | 83 | height: parent.height * 0.6 | ||
84 | visible: page && page.actions && (page.actions.left || page.actions.main || page.actions.right) | ||||
100 | } | 85 | } | ||
101 | Repeater { | 86 | Repeater { | ||
102 | id: repeater | 87 | id: repeater | ||
103 | model: page && page.actions.contextualActions ? page.actions.contextualActions : null | 88 | model: page && page.actions.contextualActions ? page.actions.contextualActions : null | ||
104 | delegate: PrivateActionToolButton { | 89 | delegate: PrivateActionToolButton { | ||
105 | anchors.verticalCenter: parent.verticalCenter | 90 | anchors.verticalCenter: parent.verticalCenter | ||
106 | action: modelData | 91 | action: modelData | ||
107 | visible: modelData.visible && x+layout.x+width*2 < delegateItem.width | 92 | visible: modelData.visible && x+layout.x+width*2 < delegateItem.width | ||
108 | } | 93 | } | ||
109 | } | 94 | } | ||
110 | } | 95 | } | ||
111 | } | 96 | | ||
112 | Heading { | 97 | Heading { | ||
113 | x: __appWindow.wideScreen ? (Math.min(delegateItem.width - width, Math.max(0, delegateItem.view.contentX - delegateItem.x))) : 0 | 98 | id: heading | ||
114 | anchors.verticalCenter: parent.verticalCenter | 99 | anchors.verticalCenter: parent.verticalCenter | ||
115 | visible: layout.width <= 0 | 100 | visible: layout.width <= 0 | ||
116 | opacity: delegateItem.current ? 1 : 0.4 | 101 | opacity: delegateItem.current ? 1 : 0.4 | ||
117 | color: Theme.textColor | 102 | color: Theme.textColor | ||
118 | elide: Text.ElideRight | 103 | elide: Text.ElideRight | ||
119 | text: page ? page.title : "" | 104 | text: page ? page.title : "" | ||
120 | font.pixelSize: parent.height / 1.6 | 105 | font.pixelSize: parent.height / 1.6 | ||
121 | } | 106 | } | ||
▲ Show 20 Lines • Show All 51 Lines • Show Last 20 Lines |