Inital commit of the Komplex Hub

This commit is contained in:
Digital Artifex
2026-06-02 15:11:36 -04:00
commit 15a625008e
2911 changed files with 655555 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
import QtQuick
import QtQuick.Controls 2.15
import KomplexHub
import org.kde.kirigami as Kirigami
ApplicationWindow {
visible: true
flags: Qt.Window
title: "KomplexHub"
color: "transparent"
minimumWidth: 720
MainScreen {
antialiasing: true
id: mainScreen
anchors.fill: parent
}
}
+22
View File
@@ -0,0 +1,22 @@
### This file is automatically generated by Qt Design Studio.
### Do not change
qt_add_library(KomplexHubContent STATIC)
qt6_add_qml_module(KomplexHubContent
URI "KomplexHubContent"
VERSION 1.0
RESOURCE_PREFIX "/qt/qml"
QML_FILES
"App.qml"
"MainScreen.qml"
"pages/HomePage.qml"
"pages/ImageSearchPage.qml"
"pages/InstalledWallpaperPage.qml"
"pages/LiveSearchPage.qml"
"pages/LoginPage.qml"
"pages/SettingsPage.qml"
"pages/UserProfilePage.qml"
"pages/WallpaperSettingsPage.qml"
)
+297
View File
@@ -0,0 +1,297 @@
/*
This is a UI file (.ui.qml) that is intended to be edited in Qt Design Studio only.
It is supposed to be strictly declarative and only uses a subset of QML. If you edit
this file manually, you might introduce QML code that is not supported by Qt Design Studio.
Check out https://doc.qt.io/qtcreator/creator-quick-ui-forms.html for details on .ui.qml files.
*/
import QtQuick
import QtQuick.Controls 2.0
import QtQuick.Layouts
import KomplexHub
import KomplexHub.Controls
import KomplexHub.Kero
Rectangle {
property MenuButton currentMenuButton
id: windowRoot
color: palette.window
RowLayout {
id: windowRootLayout
anchors.fill: parent
spacing: 0
Rectangle {
id: windowMenu
Layout.fillWidth: false
Layout.fillHeight: true
Layout.preferredWidth: 100
Layout.minimumWidth: 100
Layout.maximumWidth: 100
color: palette.base.lighter()
ColumnLayout {
id: windowMenuLayout
anchors.fill: parent
MenuButton {
id: homeMenubutton
Layout.alignment: Qt.AlignTop
height: 64
width: 100
text: "Home"
icon.height: 32
icon.width: 32
icon.url: "qrc:/images/icons/icons8-famous.svg"
onTriggered: () => {
pageLoader.page = "pages/HomePage.qml"
currentMenuButton.selected = false
currentMenuButton = this
searchContainer.preferredHeight = 0
}
}
MenuButton {
Layout.alignment: Qt.AlignTop
height: 64
width: 100
text: "Images"
icon.height: 32
icon.width: 32
icon.url: "qrc:/images/icons/icons8-image.svg"
onTriggered: () => {
pageLoader.page = "pages/ImageSearchPage.qml"
currentMenuButton.selected = false
currentMenuButton = this
searchContainer.preferredHeight = 50
}
}
MenuButton {
Layout.alignment: Qt.AlignTop
height: 64
width: 100
text: "Live"
icon.height: 32
icon.width: 32
icon.url: "qrc:/images/icons/icons8-biotech.svg"
onTriggered: () => {
pageLoader.page = "pages/LiveSearchPage.qml"
currentMenuButton.selected = false
currentMenuButton = this
searchContainer.preferredHeight = 50
}
}
MenuButton {
Layout.alignment: Qt.AlignTop
height: 64
width: 100
text: "Installed"
icon.height: 32
icon.width: 32
icon.url: "qrc:/images/icons/icons8-hdd.svg"
onTriggered: () => {
pageLoader.page = "pages/InstalledWallpaperPage.qml"
currentMenuButton.selected = false
currentMenuButton = this
searchContainer.preferredHeight = 0
}
}
Item {
Layout.fillHeight: true
}
MenuButton {
Layout.alignment: Qt.AlignBottom
height: 64
width: 100
text: "Settings"
icon.height: 32
icon.width: 32
icon.url: "qrc:/images/icons/icons8-settings.svg"
onTriggered: () => {
pageLoader.page = "pages/SettingsPage.qml"
currentMenuButton.selected = false
currentMenuButton = this
searchContainer.preferredHeight = 0
}
}
}
}
Rectangle {
//Kirigami.Theme.colorSet: Kirigami.Theme.View
id: windowContainer
Layout.fillHeight: true
Layout.fillWidth: true
color: "transparent"
ColumnLayout {
id: windowContainerLayout
anchors.fill: parent
spacing: 0
SearchBar {
property int preferredHeight: 50
id: searchContainer
color: palette.base.lighter()
Layout.fillHeight: false
Layout.fillWidth: true
Layout.preferredHeight: preferredHeight
icon: "qrc:/images/icons/icons8-search.svg"
Behavior on preferredHeight {
NumberAnimation { duration: Constants.normalAnimationDuration }
}
}
Rectangle {
id: windowContent
Layout.fillHeight: true
Layout.fillWidth: true
Layout.leftMargin: 0
Layout.topMargin: 0
color: palette.base.darker()
Loader {
property bool loading: false
property string page
anchors.fill: parent
onPageChanged: () => {
loading = true
fadeOutPage()
}
id: pageLoader
OpacityAnimator on opacity {
id: pageLoaderAnimation
target: pageLoader
duration: 150
onFinished: () => {
if(pageLoader.loading && pageLoader.opacity === 0)
pageLoader.loadPage()
else if(pageLoader.loading && pageLoader.opacity === 1)
pageLoader.loading = false
}
}
function fadeOutPage() {
pageLoaderAnimation.from = 1
pageLoaderAnimation.to = 0
pageLoaderAnimation.start()
}
function fadeInPage() {
if(pageLoader.sourceComponent.status != Component.Ready)
return
pageLoaderAnimation.from = 0
pageLoaderAnimation.to = 1
pageLoaderAnimation.start()
}
function loadPage() {
sourceComponent = Qt.createComponent(page)
if(pageLoader.sourceComponent.status == Component.Ready)
fadeInPage()
else
statusChanged.connect(fadeInPage)
}
}
}
}
}
}
KeroBuildingAnimation {
id: buildingOverlay
anchors.fill: parent
visible: false
}
KeroLoadingAnimation {
id: loadingAnimation
anchors.fill: parent
// OpacityAnimator on opacity {
// duration: 150
// }
visible: opacity > 0
opacity: 0
}
Component.onCompleted: () => {
homeMenubutton.selected = true
currentMenuButton = homeMenubutton
pageLoader.page = "pages/HomePage.qml"
searchContainer.preferredHeight = 0
loadingAnimation.opacity = 0
}
states: [
State {
name: "build_error"
PropertyChanges {
target: windowOverlay
visible: true
}
},
State {
name: "building"
PropertyChanges {
target: buildingOverlay
visible: true
}
},
State {
name: "build_complete"
}
]
}
+141
View File
@@ -0,0 +1,141 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import KomplexHub
import KomplexHub.Controls
import KomplexHub.Kero
Item {
readonly property bool searchable: false
property int resultsPerRow: (homePageRoot.width - (64 + Constants.largeMargin)) / (256 + Constants.largeMargin)
id: homePageRoot
Rectangle {
anchors.fill: parent
color: palette.base
ScrollView {
anchors.fill: parent
anchors.margins: Constants.largeMargin
ColumnLayout {
width: homePageRoot.width
// Featured Results
ColumnLayout {
width: parent.width
height: 420
Text {
color: palette.text
font.pixelSize: Constants.largeFont.pixelSize
text: "Featured"
}
RowLayout {
Layout.fillWidth: true
Layout.preferredHeight: 256
Layout.alignment: Qt.AlignHCenter
Repeater {
model: resultsPerRow
delegate: SearchResultItem {
}
}
SquareButton {
Layout.fillHeight: true
Layout.preferredWidth: 64
icon.source: "qrc:/images/icons/icons8-forward.svg"
icon.height: 24
icon.width: 24
}
}
}
Item {
height: Constants.largeMargin
}
ColumnLayout {
width: parent.width
height: 420
Text {
color: palette.text
font.pixelSize: Constants.largeFont.pixelSize
text: "Newest"
}
RowLayout {
Layout.fillWidth: true
Layout.preferredHeight: 256
Layout.alignment: Qt.AlignHCenter
Repeater {
model: resultsPerRow
delegate: SearchResultItem {
}
}
SquareButton {
Layout.fillHeight: true
Layout.preferredWidth: 64
icon.source: "qrc:/images/icons/icons8-forward.svg"
icon.height: 24
icon.width: 24
}
}
}
Item {
height: Constants.largeMargin
}
ColumnLayout {
width: parent.width
height: 420
Text {
color: palette.text
font.pixelSize: Constants.largeFont.pixelSize
text: "Popular"
}
RowLayout {
Layout.fillWidth: true
Layout.preferredHeight: 256
Layout.alignment: Qt.AlignHCenter
Repeater {
model: resultsPerRow
delegate: SearchResultItem {
}
}
SquareButton {
Layout.fillHeight: true
Layout.preferredWidth: 64
icon.source: "qrc:/images/icons/icons8-forward.svg"
icon.height: 24
icon.width: 24
}
}
}
}
}
}
}
@@ -0,0 +1,78 @@
import QtQuick
import QtQuick.Controls
import KomplexHub
import KomplexHub.Controls
import KomplexHub.Kero
Item {
id: imageSearchPageRoot
SearchResultList {
id: searchResultList
anchors.fill: parent
color: palette.base
}
KeroErrorAvatar {
id: errorOverlay
anchors.fill: parent
opacity: 0
}
KeroNoResultsAvatar {
id: noResultsOverlay
anchors.fill: parent
opacity: 0
}
KeroLoadingAnimation {
id: loadingOverlay
anchors.fill: parent
opacity: 0
}
states: [
State {
name: "loading"
when: searchResultList.state === "loading"
PropertyChanges {
target: loadingOverlay
opacity: 1
}
PropertyChanges {
target: resultsView
opacity: 0
}
},
State {
name: "empty"
when: searchResultList.state === "empty"
PropertyChanges {
target: noResultsOverlay
opacity: 1
}
PropertyChanges {
target: resultsView
opacity: 0
}
},
State {
name: "error"
when: searchResultList.state === "error"
PropertyChanges {
target: errorOverlay
opacity: 1
}
PropertyChanges {
target: resultsView
opacity: 0
}
}
]
}
@@ -0,0 +1,138 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtQuick.Dialogs
import KomplexHub
import KomplexHub.Controls
import KomplexHub.Kero
import KomplexHubPlugin
Rectangle {
id: root
color: palette.base
ListView {
id: view
anchors.fill: parent
InstalledPackManager {
id: manager
}
model: manager
delegate: Rectangle {
required property string name
required property string author
required property string description
required property string thumbnail
required property string uri
width: view.width
height: 50
border.color: palette.base.lighter()
color: "transparent"
RowLayout {
anchors.fill: parent
Rectangle {
color: palette.base.darker()
border.color: palette.base.lighter()
Layout.preferredHeight: 35
Layout.preferredWidth: 35
Layout.leftMargin: 12
Image {
anchors.fill: parent
source: thumbnail
}
}
ColumnLayout {
Layout.fillWidth: true
Text {
Layout.fillWidth: true
text: name
color: palette.text
}
Text {
Layout.fillWidth: true
text: author
color: palette.text
}
}
SquareButton {
Layout.preferredHeight: 35
Layout.preferredWidth: 35
Layout.alignment: Qt.AlignRight
Layout.rightMargin: 12
icon.source: "qrc:/images/icons/icons8-trash.svg"
onTriggered: () => {
askToUninstall(uri)
}
}
}
}
}
function askToUninstall(uri) {
uninstallMessageDialog.uri = uri
uninstallMessageDialog.visible = true
}
function uninstall(uri) {
if(!manager.uninstall(uri));
}
MessageDialog {
property string uri: ""
id: uninstallMessageDialog
text: qsTr("Wallpaper Pack Will Be Uninstalled")
informativeText: qsTr("This action cannot be undone. Proceed?")
buttons: MessageDialog.Ok | MessageDialog.Cancel
onButtonClicked: (button, role) => {
switch (button) {
case MessageDialog.Ok:
if(!uninstall(uri))
uninstallErrorDialog.visible = true
else
manager.rescan()
break;
}
}
}
MessageDialog {
id: uninstallErrorDialog
text: qsTr("Wallpaper Failed To Uninstall")
informativeText: manager.errorString
buttons: MessageDialog.Ok
}
KeroLoadingAnimation {
id: loadingAnimation
anchors.fill: parent
visible: false
color: palette.base.alpha(1)
}
states:[
State {
name: "loading"
when: manager.state == InstalledPackManager.Loading
PropertyChanges {
target: loadingAnimation
visible: true
}
}
]
}
@@ -0,0 +1,78 @@
import QtQuick
import QtQuick.Controls
import KomplexHub
import KomplexHub.Controls
import KomplexHub.Kero
Item {
id: imageSearchPageRoot
SearchResultList {
id: searchResultList
anchors.fill: parent
color: palette.base
}
KeroErrorAvatar {
id: errorOverlay
anchors.fill: parent
opacity: 0
}
KeroNoResultsAvatar {
id: noResultsOverlay
anchors.fill: parent
opacity: 0
}
KeroLoadingAnimation {
id: loadingOverlay
anchors.fill: parent
opacity: 0
}
states: [
State {
name: "loading"
when: searchResultList.state === "loading"
PropertyChanges {
target: loadingOverlay
opacity: 1
}
PropertyChanges {
target: resultsView
opacity: 0
}
},
State {
name: "empty"
when: searchResultList.state === "empty"
PropertyChanges {
target: noResultsOverlay
opacity: 1
}
PropertyChanges {
target: resultsView
opacity: 0
}
},
State {
name: "error"
when: searchResultList.state === "error"
PropertyChanges {
target: errorOverlay
opacity: 1
}
PropertyChanges {
target: resultsView
opacity: 0
}
}
]
}
+88
View File
@@ -0,0 +1,88 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import KomplexHub
import KomplexHub.Controls
Item {
id: loginFormRoot
ColumnLayout {
anchors.centerIn: parent
Image {
source: "qrc:/images/icons/icons8-user-account.svg"
Layout.preferredHeight: 64
Layout.preferredWidth: 64
Layout.alignment: Qt.AlignCenter
}
// KeroLoginAvatar {
// Layout.preferredWidth: 380
// Layout.preferredHeight: 380
// description: ""
// Layout.alignment: Qt.AlignCenter
// }
// Image {
// source: "images/kero/kero_choice.png"
// Layout.preferredWidth: 380
// Layout.preferredHeight: 380
// Layout.alignment: Qt.AlignCenter
// }
ColumnLayout {
Layout.fillWidth: true
Layout.alignment: Qt.AlignCenter
ColumnLayout {
Layout.fillWidth: true
Text {
Layout.fillWidth: false
text: "Username"
font.pixelSize: Constants.largeFont.pixelSize
}
LineEdit {
Layout.preferredHeight: 32
Layout.preferredWidth: 256
}
}
ColumnLayout {
Layout.fillWidth: true
Text {
Layout.fillWidth: false
text: "Password"
font.pixelSize: Constants.largeFont.pixelSize
}
LineEdit {
Layout.preferredHeight: 32
Layout.preferredWidth: 256
}
}
RowLayout {
clip: true
Layout.maximumWidth: 250
Layout.leftMargin: 3
SquareButton {
Layout.preferredHeight: 36
Layout.preferredWidth: 36
icon.source: "qrc:/images/icons/icons8-cancel.svg"
}
SquareButton {
Layout.fillWidth: true
icon.source: "qrc:/images/icons/icons8-login.svg"
text: qsTr("Login")
}
}
}
}
}
+187
View File
@@ -0,0 +1,187 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import KomplexHub
import KomplexHub.Kero
Item {
readonly property bool searchable: false
id: settingsPageRoot
Rectangle {
anchors.fill: parent
color: palette.base
ColumnLayout {
anchors.fill: parent
TabBar {
id: bar
Layout.fillHeight: false
Layout.fillWidth: true
TabButton {
text: qsTr("Wallpaper")
}
TabButton {
text: qsTr("Account")
}
TabButton {
text: qsTr("About")
}
}
StackLayout {
Layout.fillHeight: true
Layout.fillWidth: true
currentIndex: bar.currentIndex
Item {
id: wallpaperTab
Layout.fillHeight: true
Layout.fillWidth: true
WallpaperSettingsPage {
anchors.fill: parent
}
}
Item {
id: accountTab
Layout.fillHeight: true
Layout.fillWidth: true
UserProfilePage {
anchors.fill: parent
}
}
Item {
Layout.fillHeight: true
Layout.fillWidth: true
property string title: qsTr("Hello!")
property string contributors: qsTr("DigitalArtifex
fridje")
property string thanks: qsTr("Icons8
ShaderToy
Pexels")
id: keroHelloAvatarRoot
Rectangle {
anchors.fill: parent
color: "transparent"
ColumnLayout {
anchors.fill: parent
KeroHelloAvatar {
Layout.fillHeight: true
Layout.fillWidth: true
antialiasing: true
}
Item { Layout.preferredHeight: 36 }
Text {
Layout.fillHeight: false
Layout.fillWidth: true
Layout.margins: Constants.largeMargin
text: qsTr("Meet Kero, the small but tireless spirit behind Komplex, a curious little dragon whose name echoes the cheerful sound of a frogs call. Hailing from the realm of **Kairoku**, Kero honed his skill in a place where unfinished ideas drift like clouds and raw creativity hums in the air.")
color: palette.text
Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom
Layout.bottomMargin: Constants.largeMargin
wrapMode: Text.WordWrap
textFormat: Text.MarkdownText
}
Text {
Layout.fillHeight: false
Layout.fillWidth: true
Layout.margins: Constants.largeMargin
text: qsTr("In Kairoku, landscapes arent painted...theyre assembled, animated, and brought to life through careful craftsmanship. Kero was once an apprentice there, learning how to shape reactive skies, breathing forests, and shimmering cityscapes. With his trusty tools and a builders instinct, he became known for turning even the simplest concept into something that felt alive.")
color: palette.text
Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom
Layout.bottomMargin: Constants.largeMargin
wrapMode: Text.WordWrap
textFormat: Text.MarkdownText
}
Item { Layout.fillHeight: true }
RowLayout {
Layout.fillWidth: true
Layout.alignment: Qt.AlignTop | Qt.AlignRight
ColumnLayout {
Layout.alignment: Qt.AlignTop | Qt.AlignRight
Layout.margins: Constants.largeMargin
Layout.fillHeight: true
Text {
text: qsTr("Contributors")
color: palette.text.darker()
font: Constants.h5Font
Layout.alignment: Qt.AlignTop
Layout.bottomMargin: Constants.largeMargin
wrapMode: Text.WordWrap
textFormat: Text.MarkdownText
}
Text {
id: contributorText
text: keroHelloAvatarRoot.contributors
color: palette.text.darker()
Layout.alignment: Qt.AlignBottom
Layout.bottomMargin: Constants.largeMargin
wrapMode: Text.WordWrap
textFormat: Text.MarkdownText
}
}
ColumnLayout {
Layout.alignment: Qt.AlignTop | Qt.AlignRight
Layout.margins: Constants.largeMargin
Layout.fillHeight: true
Text {
text: qsTr("Special Thanks")
color: palette.text.darker()
font: Constants.h5Font
Layout.alignment: Qt.AlignTop
Layout.bottomMargin: Constants.largeMargin
wrapMode: Text.WordWrap
textFormat: Text.MarkdownText
}
Text {
id: thanksText
text: keroHelloAvatarRoot.thanks
color: palette.text.darker()
Layout.alignment: Qt.AlignBottom
Layout.bottomMargin: Constants.largeMargin
wrapMode: Text.WordWrap
textFormat: Text.MarkdownText
}
}
}
}
}
}
}
}
}
}
@@ -0,0 +1,60 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import KomplexHub
Item {
id: root
ColumnLayout {
anchors.fill: parent
RowLayout {
Layout.fillWidth: true
Image {
Layout.preferredHeight: 128
Layout.preferredWidth: 128
id: userAccountImage
source: "qrc:/images/icons/icons8-user-account.svg"
}
ColumnLayout {
Layout.alignment: Qt.AlignTop
Layout.topMargin: Constants.largeMargin
Layout.leftMargin: Constants.largeMargin
Layout.bottomMargin: Constants.largeMargin
Layout.rightMargin: Constants.largeMargin
Layout.fillWidth: true
Layout.fillHeight: true
Text {
text: qsTr("Username")
font.pixelSize: Constants.largeFont.pixelSize
font.bold: true
color: palette.text
}
Text {
text: qsTr("Thursday, April 30th 2026")
font.pixelSize: Constants.mediumMargin.pixelSize
color: palette.text
}
RowLayout {
Text {
text: qsTr("Wallpapers Submitted:")
font.pixelSize: Constants.largeFont.pixelSize
color: palette.text
}
Text {
text: qsTr("12")
font.pixelSize: Constants.largeFont.pixelSize
font.bold: true
color: palette.text
}
}
}
}
}
}
@@ -0,0 +1,649 @@
/*
* Komplex Wallpaper Engine
* Copyright (C) 2025 @DigitalArtifex | github.com/DigitalArtifex
*
* config.qml
*
* This component provides a configuration interface for the Komplex Wallpaper Engine,
* allowing users to customize shader settings, channel configurations, and other
* parameters related to the wallpaper engine.
*
* 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 3 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, see <https://www.gnu.org/licenses/>
*/
// pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Controls
import QtQuick.Dialogs
import QtQuick.Layouts
//import org.kde.kirigami as Kirigami
//import org.kde.plasma.core as PlasmaCore
import QtCore
import Qt.labs.folderlistmodel 2.15
import KomplexHub
import KomplexHub.Controls
import KomplexHubPlugin
//import com.github.digitalartifex.komplex 1.0 as Komplex
Item
{
SettingsManager {
id: manager
onError: (title, message) => {
console.log(title + ": " + message)
}
}
id: root
property alias cfg_pauseMode: pauseModeCombo.currentIndex
property alias cfg_isPaused: runningCombo.checked
property alias cfg_shaderSpeed: speedSlider.value
property alias cfg_mouseSpeedBias: mouseBiasSlider.value
property bool cfg_infoPlasma6Preview_dismissed
property bool cfg_warningResources_dismissed
property bool cfg_emergencyHelp_dismissed
property bool cfg_infoiChannelSettings_dismissed
property alias cfg_checkActiveScreen: activeScreenOnlyCheckbox.checked
property alias cfg_excludeWindows: excludeWindows.windows
property alias cfg_running: runningCombo.checked
property alias cfg_resolution_x: resolutionXField.value
property alias cfg_resolution_y: resolutionYField.value
property alias cfg_framerate_limit: frameRateField.value
property bool cfg_shader_updated
property string shaderPackage: ""
property int shaderPackageIndex: 0
property real shaderSpeed: 1.0
property int resolutionX: 1080
property int resolution: 1920
property bool enableMouseTracking: true
property real mouseTrackingBias: 0.5
Rectangle {
anchors.fill: parent
color: "transparent"
clip: true
ScrollView {
id: wallpaperSettingsScrollView
anchors.fill: parent
anchors.margins: Constants.largeMargin
ColumnLayout {
width: wallpaperSettingsScrollView.width
Text {
text: qsTr("Wallpaper Options")
font: Constants.h2Font
color: palette.text
}
Item { Layout.preferredHeight: Constants.smallMargin }
ComboBox
{
property string shader
Layout.fillWidth: true
Layout.preferredHeight: 36
Layout.margins: Constants.smallMargin
id: selectedShaderPack
model: manager.availableShaderPacks
delegate: Component
{
id: packListDelegate
ItemDelegate
{
width: parent ? parent.width : 0
text: modelData
}
}
textRole: "modelData"
currentIndex: manager.shaderPackIndex
displayText: currentIndex === -1 ? "Custom File" : currentText.replace("_", " ").charAt(0).toUpperCase() + currentText.replace("_", " ").slice(1)
// onCurrentTextChanged:
// {
// root.cfg_shader_package_index = currentIndex;
// if (root.cfg_shader_package_index === -1)
// return;
// var source = currentText
// shaderPackModel.loadMetadata(source)
// root.cfg_shader_package = "file://" + shaderPackModel.path(source)
// }
}
Item { Layout.preferredHeight: Constants.smallMargin }
RowLayout {
Layout.fillWidth: true
Layout.margins: Constants.smallMargin
Text {
text: qsTr("Render Resolution")
font: Constants.h3Font
color: palette.text
Layout.preferredHeight: 36
verticalAlignment: Text.AlignVCenter
}
Text {
text: qsTr("X")
font: Constants.h3Font
color: palette.text
Layout.preferredHeight: 36
Layout.preferredWidth: 64
verticalAlignment: Text.AlignVCenter
}
TextField {
property int value: manager.resolutionX
Layout.preferredHeight: 36
Layout.preferredWidth: 36 * 3
id: resolutionXField
inputMethodHints: Qt.ImhFormattedNumbersOnly
horizontalAlignment: Text.AlignRight
text: value
onEditingFinished: () =>
{
value = parseInt(text)
}
Keys.onPressed: (event) =>
{
if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter)
{
resolutionXField.focus = false; // Unfocus the TextField
event.accepted = true; // Prevent further propagation of the key event
}
}
background: Rectangle
{
color: resolutionXField.activeFocus ? palette.base : "transparent"
border.color: resolutionXField.activeFocus ? palette.highlight : "transparent"
border.width: 1
radius: 4
anchors.fill: resolutionXField
anchors.margins: -2
}
}
Text {
text: qsTr("Y")
font: Constants.h3Font
color: palette.text
Layout.preferredHeight: 36
Layout.preferredWidth: 64
verticalAlignment: Text.AlignVCenter
}
TextField {
property int value: manager.resolutionY
Layout.preferredHeight: 36
Layout.preferredWidth: 36 * 3
id: resolutionYField
inputMethodHints: Qt.ImhFormattedNumbersOnly
horizontalAlignment: Text.AlignRight
text: value
onEditingFinished: () =>
{
value = parseInt(text)
}
Keys.onPressed: (event) =>
{
if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter)
{
resolutionYField.focus = false; // Unfocus the TextField
event.accepted = true; // Prevent further propagation of the key event
}
}
background: Rectangle
{
color: resolutionYField.activeFocus ? palette.base : "transparent"
border.color: resolutionYField.activeFocus ? palette.highlight : "transparent"
border.width: 1
radius: 4
anchors.fill: resolutionYField
anchors.margins: -2
}
}
}
Item { Layout.preferredHeight: Constants.smallMargin }
RowLayout
{
Layout.fillWidth: true
Text {
text: qsTr("Frame Rate")
font: Constants.h3Font
color: palette.text
Layout.preferredHeight: 36
}
Slider
{
id: frameRateSlider
Layout.fillWidth: true
Layout.preferredHeight: 36
from: 1
to: 60
stepSize: 0.01
onValueChanged: frameRateField.text = String(value.toFixed(2));
Component.onCompleted: () => {
value = manager.targetFramerate
}
}
TextField
{
property int value
id: frameRateField
inputMethodHints: Qt.ImhFormattedNumbersOnly
horizontalAlignment: Text.AlignRight
Layout.preferredWidth: 36 * 3
Layout.preferredHeight: 36
onEditingFinished: () =>
{
value = parseInt(text)
}
Keys.onPressed: (event) =>
{
if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter)
{
frameRateField.focus = false; // Unfocus the TextField
event.accepted = true; // Prevent further propagation of the key event
}
}
background: Rectangle
{
color: frameRateField.activeFocus ? palette.base : "transparent"
border.color: frameRateField.activeFocus ? palette.highlight : "transparent"
border.width: 1
radius: 4
anchors.fill: frameRateField
anchors.margins: -2
}
}
}
Item { Layout.preferredHeight: Constants.smallMargin }
RowLayout
{
id: speedLayout
Layout.fillWidth: true
Text {
text: qsTr("Shader Speed")
font: Constants.h3Font
color: palette.text
verticalAlignment: Text.AlignVCenter
Layout.preferredHeight: 36
}
Slider
{
id: speedSlider
Layout.preferredHeight: 36
Layout.fillWidth: true
from: -4.0
to: 4.0
stepSize: 0.01
onValueChanged: shaderSpeedField.text = String(value.toFixed(2));
Component.onCompleted: () => {
value = manager.shaderSpeed
}
}
TextField
{
id: shaderSpeedField
inputMethodHints: Qt.ImhFormattedNumbersOnly
horizontalAlignment: Text.AlignRight
Layout.preferredWidth: 36 * 3
Layout.preferredHeight: 36
onEditingFinished: () =>
{
let inputValue = parseFloat(text);
if (isNaN(inputValue) || inputValue < speedSlider.from)
inputValue = speedSlider.from;
else if (inputValue > speedSlider.to)
inputValue = speedSlider.to;
text = inputValue.toFixed(2);
speedSlider.value = inputValue;
}
Keys.onPressed: (event) =>
{
if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter)
{
shaderSpeedField.focus = false; // Unfocus the TextField
event.accepted = true; // Prevent further propagation of the key event
}
}
background: Rectangle
{
color: shaderSpeedField.activeFocus ? palette.base : "transparent"
border.color: shaderSpeedField.activeFocus ? palette.highlight : "transparent"
border.width: 1
radius: 4
anchors.fill: shaderSpeedField
anchors.margins: -2
}
}
}
Item { Layout.preferredHeight: Constants.largeMargin }
Text {
text: qsTr("Run Options")
font: Constants.h2Font
color: palette.text
}
Item { Layout.preferredHeight: Constants.smallMargin }
RowLayout {
Layout.fillWidth: true
Text {
text: qsTr("Pause Mode")
font: Constants.h3Font
color: palette.text
verticalAlignment: Text.AlignVCenter
}
ComboBox
{
Layout.fillWidth: true
Layout.preferredHeight: 36
id: pauseModeCombo
model: [
qsTr("Maximized or full-screen windows"),
qsTr("Active window is present"),
qsTr("At least one window is shown"),
qsTr("Never")
]
textRole: modelData
//onCurrentIndexChanged: root.cfg_pauseMode = currentIndex
currentIndex: manager.pauseMode
}
}
Item { Layout.preferredHeight: Constants.smallMargin }
CheckBox
{
id: activeScreenOnlyCheckbox
checked: manager.onlyCheckActiveScreen
text: qsTr("Only check for windows in active screen")
}
Item { Layout.preferredHeight: Constants.smallMargin }
RowLayout
{
Layout.fillWidth: true
Text {
text: qsTr("Excluded Windows")
font: Constants.h3Font
color: palette.text
}
TextField
{
id: excludeWindows
property var windows: manager.excludedWindows
Layout.fillWidth: true
Layout.preferredHeight: 36
text: windows.join(",")
onEditingFinished: () =>
{
windows = excludeWindows.text.trim().replace(/\s+/g, "").split(",");
}
ToolTip.visible: hovered
ToolTip.text: qsTr("A comma-separated list of fully-qualified App-IDs to exclude their windows from triggering pause mode.")
}
}
Item { Layout.preferredHeight: Constants.smallMargin }
CheckBox
{
//Kirigami.FormData.label: i18nd("com.github.digitalartifex.komplex", cfg_isPaused ? "Playing" : "Paused")
id: runningCombo
checked: manager.running
text: qsTr("Shader Is Running")
}
Item { Layout.preferredHeight: Constants.largeMargin }
Text {
text: qsTr("Mouse Tracking")
font: Constants.h2Font
color: palette.text
}
Item { Layout.preferredHeight: Constants.smallMargin }
RowLayout
{
Layout.fillWidth: true
Text {
text: qsTr("Mouse Tracking Bias")
font: Constants.h3Font
color: palette.text
verticalAlignment: Text.AlignVCenter
Layout.preferredHeight: 36
}
//Kirigami.FormData.label: i18nd("com.github.digitalartifex.komplex", "Mouse bias:")
Slider
{
id: mouseBiasSlider
Layout.preferredHeight: 36
Layout.fillWidth: true
from: 0.0
to: 4.0
stepSize: 0.01
value: manager.mouseTrackingBias
onValueChanged: () =>
{
mouseBiasField.text = String(value.toFixed(2));
}
}
TextField
{
id: mouseBiasField
text: manager.mouseTrackingBias
inputMethodHints: Qt.ImhFormattedNumbersOnly
horizontalAlignment: Text.AlignRight
Layout.preferredWidth: 36 * 3
Layout.preferredHeight: 36
onEditingFinished: () =>
{
let inputValue = parseFloat(text);
if (isNaN(inputValue) || inputValue < mouseBiasSlider.from)
inputValue = mouseBiasSlider.from;
else if (inputValue > mouseBiasSlider.to)
inputValue = mouseBiasSlider.to;
text = inputValue.toFixed(2);
mouseBiasSlider.value = inputValue;
}
Keys.onPressed: (event) =>
{
if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter)
{
mouseBiasField.focus = false; // Unfocus the TextField
event.accepted = true; // Prevent further propagation of the key event
}
}
background: Rectangle
{
color: mouseBiasField.activeFocus ? palette.base : "transparent"
border.color: mouseBiasField.activeFocus ? palette.highlight : "transparent"
border.width: 1
radius: 4
anchors.fill: mouseBiasField
anchors.margins: -2
}
}
}
Item { Layout.preferredHeight: Constants.smallMargin }
CheckBox
{
//Kirigami.FormData.label: i18nd("com.github.digitalartifex.komplex", cfg_isPaused ? "Playing" : "Paused")
id: mouseTrackingCheckbox
checked: manager.mouseTrackingEnabled
text: qsTr("Mouse Tracking Enabled")
}
// Button
// {
// visible: navBar.currentIndex === 2
// id: kofiButton
// Layout.preferredWidth: Kirigami.Units.gridUnit * 5
// Layout.preferredHeight: Kirigami.Units.gridUnit * 3
// contentItem: RowLayout
// {
// AnimatedImage
// {
// source: "icons/kofi.gif"
// sourceSize.width: 36
// sourceSize.height: 36
// fillMode: Image.Pad
// horizontalAlignment: Image.AlignLeft
// transform: Translate
// {
// x: 8
// }
// }
// Text
// {
// text: i18nd("@button:kofi", "Kofi")
// horizontalAlignment: Text.AlignHCenter
// color: palette.text
// transform: Translate
// {
// x: -8
// }
// }
// }
// onClicked: () =>
// {
// Qt.openUrlExternally("https://ko-fi.com/digitalartifex");
// }
// }
Item { Layout.preferredHeight: Constants.smallMargin }
RowLayout
{
//Kirigami.FormData.label: i18nd("com.github.digitalartifex.komplex", "Author:")
Text
{
Layout.preferredWidth: Kirigami.Units.gridUnit * 11
text: shaderPackModel.metadata.author
horizontalAlignment: Text.AlignLeft
color: palette.text
}
}
RowLayout
{
//Kirigami.FormData.label: i18nd("com.github.digitalartifex.komplex", "Description:")
Text
{
Layout.preferredWidth: Kirigami.Units.gridUnit * 16
text: shaderPackModel.metadata.description
horizontalAlignment: Text.AlignLeft
color: palette.text
wrapMode: Text.WordWrap
maximumLineCount: 2
elide: Text.ElideRight
}
}
RowLayout
{
//Kirigami.FormData.label: i18nd("com.github.digitalartifex.komplex", "License:")
Text
{
Layout.preferredWidth: Kirigami.Units.gridUnit * 11
text: shaderPackModel.metadata.license
horizontalAlignment: Text.AlignLeft
color: palette.text
}
}
RowLayout
{
//Kirigami.FormData.label: i18nd("com.github.digitalartifex.komplex", "Version:")
Text
{
Layout.preferredWidth: Kirigami.Units.gridUnit * 11
text: shaderPackModel.metadata.version
horizontalAlignment: Text.AlignLeft
color: palette.text
}
}
}
}
}
}