diff --git a/contents/ui/AppList.qml b/contents/ui/AppList.qml index 7234bd3..6c677b9 100644 --- a/contents/ui/AppList.qml +++ b/contents/ui/AppList.qml @@ -28,6 +28,8 @@ import QtQuick.Layouts 1.15 import QtQuick.Controls 2.15 import org.kde.draganddrop 2.0 +import QtGraphicalEffects 1.0 + ScrollView { id: scrollView @@ -79,6 +81,7 @@ ScrollView { height: 20 } Image { + id: starImage source: "icons/feather/star.svg" width: 15 height: width @@ -86,9 +89,16 @@ ScrollView { x: parent.width + 10 anchors.verticalCenter: parent.verticalCenter text: "Favorite Apps" - font.family: "SF Pro Text" + color: main.textColor + font.family: main.textFont font.pixelSize: 12 } + ColorOverlay { + visible: plasmoid.configuration.theming != 0 + anchors.fill: starImage + source: starImage + color: main.textColor + } } Item { //Spacer width: 1 @@ -195,7 +205,8 @@ ScrollView { x: parent.width + 10 anchors.verticalCenter: parent.verticalCenter text: "All" - font.family: "SF Pro Text" + color: main.textColor + font.family: main.textFont font.pixelSize: 12 } MouseArea { @@ -224,6 +235,12 @@ ScrollView { sortingImage.state = sortingImage.states[currentStateIndex].name } } + ColorOverlay { + visible: plasmoid.configuration.theming != 0 + anchors.fill: sortingImage + source: sortingImage + color: main.textColor + } } Item { //Spacer id: spacer diff --git a/contents/ui/ConfigGeneral.qml b/contents/ui/ConfigGeneral.qml index c59ccfc..ee95ebc 100644 --- a/contents/ui/ConfigGeneral.qml +++ b/contents/ui/ConfigGeneral.qml @@ -48,7 +48,9 @@ Kirigami.FormLayout { property string cfg_defaultStateIcon: plasmoid.configuration.defaultStateIcon property bool cfg_isCentered: plasmoid.configuration.isCentered property alias cfg_defaultPage: defaultPage.currentIndex + property alias cfg_theming: theming.currentIndex property alias cfg_useExtraRunners: useExtraRunners.checked + property alias cfg_customGreeting: customGreeting.text Button { id: iconButton @@ -191,6 +193,11 @@ Kirigami.FormLayout { cfg_enableGreeting = checked } } + TextField { + id: customGreeting + Kirigami.FormData.label: i18n("Custom Greeting Text:") + placeholderText: "No custom greeting set" + } Item { Kirigami.FormData.isSection: true } @@ -227,7 +234,6 @@ Kirigami.FormLayout { Item { Kirigami.FormData.isSection: true } - CheckBox { id: useExtraRunners @@ -235,4 +241,16 @@ Kirigami.FormLayout { text: i18n("Expand search to bookmarks, files and emails") } + Item { + Kirigami.FormData.isSection: true + } + ComboBox { + id: theming + Kirigami.FormData.label: i18n("Theming:") + model: [ + i18n("Dark (Default)"), + i18n("Light"), + i18n("Matching"), + ] + } } diff --git a/contents/ui/FavoriteItem.qml b/contents/ui/FavoriteItem.qml index 9bdbfcc..bd1ee22 100644 --- a/contents/ui/FavoriteItem.qml +++ b/contents/ui/FavoriteItem.qml @@ -64,8 +64,8 @@ Item { width: appname.width + appicon.width + 3 * 10 + 5 height: 45//40 z: -20 - color: "#202124" - border.color: "#141516" + color: plasmoid.configuration.theming == 0 ? "#202124" : plasmoid.configuration.theming == 1 ? "#E0E1E3" : PlasmaCore.Theme.buttonBackgroundColor + border.color: "transparent" //Qt.darker(color, 1.05) //plasmoid.configuration.theming == 0 ? "141516" : plasmoid.configuration.theming == 1 ? "#FAFAFA" : PlasmaCore.Theme.buttonAlternateBackgroundColor border.width: 1 radius: 6 PlasmaCore.IconItem { @@ -80,18 +80,19 @@ Item { x: appicon.width + 10 anchors.verticalCenter: appicon.verticalCenter text: ("name" in model ? model.name : model.display) - font.family: "SF Pro Text" + color: plasmoid.configuration.theming != 2 ? main.textColor : PlasmaCore.Theme.buttonTextColor + font.family: main.textFont font.pixelSize: 12 } } states: [ State { name: "highlight"; when: (highlighted) - PropertyChanges { target: rect; color: "#292A2E"} + PropertyChanges { target: rect; color: plasmoid.configuration.theming == 0 ? "#292A2E" : plasmoid.configuration.theming == 1 ? "#FFFFFF" : PlasmaCore.Theme.buttonHoverColor } }, State { name: "default"; when: (!highlighted) - PropertyChanges { target: rect; color: "#202124"} + PropertyChanges { target: rect; color: plasmoid.configuration.theming == 0 ? "#202124" : plasmoid.configuration.theming == 1 ? "#F7F7F7" : PlasmaCore.Theme.buttonBackgroundColor } }] transitions: highlight } diff --git a/contents/ui/FloatingAvatar.qml b/contents/ui/FloatingAvatar.qml index cdc6911..0fabed3 100644 --- a/contents/ui/FloatingAvatar.qml +++ b/contents/ui/FloatingAvatar.qml @@ -27,6 +27,8 @@ PlasmaCore.Dialog { //cosmic background noise is less random than the placement property int avatarWidth + flags: Qt.WindowStaysOnTopHint + type: "Notification" x: root.x + root.width / 2 - width / 2 diff --git a/contents/ui/GenericItem.qml b/contents/ui/GenericItem.qml index f7e91bc..ea47d43 100644 --- a/contents/ui/GenericItem.qml +++ b/contents/ui/GenericItem.qml @@ -84,7 +84,7 @@ Item { width: main.width - 40 - allItem.x height: 38 z: -20 - color: "#131314" + color: backdrop.color border.color: "transparent" border.width: 1 radius: 6 @@ -100,18 +100,19 @@ Item { x: appicon.width + 9 anchors.verticalCenter: appicon.verticalCenter text: ("name" in model ? model.name : model.display) - font.family: "SF Pro Text" + color: main.textColor + font.family: main.textFont font.pixelSize: 12 } } states: [ State { name: "highlight"; when: !canNavigate ? highlighted : runnerList.currentMainIndex == index && runnerList.currentSubIndex == subIndex - PropertyChanges { target: rect; color: "#0E0E0F"} + PropertyChanges { target: rect; color: plasmoid.configuration.theming == 0 ? "#0E0E0F" : plasmoid.configuration.theming == 1 ? "#FFFFFF" : PlasmaCore.Theme.buttonFocusColor} }, State { name: "default"; when: !canNavigate ? !highlighted : runnerList.currentMainIndex != index || runnerList.currentSubIndex != subIndex - PropertyChanges { target: rect; color: "#131314"} + PropertyChanges { target: rect; color: backdrop.color} }] transitions: highlight } diff --git a/contents/ui/Header.qml b/contents/ui/Header.qml index 6495c11..c249ca3 100644 --- a/contents/ui/Header.qml +++ b/contents/ui/Header.qml @@ -44,19 +44,18 @@ Item { y: 2 * iconSize } Image { - anchors.verticalCenter: parent.verticalCenter - anchors.horizontalCenter: parent.horizontalCenter - source: "icons/feather/settings.svg" - width: iconSize - height: width - /* - sourceSize: Qt.size( imgS.sourceSize.width, imgS.sourceSize.height) - Image { - id: imgS - source: parent.source - width: 0 - height: 0 - }*/ + id: settingsImage + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter + source: "icons/feather/settings.svg" + width: iconSize + height: width + ColorOverlay { + visible: plasmoid.configuration.theming != 0 + anchors.fill: settingsImage + source: settingsImage + color: main.textColor + } } onClicked: { KQuickAddons.KCMShell.openSystemSettings("kcm_quick") @@ -76,19 +75,18 @@ Item { text: "Power Off" } Image { - anchors.verticalCenter: parent.verticalCenter - anchors.horizontalCenter: parent.horizontalCenter - source: "icons/feather/power.svg" - width: iconSize - height: width - /* - sourceSize: Qt.size( imgP.sourceSize.width, imgP.sourceSize.height) - Image { - id: imgP - source: parent.source - width: 0 - height: 0 - }*/ + id: powerImage + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter + source: "icons/feather/power.svg" + width: iconSize + height: width + ColorOverlay { + visible: plasmoid.configuration.theming != 0 + anchors.fill: powerImage + source: powerImage + color: main.textColor + } } onClicked: { pmEngine.performOperation("requestShutDown") diff --git a/contents/ui/MainView.qml b/contents/ui/MainView.qml index f789c51..22294bc 100644 --- a/contents/ui/MainView.qml +++ b/contents/ui/MainView.qml @@ -22,14 +22,18 @@ import QtGraphicalEffects 1.12 import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 3.0 as PlasmaComponents import org.kde.kcoreaddons 1.0 as KCoreAddons +import QtGraphicalEffects 1.0 Item { id: main anchors.fill: parent - property bool searching: (searchBar.text != "") signal newTextQuery(string text) + readonly property color textColor: plasmoid.configuration.theming == 0 ? "#FFFFFF" : plasmoid.configuration.theming == 1 ? "#000000" : PlasmaCore.Theme.textColor + readonly property string textFont: plasmoid.configuration.theming == 2 ? PlasmaCore.Theme.defaultFont : "SF Pro Text" + + KCoreAddons.KUser { id: kuser } @@ -64,7 +68,7 @@ Item { y: 200 //175 width: main.width height: main.height - y - color: '#131314' + color: plasmoid.configuration.theming == 0 ? "#131314" : plasmoid.configuration.theming == 1 ? "#ECEDEE" : PlasmaCore.Theme.backgroundColor } //Floating Avatar Item { @@ -93,9 +97,9 @@ Item { id: nameLabel x: main.width / 2 - width / 2 //This centeres the Text y: 80//60 - text: plasmoid.configuration.enableGreeting ? 'Hi, ' + kuser.fullName : i18n("%1@%2", kuser.loginName, kuser.host) - - font.family: 'SF Pro Text' //This is the font that was used in the original design by Max McKinney + text: plasmoid.configuration.enableGreeting && plasmoid.configuration.customGreeting ? plasmoid.configuration.customGreeting : plasmoid.configuration.enableGreeting ? 'Hi, ' + kuser.fullName : i18n("%1@%2", kuser.loginName, kuser.host) + color: textColor + font.family: textFont //This is the font that was used in the original design by Max McKinney font.pixelSize: 16 } } @@ -107,7 +111,7 @@ Item { width: main.width - 2 * x height: 45//40 radius: 6 - color: '#202124' + color: plasmoid.configuration.theming == 0 ? "#202124" : plasmoid.configuration.theming == 1 ? "#FFFFFF" : PlasmaCore.Theme.viewBackgroundColor Image { id: searchIcon x: 15 @@ -115,6 +119,12 @@ Item { height: width anchors.verticalCenter: parent.verticalCenter source: 'icons/feather/search.svg' + ColorOverlay { + visible: plasmoid.configuration.theming != 0 + anchors.fill: searchIcon + source: searchIcon + color: main.textColor + } } Rectangle { x: 45 @@ -133,15 +143,15 @@ Item { width: parent.width anchors.verticalCenter: parent.verticalCenter focus: true - color: 'white' + color: textColor selectByMouse: true - selectionColor: '#141414' - font.family: 'SF Pro Text' + selectionColor: plasmoid.configuration.theming == 0 ? "#141414" : plasmoid.configuration.theming == 1 ? "#EBEBEB" : PlasmaCore.Theme.highlightedTextColor + font.family: textFont font.pixelSize: 13 Text { anchors.fill: parent text: 'Search your computer' - color: '#686B71' + color: plasmoid.configuration.theming == 0 ? "#686B71" : plasmoid.configuration.theming == 1 ? "#798591" : PlasmaCore.Theme.disabledTextColor visible: !parent.text } onTextChanged: { @@ -258,8 +268,8 @@ Item { height: 40//20 anchors.top: backdrop.top gradient: Gradient { - GradientStop { position: 0.0; color: "#0d0d0d" } - GradientStop { position: 1.0; color: "transparent" } + GradientStop { position: 0.0; color: Qt.darker(backdrop.color, 1.5) } + GradientStop { position: 1.0; color: "transparent" }//"#0d0d0d" } states: [ State { @@ -284,7 +294,7 @@ Item { anchors.bottom: backdrop.bottom gradient: Gradient { GradientStop { position: 0.0; color: "transparent" } - GradientStop { position: 1.0; color: "#0d0d0d"} + GradientStop { position: 1.0; color: Qt.darker(backdrop.color, 1.5)} } states: [ State { diff --git a/contents/ui/MenuRepresentation.qml b/contents/ui/MenuRepresentation.qml index da67c55..3d21d78 100644 --- a/contents/ui/MenuRepresentation.qml +++ b/contents/ui/MenuRepresentation.qml @@ -31,7 +31,7 @@ PlasmaCore.Dialog { objectName: "popupWindow" flags: Qt.WindowStaysOnTopHint - location: PlasmaCore.Types.Floating + //location: PlasmaCore.Types.Floating hideOnWindowDeactivate: true onVisibleChanged: { @@ -78,7 +78,7 @@ PlasmaCore.Dialog { x = (appletTopLeft.x < horizMidPoint) ? screen.x : (screen.x + screen.width) - width; } - y = screen.height - fs.height + root.margins.bottom; + y = screen.height - fs.height + root.margins.bottom + root.margins.top; return Qt.point(x, y); } @@ -86,8 +86,10 @@ PlasmaCore.Dialog { FocusScope { id: fs focus: true - width: 515//450 - height: 600//530 + Layout.minimumWidth: 515//450 + Layout.minimumHeight: 600//530 + Layout.maximumWidth: Layout.minimumWidth + Layout.maximumHeight: Layout.minimumHeight Item { x: - root.margins.left @@ -110,7 +112,6 @@ PlasmaCore.Dialog { function refreshModel() { main.reload() - console.log("[McKinney Launcher] Refreshed Model") } Component.onCompleted: { diff --git a/contents/ui/RunnerList.qml b/contents/ui/RunnerList.qml index d2ca865..54b481b 100644 --- a/contents/ui/RunnerList.qml +++ b/contents/ui/RunnerList.qml @@ -29,6 +29,8 @@ import org.kde.plasma.components 3.0 as PlasmaComponents import QtQuick.Layouts 1.15 import QtQuick.Controls 2.15 +import QtGraphicalEffects 1.0 + PlasmaExtras.ScrollArea { id: runnerList property alias model: repeater.model @@ -101,9 +103,16 @@ PlasmaExtras.ScrollArea { x: parent.width + 10 anchors.verticalCenter: parent.verticalCenter text: repeater.model.modelForRow(index).description - font.family: "SF Pro Text" + color: main.textColor + font.family: main.textFont font.pixelSize: 12 } + ColorOverlay { + visible: plasmoid.configuration.theming != 0 + anchors.fill: image + source: image + color: main.textColor + } } } NavGrid {