diff --git a/lib/qml/ResultDelegate.qml b/lib/qml/ResultDelegate.qml --- a/lib/qml/ResultDelegate.qml +++ b/lib/qml/ResultDelegate.qml @@ -164,11 +164,13 @@ PlasmaComponents.ListItem { id: listItem + readonly property int indexModifier: reversed ? 0 : 1 + // fake pressed look checked: resultDelegate.pressed separatorVisible: resultDelegate.sectionHasChanged && !resultDelegate.isCurrent - && (index === 0 || resultDelegate.ListView.view.currentIndex !== (index - 1)) + && (index === 0 || resultDelegate.ListView.view.currentIndex !== (index - indexModifier)) Item { id: labelWrapper diff --git a/plasmoid/package/contents/ui/SearchField.qml b/plasmoid/package/contents/ui/SearchField.qml --- a/plasmoid/package/contents/ui/SearchField.qml +++ b/plasmoid/package/contents/ui/SearchField.qml @@ -26,9 +26,8 @@ import "globals.js" as Globals /* - * The SearchField is a simple " Search |___input___|" widget. - * The only complex part is aligning the "Search" text on the right - * and an internal timer to reduce the number of textChanged signals + * The SearchField is a simple text field widget. The only complex part + * is the internal timer to reduce the number of textChanged signals * using searchTextChanged. */ Item { @@ -38,31 +37,14 @@ height: childrenRect.height width: Globals.PlasmoidWidth - PlasmaComponents.Label { - id: searchText - anchors { - left: parent.left - top: parent.top - } - // We cannot use anchors.rightMargin as this has an anchor on - // left, so the rightMargin has no effect. - // Because of this we also need to apply an appropriate leftMargin - // on the textField below - width: Globals.CategoryWidth - Globals.CategoryRightMargin - - horizontalAlignment: Text.AlignRight - text: i18n("Search") - } - PlasmaComponents.TextField { id: textField clearButtonShown: true + placeholderText: i18n("Search...") anchors { - left: searchText.right + left: parent.left right: parent.right top: parent.top - - leftMargin: Globals.CategoryRightMargin } focus: true diff --git a/plasmoid/package/contents/ui/main.qml b/plasmoid/package/contents/ui/main.qml --- a/plasmoid/package/contents/ui/main.qml +++ b/plasmoid/package/contents/ui/main.qml @@ -43,32 +43,22 @@ return plasmoid.location == PlasmaCore.Types.BottomEdge; } - // The wrapper just exists for giving an appropriate top/bottom margin - // when it is placed on the top/bottom edge of the screen Item { id: wrapper - // - // The +20 is so that the minimumHeight is always at least 20+. If the height - // is too small then Plasma will ignore the fact that it is a PopupApplet - // and put the SearchField directly in the panel. - // property int minimumHeight: listView.count ? listView.contentHeight + searchField.height + 5 - : searchField.height + 20 + : searchField.height property int maximumHeight: minimumHeight + anchors.fill: parent - anchors { - fill: parent - topMargin: isBottomEdge() ? 0 : 7 - bottomMargin: isBottomEdge() ? 7 : 0 - } SearchField { id: searchField anchors { left: parent.left right: parent.right + verticalCenter: parent.height / 2 } onSearchTextChanged: { listView.setQueryString(text) @@ -83,12 +73,6 @@ anchors { left: parent.left right: parent.right - - // vHanda: Random number - Is there some way to use consisten margins? - // PlasmaCore.FrameSvg does have margins, but one needs to construct - // a PlasmaCore.FrameSvg for that - topMargin: isBottomEdge() ? 0 : 5 - bottomMargin: isBottomEdge() ? 5 : 0 } reversed: isBottomEdge() @@ -129,9 +113,6 @@ function setTextFieldFocus(shown) { searchField.setFocus(); searchField.selectAll(); - - //if (!shown) - // listView.clearPreview(); } function loadSettings() {