diff --git a/applets/kicker/package/contents/ui/DashboardRepresentation.qml b/applets/kicker/package/contents/ui/DashboardRepresentation.qml --- a/applets/kicker/package/contents/ui/DashboardRepresentation.qml +++ b/applets/kicker/package/contents/ui/DashboardRepresentation.qml @@ -25,6 +25,8 @@ import org.kde.plasma.extras 2.0 as PlasmaExtras import org.kde.kquickcontrolsaddons 2.0 import org.kde.kwindowsystem 1.0 +import org.kde.kirigami 2.8 as Kirigami + import org.kde.plasma.private.shell 2.0 @@ -40,6 +42,7 @@ Kicker.DashboardWindow { id: root + flags: Qt.WA_TranslucentBackground property bool smallScreen: ((Math.floor(width / units.iconSizes.huge) <= 22) || (Math.floor(height / units.iconSizes.huge) <= 14)) @@ -51,9 +54,8 @@ property int columns: Math.floor(((smallScreen ? 85 : 80)/100) * Math.ceil(width / cellSize)) property bool searching: (searchField.text != "") property var widgetExplorer: null - keyEventProxy: searchField - backgroundColor: Qt.rgba(0, 0, 0, 0.737) + backgroundColor: Qt.rgba(Kirigami.Theme.backgroundColor.r, Kirigami.Theme.backgroundColor.g, Kirigami.Theme.backgroundColor.b, 0.737) onKeyEscapePressed: { if (searching) { @@ -258,102 +260,19 @@ } } - TextEdit { + Kirigami.SearchField { id: searchField - - width: 0 - height: 0 - - visible: false - - persistentSelection: true - + y: (middleRow.anchors.topMargin / 2) - (smallScreen ? (height/10) : 0) + anchors { + horizontalCenter: parent.horizontalCenter + } onTextChanged: { if (tabBar.activeTab == 0) { runnerModel.query = searchField.text; } else { widgetExplorer.widgetsModel.searchTerm = searchField.text; } } - - function clear() { - text = ""; - } - - onSelectionStartChanged: Qt.callLater(searchHeading.updateSelection) - onSelectionEndChanged: Qt.callLater(searchHeading.updateSelection) - } - - TextEdit { - id: searchHeading - - anchors { - horizontalCenter: parent.horizontalCenter - } - - y: (middleRow.anchors.topMargin / 2) - (smallScreen ? (height/10) : 0) - - font.pointSize: dummyHeading.font.pointSize * 1.5 - wrapMode: Text.NoWrap - opacity: 1.0 - - selectByMouse: false - cursorVisible: false - - color: "white" - - text: searching ? i18n("Searching for '%1'", searchField.text) : i18n("Type to search...") - - function updateSelection() { - if (!searchField.selectedText) { - return; - } - - var delta = text.lastIndexOf(searchField.text, text.length - 2); - searchHeading.select(searchField.selectionStart + delta, searchField.selectionEnd + delta); - } - } - - PlasmaComponents.ToolButton { - id: cancelSearchButton - - anchors { - left: searchHeading.right - leftMargin: units.largeSpacing - verticalCenter: searchHeading.verticalCenter - } - - width: units.iconSizes.large - height: width - - visible: (searchField.text != "") - - iconName: "dialog-close" - flat: false - - onClicked: searchField.clear(); - - Keys.onPressed: { - if (event.key === Qt.Key_Tab) { - event.accepted = true; - - if (runnerModel.count) { - mainColumn.tryActivate(0, 0); - } else { - systemFavoritesGrid.tryActivate(0, 0); - } - } else if (event.key === Qt.Key_Backtab) { - event.accepted = true; - - if (tabBar.visible) { - tabBar.focus = true; - } else if (globalFavoritesGrid.enabled) { - globalFavoritesGrid.tryActivate(0, 0); - } else { - systemFavoritesGrid.tryActivate(0, 0); - } - } - } } Row { @@ -398,8 +317,6 @@ elide: Text.ElideRight wrapMode: Text.NoWrap - color: "white" - level: 1 text: i18n("Favorites") @@ -615,8 +532,6 @@ wrapMode: Text.NoWrap opacity: 1.0 - color: "white" - level: 1 text: (tabBar.activeTab == 0) ? funnelModel.description : i18n("Widgets") @@ -970,8 +885,6 @@ wrapMode: Text.NoWrap opacity: 1.0 - color: "white" - level: 1 text: model.display diff --git a/applets/kicker/package/contents/ui/DashboardTabButton.qml b/applets/kicker/package/contents/ui/DashboardTabButton.qml --- a/applets/kicker/package/contents/ui/DashboardTabButton.qml +++ b/applets/kicker/package/contents/ui/DashboardTabButton.qml @@ -21,6 +21,7 @@ import org.kde.plasma.plasmoid 2.0 import org.kde.plasma.extras 2.0 as PlasmaExtras +import org.kde.kirigami 2.8 as Kirigami Item { id: tab @@ -37,7 +38,7 @@ Rectangle { anchors.fill: parent - color: tab.parent.focus ? theme.highlightColor : "black" + color: tab.parent.focus ? theme.complementaryFocusColor : theme.complementaryBackgroundColor opacity: active ? 0.4 : 0.15 Behavior on opacity { SmoothedAnimation { duration: units.shortDuration; velocity: 0.01 } } @@ -53,7 +54,7 @@ opacity: active ? 1.0 : 0.6 Behavior on opacity { SmoothedAnimation { duration: units.shortDuration; velocity: 0.01 } } - color: tab.parent.focus ? theme.highlightedTextColor : "white" + color: Kirigami.Theme.Button.TextColor level: 1 } diff --git a/applets/kicker/package/contents/ui/ItemGridDelegate.qml b/applets/kicker/package/contents/ui/ItemGridDelegate.qml --- a/applets/kicker/package/contents/ui/ItemGridDelegate.qml +++ b/applets/kicker/package/contents/ui/ItemGridDelegate.qml @@ -97,8 +97,6 @@ elide: Text.ElideRight wrapMode: Text.Wrap - color: "white" // FIXME TODO: Respect theming? - text: ("name" in model ? model.name : model.display) } diff --git a/applets/kicker/package/contents/ui/ItemMultiGridView.qml b/applets/kicker/package/contents/ui/ItemMultiGridView.qml --- a/applets/kicker/package/contents/ui/ItemMultiGridView.qml +++ b/applets/kicker/package/contents/ui/ItemMultiGridView.qml @@ -21,6 +21,7 @@ import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.extras 2.0 as PlasmaExtras +import org.kde.kirigami 2.8 as Kirigami import org.kde.plasma.private.kicker 0.1 as Kicker @@ -115,7 +116,7 @@ wrapMode: Text.NoWrap opacity: 1.0 - color: "white" // FIXME TODO: Respect theming? + color: Kirigami.Theme.textColor level: 1