on xenial help sign in
Use new header with integrated search action, dropping the search entry from the panel
19a1189Michael Zanetti
qml/Dash/DashContent.qml+15−35
@@ -15,7 +15,8 @@
15 */
15 */
16
16
17import QtQuick 2.0
17import QtQuick 2.0
18−import Ubuntu.Components 0.1
18+import Ubuntu.Components 1.1
19+import Ubuntu.Components.Themes.Ambiance 1.1
19import Unity 0.2
20import Unity 0.2
20import Utils 0.1
21import Utils 0.1
21import "../Components"
22import "../Components"
@@ -177,44 +178,23 @@ Item {
177 searchHistory: dashContent.searchHistory
178 searchHistory: dashContent.searchHistory
178 scope: dashContentList.currentItem && dashContentList.currentItem.theScope
179 scope: dashContentList.currentItem && dashContentList.currentItem.theScope
179
180
180− childItem: TabBar {
181+ childItem: NewHeaderStyle {
181 id: tabBar
182 id: tabBar
182 objectName: "tabbar"
183 objectName: "tabbar"
183− height: units.gu(6.5)
184 width: parent.width
184 width: parent.width
185− style: DashContentTabBarStyle {}
185+ height: units.gu(6.5)
186−
186+ contentHeight: height
187− SortFilterProxyModel {
187+ separatorSource: ""
188− id: tabBarModel
188+ textColor: "grey"
189−
189+ property var styledItem: tabBar
190− model: dashContentList.model
190+ property var title: dashContentList.model.get(dashContentList.currentIndex).title
191−
191+ property var config: HeaderConfiguration {
192− property int selectedIndex: -1
192+ actions: [
193− onSelectedIndexChanged: {
193+ Action {
194− if (dashContentList.currentIndex == -1 && tabBar.selectedIndex != -1) {
194+ iconName: "search"
195− // TODO This together with the Timer below
195+ onTriggered: dashPageHeader.triggerSearch()
196− // are a workaround for the first tab sometimes not showing the text.
197− // But Tabs are going away in the future so not sure if makes
198− // sense invetigating what's the problem at this stage
199− selectionModeTimer.restart();
200 }
196 }
201− dashContentList.currentIndex = selectedIndex;
197+ ]
202− }
203− }
204−
205− model: tabBarModel.count > 0 ? tabBarModel : null
206−
207− Connections {
208− target: dashContentList
209− onCurrentIndexChanged: {
210− tabBarModel.selectedIndex = dashContentList.currentIndex
211− }
212− }
213−
214− Timer {
215− id: selectionModeTimer
216− interval: 1
217− onTriggered: tabBar.selectionMode = false
218 }
198 }
219 }
199 }
220
200
qml/Dash/GenericScopeView.qml−8
@@ -88,14 +88,6 @@ FocusScope {
88 when: isCurrent
88 when: isCurrent
89 }
89 }
90
90
91− Connections {
92− target: panel
93− onSearchClicked: if (isCurrent) {
94− pageHeader.triggerSearch()
95− categoryView.showHeader()
96− }
97− }
98−
99 Connections {
91 Connections {
100 target: scopeView.scope
92 target: scopeView.scope
101 onShowDash: previewListView.open = false;
93 onShowDash: previewListView.open = false;
qml/Panel/Panel.qml+1−31
@@ -24,13 +24,10 @@ Item {
24 property real indicatorsMenuWidth: (shell.width > units.gu(60)) ? units.gu(40) : shell.width
24 property real indicatorsMenuWidth: (shell.width > units.gu(60)) ? units.gu(40) : shell.width
25 property alias indicators: indicatorsMenu
25 property alias indicators: indicatorsMenu
26 property bool fullscreenMode: false
26 property bool fullscreenMode: false
27− property bool searchVisible: true
28
27
29 readonly property real separatorLineHeight: leftSeparatorLine.height
28 readonly property real separatorLineHeight: leftSeparatorLine.height
30 readonly property real __panelMinusSeparatorLineHeight: panelHeight - separatorLineHeight
29 readonly property real __panelMinusSeparatorLineHeight: panelHeight - separatorLineHeight
31
30
32− signal searchClicked
33−
34 function hideIndicatorMenu(delay) {
31 function hideIndicatorMenu(delay) {
35 if (delay !== undefined) {
32 if (delay !== undefined) {
36 hideTimer.interval = delay;
33 hideTimer.interval = delay;
@@ -104,7 +101,7 @@ Item {
104 panelHeight: __panelMinusSeparatorLineHeight
101 panelHeight: __panelMinusSeparatorLineHeight
105 openedHeight: parent.height + (pinnedMode ? 0 : root.panelHeight)
102 openedHeight: parent.height + (pinnedMode ? 0 : root.panelHeight)
106 pinnedMode: !fullscreenMode
103 pinnedMode: !fullscreenMode
107− overFlowWidth: search.state=="hidden" ? parent.width : parent.width - search.width
104+ overFlowWidth: parent.width
108 }
105 }
109
106
110 PanelSeparatorLine {
107 PanelSeparatorLine {
@@ -130,33 +127,6 @@ Item {
130 source: "graphics/rectangular_dropshadow.sci"
127 source: "graphics/rectangular_dropshadow.sci"
131 }
128 }
132
129
133− SearchIndicator {
134− id: search
135− objectName: "search"
136− enabled: root.searchVisible
137−
138− state: {
139− if (parent.width < indicatorsMenu.width + width) {
140− if (indicatorsMenu.state != "initial") {
141− return "hidden";
142− }
143− }
144− if (root.searchVisible && !indicatorsMenu.showAll) {
145− return "visible";
146− }
147−
148− return "hidden";
149− }
150−
151− height: __panelMinusSeparatorLineHeight
152− anchors {
153− top: panelBackground.top
154− left: panelBackground.left
155− }
156−
157− onClicked: root.searchClicked()
158− }
159−
160 states: [
130 states: [
161 State {
131 State {
162 name: "in" //fully opaque and visible at top edge of screen
132 name: "in" //fully opaque and visible at top edge of screen
qml/Shell.qml−1
@@ -468,7 +468,6 @@ FocusScope {
468 property string focusedAppId: ApplicationManager.focusedApplicationId
468 property string focusedAppId: ApplicationManager.focusedApplicationId
469 property var focusedApplication: ApplicationManager.findApplication(focusedAppId)
469 property var focusedApplication: ApplicationManager.findApplication(focusedAppId)
470 fullscreenMode: focusedApplication && stages.fullscreen && !greeter.shown && !lockscreen.shown
470 fullscreenMode: focusedApplication && stages.fullscreen && !greeter.shown && !lockscreen.shown
471− searchVisible: !greeter.shown && !lockscreen.shown && dash.shown && dash.searchable
472
471
473 InputFilterArea {
472 InputFilterArea {
474 anchors {
473 anchors {