diff --git a/desktoppackage/contents/explorer/WidgetExplorer.qml b/desktoppackage/contents/explorer/WidgetExplorer.qml --- a/desktoppackage/contents/explorer/WidgetExplorer.qml +++ b/desktoppackage/contents/explorer/WidgetExplorer.qml @@ -17,7 +17,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import QtQuick 2.2 +import QtQuick 2.7 import QtQuick.Controls 1.1 import org.kde.plasma.components 2.0 as PlasmaComponents @@ -152,7 +152,9 @@ // model set on first invocation onClicked: model.trigger() } + /* + * This was here when I got here 5/12/18 - sharvey PlasmaCore.Dialog { id: tooltipDialog property Item appletDelegate @@ -198,43 +200,30 @@ RowLayout { id: topBar + spacing: 10 anchors { top: parent.top left: parent.left right: parent.right } + Item { id: header property bool showingSearch: false Layout.fillWidth: true - Layout.minimumHeight: Math.max(heading.height, searchInput.height) + Layout.minimumHeight: heading.height Layout.alignment: Qt.AlignVCenter PlasmaExtras.Title { id: heading anchors.verticalCenter: parent.verticalCenter text: i18nd("plasma_shell_org.kde.plasma.desktop", "Widgets") width: parent.width elide: Text.ElideRight - visible: !header.showingSearch - } - PlasmaComponents.TextField { - id: searchInput - width: parent.width - clearButtonShown: true - anchors.verticalCenter: parent.verticalCenter - placeholderText: i18nd("plasma_shell_org.kde.plasma.desktop", "Search...") - onTextChanged: { - list.positionViewAtBeginning() - list.currentIndex = -1 - widgetExplorer.widgetsModel.searchTerm = text - header.showingSearch = (text != ""); - } - - Component.onCompleted: forceActiveFocus() - visible: header.showingSearch + visible: true } } + PlasmaComponents.ToolButton { id: searchButton @@ -246,10 +235,14 @@ onCheckedChanged: { if (!checked) { searchInput.text = ""; - } + newSearchRow.height = 1; + widgetExplorer.widgetsModel.searchTerm = "" + } else { + newSearchRow.height = header.height; + } } - + } PlasmaComponents.ToolButton { id: categoryButton tooltip: i18nd("plasma_shell_org.kde.plasma.desktop", "Categories") @@ -267,6 +260,45 @@ } } + // move search textbox to its own row + RowLayout { + id: newSearchRow + anchors.top: topBar.bottom + Layout.fillWidth: true + Layout.bottomMargin: heading.height + Layout.alignment: Qt.AlignVCenter + + height: 1 + visible: heading.showingSearch + + spacing: 10 + + Item { + id: searchBarContainer + anchors.top: topBar.bottom + Layout.fillWidth: true + visible: header.showingSearch + + PlasmaComponents.TextField { + id: searchInput + // full width borrowed from panel definition + width: Math.max(heading.paintedWidth, units.iconSizes.enormous * 2 + units.smallSpacing * 4 + units.gridUnit * 2) + + clearButtonShown: true + placeholderText: i18nd("plasma_shell_org.kde.plasma.desktop", "Search...") + onTextChanged: { + list.positionViewAtBeginning() + list.currentIndex = -1 + widgetExplorer.widgetsModel.searchTerm = text + header.showingSearch = (text != ""); + } + + Component.onCompleted: forceActiveFocus() + + } + } + } + Timer { id: setModelTimer interval: 20 @@ -276,11 +308,11 @@ PlasmaExtras.ScrollArea { anchors { - top: topBar.bottom + top: newSearchRow.bottom left: parent.left right: parent.right bottom: bottomBar.top - topMargin: units.smallSpacing + topMargin: units.largeSpacing bottomMargin: units.smallSpacing } @@ -386,4 +418,3 @@ */ } } -