Commit 165aa9b1 authored by Marco Martin's avatar Marco Martin
Browse files

very basic config ui with just colored tiles

parent 4062471b
......@@ -34,6 +34,7 @@ AbstractDelegate {
property var iconImage
property string comment
property bool useIconColors: true
Kirigami.Theme.inherit: !imagePalette.useColors
Kirigami.Theme.textColor: imagePalette.textColor
......@@ -43,7 +44,7 @@ AbstractDelegate {
BigScreen.ImagePalette {
id: imagePalette
source: iconItem.source
property bool useColors: BigScreen.Hack.coloredTiles
property bool useColors: useIconColors
property color backgroundColor: useColors ? suggestedContrast : PlasmaCore.ColorScope.backgroundColor
property color accentColor: useColors ? mostSaturated : PlasmaCore.ColorScope.highlightColor
property color textColor: useColors
......
......@@ -24,5 +24,8 @@
<entry name="enableRemoteSTT" type="Bool">
<default>false</default>
</entry>
<entry name="coloredTiles" type="Bool">
<default>true</default>
</entry>
</group>
</kcfg>
/*
* Copyright 2019 Marco Martin <mart@kde.org>
* Copyright 2019 Aditya Mehra <aix.m@outlook.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
*/
import QtQuick 2.9
import QtQuick.Window 2.3
import QtQuick.Layouts 1.3
import QtQuick.Controls 2.2 as Controls
import org.kde.kirigami 2.11 as Kirigami
import Mycroft 1.0 as Mycroft
Window {
id: window
color: Qt.rgba(0, 0, 0, 0.8)
width: screen.availableGeometry.width
height: screen.availableGeometry.height
Kirigami.Theme.colorSet: Kirigami.Theme.Complementary
Item {
id: contentItem
anchors {
fill: parent
margins: Kirigami.Units.largeSpacing
}
Controls.CheckBox {
id: backgroundCheckbox
z: 999
text: i18n("Use Colored Tiles")
checked: plasmoid.configuration.coloredTiles
onCheckedChanged: plasmoid.configuration.coloredTiles = checked
focus: true
Keys.onEnterPressed: checked = !checked
Keys.onReturnPressed: checked = !checked
KeyNavigation.down: closeButton
}
}
Controls.Button {
id: closeButton
anchors {
bottom: parent.bottom
right: parent.right
}
icon.name: "window-close"
text: i18n("close")
onClicked: window.close()
Keys.onEnterPressed: clicked()
Keys.onReturnPressed: clicked()
KeyNavigation.up: backgroundCheckbox
}
}
......@@ -169,6 +169,13 @@ FocusScope {
onTriggered: plasmoid.nativeInterface.executeCommand("plasma-settings -s -m kcm_audiodevice")
},
Controls.Action {
text: i18n("Home Screen")
icon.name: "view-grid-symbolic"
onTriggered: {
plasmoidConfig.showMaximized();
}
},
Controls.Action {
text: i18n("Wallpaper")
icon.name: "preferences-desktop-wallpaper"
......
......@@ -25,6 +25,7 @@ BigScreen.IconDelegate {
icon.name: modelData ? modelData.ApplicationIconRole : ""
text: modelData ? modelData.ApplicationNameRole : ""
useIconColors: plasmoid.configuration.coloredTiles
onClicked: {
feedbackWindow.open(modelData.ApplicationNameRole, modelData.ApplicationIconRole);
......
......@@ -22,6 +22,7 @@ import org.kde.mycroft.bigscreen 1.0 as BigScreen
BigScreen.IconDelegate {
icon.name: model.icon.name
text: model.text
useIconColors: plasmoid.configuration.coloredTiles
onClicked: {
//feedbackWindow.open(model.text, model.icon.name);
......
......@@ -25,6 +25,7 @@ BigScreen.IconDelegate {
icon.name: modelData && modelData.ApplicationIconRole ? modelData.ApplicationIconRole : ""
text: modelData ? modelData.ApplicationNameRole : ""
useIconColors: plasmoid.configuration.coloredTiles
onClicked: {
plasmoid.nativeInterface.applicationListModel.runApplication(modelData.ApplicationStorageIdRole)
......
......@@ -102,6 +102,10 @@ Item {
id: mycroftWindow
}
ConfigWindow {
id: plasmoidConfig
}
LinearGradient {
anchors {
top: parent.top
......
Markdown is supported
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