Commit ef99bc5e authored by Nate Graham's avatar Nate Graham
Browse files

Remove now-useless RowLayout in sidebar header

Now that we removed the Home button from the header, it only has one
item in it, which means we don't need a Layout to hold it; we can just
stick the SearchField in the header itself as its contentItem.
parent a7a674fd
Pipeline #150938 passed with stage
in 1 minute and 2 seconds
......@@ -55,8 +55,8 @@ Kirigami.GlobalDrawer {
header: Kirigami.AbstractApplicationHeader {
visible: drawer.wideScreen
contentItem: RowLayout {
spacing: Kirigami.Units.smallSpacing
contentItem: SearchField {
id: searchField
anchors {
left: parent.left
......@@ -65,31 +65,26 @@ Kirigami.GlobalDrawer {
rightMargin: Kirigami.Units.smallSpacing
}
SearchField {
id: searchField
Layout.fillWidth: true
visible: window.leftPage && (window.leftPage.searchFor !== null || window.leftPage.hasOwnProperty("search"))
visible: window.leftPage && (window.leftPage.searchFor !== null || window.leftPage.hasOwnProperty("search"))
page: window.leftPage
page: window.leftPage
onCurrentSearchTextChanged: {
var curr = window.leftPage;
onCurrentSearchTextChanged: {
var curr = window.leftPage;
if (pageStack.depth>1)
pageStack.pop()
if (pageStack.depth>1)
pageStack.pop()
if (currentSearchText === "" && window.currentTopLevel === "" && !window.leftPage.category) {
Navigation.openHome()
} else if (!curr.hasOwnProperty("search")) {
if (currentSearchText) {
Navigation.clearStack()
Navigation.openApplicationList( { search: currentSearchText })
}
} else {
curr.search = currentSearchText;
curr.forceActiveFocus()
if (currentSearchText === "" && window.currentTopLevel === "" && !window.leftPage.category) {
Navigation.openHome()
} else if (!curr.hasOwnProperty("search")) {
if (currentSearchText) {
Navigation.clearStack()
Navigation.openApplicationList( { search: currentSearchText })
}
} else {
curr.search = currentSearchText;
curr.forceActiveFocus()
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment