39 Commits

Author SHA1 Message Date
Digital Artifex b4a1e1bbf4 Renamed Controls and Kero modules 2026-08-25 04:45:09 -04:00
Digital Artifex 2fab4f209f Added private libs to get rhi class QShaderBaker 2026-08-25 04:43:35 -04:00
Digital Artifex 6541cedc67 Changed exceptions to std bases 2026-08-25 04:42:43 -04:00
Digital Artifex f3adc14a6e Reworked PackCompiler
PackCompiler now processes everything in memory to reduce file writes. Will also be able to expand error handling later
2026-08-25 04:35:15 -04:00
Digital Artifex 7b25255126 Final alpha fixes. BETA1 release 2026-08-21 07:11:31 -04:00
Digital Artifex 1aaff0cd02 Pack downloader a bit better now 2026-08-20 14:14:22 -04:00
Digital Artifex d60cdef637 Started to add pack download 2026-08-20 05:09:44 -04:00
Digital Artifex 97c9ba30f0 Changed default background color 2026-08-19 16:55:40 -04:00
Digital Artifex 6e94484fac Fixed uuid reference in pack view 2026-08-19 16:54:56 -04:00
Digital Artifex 1d87abd5af Fixed Button Box 2026-08-19 16:53:09 -04:00
Digital Artifex 0402b0902d Updated README 2026-08-18 18:39:00 -04:00
Digital Artifex ac65bbb3ab Moving views to content instad of controls 2026-08-18 18:21:45 -04:00
Digital Artifex 45f293a349 Moving views to content instad of controls 2026-08-18 17:49:46 -04:00
Digital Artifex fa3c6354cb Updated screenshots 2026-08-17 16:50:46 -04:00
Digital Artifex f23aada9a5 Updated screenshots 2026-08-17 16:47:41 -04:00
Digital Artifex 0fe189bfde Updated screenshots 2026-08-17 16:44:19 -04:00
Digital Artifex bb90186932 Updated README 2026-08-17 14:05:41 -04:00
Digital Artifex 61231a890a Updated README 2026-08-17 14:03:49 -04:00
Digital Artifex 8e95f66dc3 Updated README 2026-08-17 13:52:28 -04:00
Digital Artifex b8d5670530 Updated README 2026-08-17 13:44:27 -04:00
Digital Artifex 700de7a757 Updated README 2026-08-17 13:42:59 -04:00
Digital Artifex 5ef7f54cfe Updated README 2026-08-17 13:12:23 -04:00
Digital Artifex 63e45eb4d4 Added modules to reduce redunant code 2026-08-17 13:06:31 -04:00
Digital Artifex 1d5bcb9365 Added Image download functionality 2026-08-17 13:05:17 -04:00
Digital Artifex e6d7d908b1 UI Update 2026-08-17 13:01:51 -04:00
Digital Artifex 471c91e622 UI update 2026-08-17 01:03:00 -04:00
Digital Artifex 9e8b6a70c8 Changed ScrollView to Flickable 2026-08-16 23:50:09 -04:00
Digital Artifex 294a38f26a UI update 2026-08-16 23:10:29 -04:00
Digital Artifex a776997119 General update 2026-08-15 10:01:22 -04:00
Digital Artifex f69ba41046 Removed unused code 2026-08-15 10:00:44 -04:00
Digital Artifex 6b7812fa50 Fixed Featured views 2026-08-15 09:59:58 -04:00
Digital Artifex bb58c8a9d2 Fixed dangling shared pointer 2026-08-15 09:59:05 -04:00
Digital Artifex 4a7960177d Changed queryable visibility 2026-08-15 09:58:35 -04:00
Digital Artifex 9fbf90b0c9 Updated endpoint references 2026-08-15 09:57:30 -04:00
Digital Artifex bb4e3c7562 Added missing setErrorString 2026-08-15 09:56:08 -04:00
Digital Artifex 7f86e1105d Fixed hex reference 2026-08-15 09:55:46 -04:00
Digital Artifex 0f2e237fe6 Added sessionToken reference 2026-08-15 09:55:17 -04:00
Digital Artifex 5deb869c2c Fixed window size math for non-default sizes 2026-08-15 09:54:51 -04:00
Digital Artifex a1d3f20439 Added missing page functions 2026-08-15 09:54:01 -04:00
75 changed files with 4248 additions and 2418 deletions
+85 -73
View File
@@ -3,77 +3,89 @@
;Kero ;Kero
{ {
images/kero/kero_build_1.png, {
placeholders, images/kero/kero_build_1.png,
chatgpt5 placeholders,
} chatgpt5
{ },
images/kero/kero_build_2.png, {
placeholders, images/kero/kero_build_2.png,
chatgpt5 placeholders,
} chatgpt5
{ },
images/kero/kero_build_3.png, {
placeholders, images/kero/kero_build_3.png,
chatgpt5 placeholders,
} chatgpt5
{ },
images/kero/kero_build_4.png, {
placeholders, images/kero/kero_build_4.png,
chatgpt5 placeholders,
} chatgpt5
{ },
images/kero/kero_build_error.png, {
placeholders, images/kero/kero_build_error.png,
chatgpt5 placeholders,
} chatgpt5
{ },
images/kero/kero_choice.png, {
placeholders, images/kero/kero_choice.png,
chatgpt5 placeholders,
} chatgpt5
{ },
images/kero/kero_hello.png, {
placeholders, images/kero/kero_hello.png,
chatgpt5 placeholders,
} chatgpt5
{ },
images/kero/kero_login.png, {
placeholders, images/kero/kero_login.png,
chatgpt5 placeholders,
} chatgpt5
{ },
images/kero/kero_no_results.png, {
placeholders, images/kero/kero_no_results.png,
chatgpt5 placeholders,
} chatgpt5
{ },
images/kero/kero_run_1.png, {
placeholders, images/kero/kero_run_1.png,
chatgpt5 placeholders,
} chatgpt5
{ },
images/kero/kero_run_2.png, {
placeholders, images/kero/kero_run_2.png,
chatgpt5 placeholders,
} chatgpt5
{ },
images/kero/kero_run_3.png, {
placeholders, images/kero/kero_run_3.png,
chatgpt5 placeholders,
} chatgpt5
{ },
images/kero/kero_run_4.png, {
placeholders, images/kero/kero_run_4.png,
chatgpt5 placeholders,
} chatgpt5
{ },
images/kero/kero_warning.png, {
placeholders, images/kero/kero_warning.png,
chatgpt5 placeholders,
} chatgpt5
{ },
images/kero/kero_success.png, {
placeholders, images/kero/kero_success.png,
chatgpt5 placeholders,
chatgpt5
},
{
images/kero/kero_spotlight.png,
placeholders,
chatgpt5
},
{
images/kero/kero_star.png,
placeholders,
chatgpt5
}
} }
+5 -2
View File
@@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.21.1)
option(LINK_INSIGHT "Link Qt Insight Tracker library" ON) option(LINK_INSIGHT "Link Qt Insight Tracker library" ON)
option(BUILD_QDS_COMPONENTS "Build design studio components" ON) option(BUILD_QDS_COMPONENTS "Build design studio components" ON)
project(KomplexHub LANGUAGES CXX) project(KomplexHub VERSION 1.0 LANGUAGES CXX)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/cmake") list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
@@ -21,7 +21,7 @@ set(QML_IMPORT_PATH ${QT_QML_OUTPUT_DIRECTORY}
) )
find_package( find_package(
Qt6 6.8 Qt6
REQUIRED COMPONENTS REQUIRED COMPONENTS
Core Core
Gui Gui
@@ -38,6 +38,7 @@ qt_standard_project_setup()
qt_add_executable(${CMAKE_PROJECT_NAME} qt_add_executable(${CMAKE_PROJECT_NAME}
) )
set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES VERSION "1.0")
qt_add_resources(${CMAKE_PROJECT_NAME} "configuration" qt_add_resources(${CMAKE_PROJECT_NAME} "configuration"
PREFIX "/" PREFIX "/"
@@ -97,6 +98,8 @@ qt_add_resources(${CMAKE_PROJECT_NAME} "app_images"
"images/kero/kero_run_3.png" "images/kero/kero_run_3.png"
"images/kero/kero_run_4.png" "images/kero/kero_run_4.png"
"images/kero/kero_success.png" "images/kero/kero_success.png"
"images/kero/kero_spotlight.png"
"images/kero/kero_star.png"
"images/kero/kero_warning.png" "images/kero/kero_warning.png"
) )
+14 -3
View File
@@ -18,9 +18,20 @@ qt6_add_qml_module(KomplexHubContent
"pages/UserProfilePage.qml" "pages/UserProfilePage.qml"
"pages/WallpaperSettingsPage.qml" "pages/WallpaperSettingsPage.qml"
"pages/VideoSearchPage.qml" "pages/VideoSearchPage.qml"
QML_FILES pages/FeaturedVideosPage.qml "pages/FeaturedVideosPage.qml"
QML_FILES pages/FeaturedPacksPage.qml "pages/FeaturedPacksPage.qml"
QML_FILES pages/FeaturedImagesPage.qml "pages/FeaturedImagesPage.qml"
"pages/NewestPacksPage.qml"
"views/CompletedView.qml"
"views/DownloadView.qml"
"views/ErrorView.qml"
"views/ImageView.qml"
"views/PackView.qml"
"views/VideoView.qml"
RESOURCES views/CMakeLists.txt
RESOURCES pages/CMakeLists.txt
) )
add_subdirectory(pages)
add_subdirectory(views)
+7 -7
View File
@@ -81,7 +81,7 @@ Rectangle {
height: 64 height: 64
width: 100 width: 100
text: "Home" text: qsTr("Home")
icon.height: 32 icon.height: 32
icon.width: 32 icon.width: 32
@@ -109,7 +109,7 @@ Rectangle {
height: 64 height: 64
width: 100 width: 100
text: "Images" text: qsTr("Images")
icon.height: 32 icon.height: 32
icon.width: 32 icon.width: 32
@@ -132,7 +132,7 @@ Rectangle {
height: 64 height: 64
width: 100 width: 100
text: "Videos" text: qsTr("Videos")
icon.height: 32 icon.height: 32
icon.width: 32 icon.width: 32
@@ -155,7 +155,7 @@ Rectangle {
height: 64 height: 64
width: 100 width: 100
text: "Live" text: qsTr("Komplex")
icon.height: 32 icon.height: 32
icon.width: 32 icon.width: 32
@@ -178,7 +178,7 @@ Rectangle {
height: 64 height: 64
width: 100 width: 100
text: "Installed" text: qsTr("Installed")
icon.height: 32 icon.height: 32
icon.width: 32 icon.width: 32
@@ -207,7 +207,7 @@ Rectangle {
height: 64 height: 64
width: 100 width: 100
text: "Settings" text: qsTr("Settings")
icon.height: 32 icon.height: 32
icon.width: 32 icon.width: 32
@@ -369,7 +369,7 @@ Rectangle {
function isSearchPage() function isSearchPage()
{ {
return ( return(
pageLoader.item instanceof ImageSearchPage || pageLoader.item instanceof ImageSearchPage ||
pageLoader.item instanceof LiveSearchPage || pageLoader.item instanceof LiveSearchPage ||
pageLoader.item instanceof VideoSearchPage pageLoader.item instanceof VideoSearchPage
+20
View File
@@ -0,0 +1,20 @@
qt_add_library(KomplexHubPages STATIC)
qt6_add_qml_module(KomplexHubPages
URI "KomplexHub.Pages"
VERSION 1.0
RESOURCE_PREFIX "/qt/qml"
QML_FILES
"HomePage.qml"
"ImageSearchPage.qml"
"InstalledWallpaperPage.qml"
"LiveSearchPage.qml"
"LoginPage.qml"
"SettingsPage.qml"
"UserProfilePage.qml"
"WallpaperSettingsPage.qml"
"VideoSearchPage.qml"
"FeaturedVideosPage.qml"
"FeaturedPacksPage.qml"
"FeaturedImagesPage.qml"
"NewestPacksPage.qml"
)
+77 -52
View File
@@ -5,13 +5,16 @@ import QtQuick.Layouts
import KomplexHub import KomplexHub
import KomplexHub.Controls import KomplexHub.Controls
import KomplexHub.Kero import KomplexHub.Kero
import KomplexHubPlugin import KomplexHub.Plugin
import KomplexHub.Views
import KomplexHub.Pages
Rectangle Rectangle
{ {
id: rootItem id: rootItem
readonly property bool searchable: false property string query
readonly property bool searchable: paginator.searchable
property bool popup: false property bool popup: false
property int resultWidth: 256 property int resultWidth: 256
property int resultHeight: 245 property int resultHeight: 245
@@ -20,48 +23,69 @@ Rectangle
FeaturedImagesModel FeaturedImagesModel
{ {
id: imagesModel id: searchModel
//query: rootItem.query
resultsPerPage: paginator.resultsPerPage resultsPerPage: paginator.resultsPerPage
// windowSize: 80
Component.onCompleted: () => nextPage()
} }
PaginatorGrid ColumnLayout
{ {
id: paginator id: resultsLayout
anchors.fill: parent
model: imagesModel
loading: imagesModel.state === FeaturedImagesModel.Loading
visible: opacity > 0.01 visible: opacity > 0.01
anchors.fill: parent
anchors.margins: Constants.mediumMargin
delegate: ItemDelegate KeroHeader
{ {
id: resultDelegate Layout.alignment: Qt.AlignTop
Layout.fillWidth: true
Layout.preferredHeight: 180
title: qsTr("Featured Images")
description: qsTr("A specially curated collection of images, courtesy of Pexels")
}
width: resultWidth PaginatorGrid
height: resultHeight {
Layout.alignment: Qt.AlignTop
Layout.fillHeight: true
Layout.fillWidth: true
required property string uuid id: paginator
required property string author model: searchModel
required property string authorId loading: model.state === FeaturedImagesModel.Loading
required property string authorUrl
required property string thumbnail
required property int index
SearchResultItem delegate: ItemDelegate
{ {
anchors.fill: parent id: resultDelegate
author: parent.author
description: qsTr("No description available")
thumbnail: parent.thumbnail
uuid: parent.uuid
pexels: true
selected: paginator.currentIndex === parent.index
onTriggered: () => paginator.currentIndex = parent.index width: resultWidth
height: resultHeight
onViewMoreTriggered: () => required property string author
required property string description
required property string uuid
required property string thumbnail
required property string authorId
required property int index
SearchResultItem
{ {
showVideoPopup(parent.index) anchors.fill: parent
title: parent.author
description: parent.description
thumbnail: parent.thumbnail
uuid: parent.uuid
pexels: true
selected: paginator.currentIndex === parent.index
onTriggered: () => paginator.currentIndex = parent.index
onViewMoreTriggered: () =>
{
showImagePopup(parent.index)
}
} }
} }
} }
@@ -77,12 +101,12 @@ Rectangle
ImageView ImageView
{ {
id: imageDetailsPopup id: viewMoreImagePopup
anchors.fill: parent anchors.fill: parent
opacity: 0 opacity: 0
visible: opacity > 0.01
Behavior on opacity Behavior on opacity {
{
NumberAnimation NumberAnimation
{ {
duration: 250 duration: 250
@@ -90,8 +114,7 @@ Rectangle
} }
} }
Behavior on opacity Behavior on opacity {
{
NumberAnimation NumberAnimation
{ {
duration: 250 duration: 250
@@ -99,31 +122,33 @@ Rectangle
} }
} }
Component.onCompleted: () => function showImagePopup(index)
{ {
imagesModel.nextPage() viewMoreImagePopup.author = searchModel.data(searchModel.index(index,0), FeaturedImagesModel.AuthorRole)
} viewMoreImagePopup.authorUrl = searchModel.data(searchModel.index(index,0), FeaturedImagesModel.AuthorUrlRole)
viewMoreImagePopup.description = searchModel.data(searchModel.index(index,0), FeaturedImagesModel.DescriptionRole)
function showVideoPopup(index) viewMoreImagePopup.uuid = searchModel.data(searchModel.index(index,0), FeaturedImagesModel.UuidRole)
{ viewMoreImagePopup.thumbnail = searchModel.data(searchModel.index(index,0), FeaturedImagesModel.LargeThumbnailRole)
imagesModel.setItem(index) viewMoreImagePopup.original = searchModel.data(searchModel.index(index,0), FeaturedImagesModel.OriginalUrlRole)
imageDetailsPopup.author = searchModel.data(searchModel.index(index,0), ImageSearchModel.AuthorRole) viewMoreImagePopup.portrait = searchModel.data(searchModel.index(index,0), FeaturedImagesModel.PortraitUrlRole)
imageDetailsPopup.authorUrl = searchModel.data(searchModel.index(index,0), ImageSearchModel.AuthorUrlRole) viewMoreImagePopup.landscape = searchModel.data(searchModel.index(index,0), FeaturedImagesModel.LandscapeUrlRole)
imageDetailsPopup.uuid = searchModel.data(searchModel.index(index,0), ImageSearchModel.UuidRole) viewMoreImagePopup.backgroundPortrait = searchModel.data(searchModel.index(index,0), FeaturedImagesModel.BackgroundPortraitRole)
imageDetailsPopup.thumbnail = searchModel.data(searchModel.index(index,0), ImageSearchModel.ThumbnailRole) viewMoreImagePopup.backgroundLandscape = searchModel.data(searchModel.index(index,0), FeaturedImagesModel.BackgroundLandscapeRole)
imageDetailsPopup.modelIndex = index viewMoreImagePopup.fullScreen = searchModel.data(searchModel.index(index,0), FeaturedImagesModel.ScreenUrlRole)
imageDetailsPopup.model = searchModel.itemModel viewMoreImagePopup.portraitSize = searchModel.data(searchModel.index(index,0), FeaturedImagesModel.PortraitSizeRole)
imageDetailsPopup.opacity = 1 viewMoreImagePopup.landscapeSize = searchModel.data(searchModel.index(index,0), FeaturedImagesModel.LandscapeSizeRole)
paginator.opacity = 0 viewMoreImagePopup.fullScreenSize = searchModel.data(searchModel.index(index,0), FeaturedImagesModel.ScreenSizeRole)
viewMoreImagePopup.opacity = 1
popupContainer.opacity = 1 popupContainer.opacity = 1
resultsLayout.opacity = 0
rootItem.popup = true rootItem.popup = true
} }
function closePopup() function closePopup()
{ {
imageDetailsPopup.opacity = 0 viewMoreImagePopup.opacity = 0
popupContainer.opacity = 0 popupContainer.opacity = 0
paginator.opacity = 1 resultsLayout.opacity = 1
rootItem.popup = false rootItem.popup = false
} }
} }
+72 -56
View File
@@ -5,12 +5,15 @@ import QtQuick.Layouts
import KomplexHub import KomplexHub
import KomplexHub.Controls import KomplexHub.Controls
import KomplexHub.Kero import KomplexHub.Kero
import KomplexHubPlugin import KomplexHub.Plugin
import KomplexHub.Views
import KomplexHub.Pages
Rectangle Rectangle
{ {
id: rootItem id: rootItem
property string query
readonly property bool searchable: false readonly property bool searchable: false
property bool popup: false property bool popup: false
property int resultWidth: 256 property int resultWidth: 256
@@ -18,50 +21,71 @@ Rectangle
color: palette.base color: palette.base
FeaturedPacksModel NewestPacksModel
{ {
id: packsModel id: packsModel
resultsPerPage: paginator.resultsPerPage resultsPerPage: paginator.resultsPerPage
// windowSize: 80
Component.onCompleted: () => nextPage()
} }
PaginatorGrid ColumnLayout
{ {
id: paginator id: resultsLayout
anchors.fill: parent
model: packsModel
loading: packsModel.state === FeaturedPacksModel.Loading
visible: opacity > 0.01 visible: opacity > 0.01
anchors.fill: parent
anchors.margins: Constants.mediumMargin
delegate: ItemDelegate KeroHeader
{ {
id: resultDelegate Layout.alignment: Qt.AlignTop
Layout.fillWidth: true
Layout.preferredHeight: 180
title: qsTr("Featured Live Wallpapers")
description: qsTr("Live Wallpaper Packs from Komplex or ShaderToy")
}
width: resultWidth PaginatorGrid
height: resultHeight {
Layout.alignment: Qt.AlignTop
Layout.fillHeight: true
Layout.fillWidth: true
required property string uuid id: paginator
required property string author model: packsModel
required property string authorId loading: model.state === NewestPacksModel.Loading
required property string authorUrl
required property string thumbnail
required property int index
SearchResultItem delegate: ItemDelegate
{ {
anchors.fill: parent id: resultDelegate
author: parent.author
description: qsTr("No description available")
thumbnail: parent.thumbnail
uuid: parent.uuid
pexels: true
selected: paginator.currentIndex === parent.index
onTriggered: () => paginator.currentIndex = parent.index width: resultWidth
height: resultHeight
onViewMoreTriggered: () => required property string name
required property string author
required property string description
required property string uuid
required property string thumbnail
required property string authorId
required property int index
SearchResultItem
{ {
showVideoPopup(parent.index) anchors.fill: parent
title: parent.name
author: parent.author
description: parent.description
thumbnail: parent.thumbnail
uuid: parent.uuid
selected: paginator.currentIndex === parent.index
onTriggered: () => paginator.currentIndex = parent.index
onViewMoreTriggered: () =>
{
showWallpaperPopup(parent.index)
}
} }
} }
} }
@@ -77,12 +101,12 @@ Rectangle
PackView PackView
{ {
id: packDetailsPopup id: viewMoreWallpaperPopup
anchors.fill: parent anchors.fill: parent
opacity: 0 opacity: 0
visible: opacity > 0.01
Behavior on opacity Behavior on opacity {
{
NumberAnimation NumberAnimation
{ {
duration: 250 duration: 250
@@ -90,8 +114,7 @@ Rectangle
} }
} }
Behavior on opacity Behavior on opacity {
{
NumberAnimation NumberAnimation
{ {
duration: 250 duration: 250
@@ -99,31 +122,24 @@ Rectangle
} }
} }
Component.onCompleted: () =>
{
packsModel.nextPage()
}
function showVideoPopup(index)
{
packsModel.setItem(index)
packDetailsPopup.author = searchModel.data(searchModel.index(index,0), VideoSearchModel.AuthorRole)
packDetailsPopup.authorUrl = searchModel.data(searchModel.index(index,0), VideoSearchModel.AuthorUrlRole)
packDetailsPopup.uuid = searchModel.data(searchModel.index(index,0), VideoSearchModel.UuidRole)
packDetailsPopup.thumbnail = searchModel.data(searchModel.index(index,0), VideoSearchModel.ThumbnailRole)
packDetailsPopup.modelIndex = index
packDetailsPopup.model = searchModel.itemModel
packDetailsPopup.opacity = 1
paginator.opacity = 0
popupContainer.opacity = 1
rootItem.popup = true
}
function closePopup() function closePopup()
{ {
packDetailsPopup.opacity = 0 viewMoreWallpaperPopup.opacity = 0
popupContainer.opacity = 0 popupContainer.opacity = 0
paginator.opacity = 1 resultsLayout.opacity = 1
rootItem.popup = false rootItem.popup = false
} }
function showWallpaperPopup(index)
{
viewMoreWallpaperPopup.author = packsModel.data(packsModel.index(index,0), NewestPacksModel.AuthorRole)
viewMoreWallpaperPopup.authorId = packsModel.data(packsModel.index(index,0), NewestPacksModel.AuthorIdRole)
viewMoreWallpaperPopup.description = packsModel.data(packsModel.index(index,0), NewestPacksModel.DescriptionRole)
viewMoreWallpaperPopup.thumbnail = packsModel.data(packsModel.index(index,0), NewestPacksModel.ThumbnailRole)
viewMoreWallpaperPopup.uuid = packsModel.data(packsModel.index(index,0), NewestPacksModel.UuidRole)
viewMoreWallpaperPopup.opacity = 1
popupContainer.opacity = 1
resultsLayout.opacity = 0
rootItem.popup = true
}
} }
+53 -29
View File
@@ -5,7 +5,9 @@ import QtQuick.Layouts
import KomplexHub import KomplexHub
import KomplexHub.Controls import KomplexHub.Controls
import KomplexHub.Kero import KomplexHub.Kero
import KomplexHubPlugin import KomplexHub.Plugin
import KomplexHub.Views
import KomplexHub.Pages
Rectangle Rectangle
{ {
@@ -25,43 +27,64 @@ Rectangle
windowSize: 80 windowSize: 80
} }
PaginatorGrid ColumnLayout
{ {
id: paginator id: resultsLayout
anchors.fill: parent
model: videosModel
loading: videosModel.state === FeaturedVideosModel.Loading
visible: opacity > 0.01 visible: opacity > 0.01
anchors.fill: parent
anchors.margins: Constants.mediumMargin
delegate: ItemDelegate KeroHeader
{ {
id: resultDelegate Layout.alignment: Qt.AlignTop
Layout.fillWidth: true
Layout.preferredHeight: 180
title: qsTr("Most Popular Videos")
description: qsTr("Most popular videos, provided courtesy of Pexels")
image: "qrc:/images/kero/kero_star.png"
}
width: resultWidth PaginatorGrid
height: resultHeight {
Layout.alignment: Qt.AlignTop
Layout.fillHeight: true
Layout.fillWidth: true
required property string uuid id: paginator
required property string author model: videosModel
required property string authorId loading: videosModel.state === FeaturedVideosModel.Loading
required property string authorUrl visible: opacity > 0.01
required property string thumbnail
required property int index
SearchResultItem delegate: ItemDelegate
{ {
anchors.fill: parent id: resultDelegate
author: parent.author
description: qsTr("No description available")
thumbnail: parent.thumbnail
uuid: parent.uuid
pexels: true
selected: paginator.currentIndex === parent.index
onTriggered: () => paginator.currentIndex = parent.index width: resultWidth
height: resultHeight
onViewMoreTriggered: () => required property string uuid
required property string author
required property string authorId
required property string authorUrl
required property string thumbnail
required property int index
SearchResultItem
{ {
showVideoPopup(parent.index) anchors.fill: parent
author: parent.author
description: qsTr("")
thumbnail: parent.thumbnail
uuid: parent.uuid
pexels: true
selected: paginator.currentIndex === parent.index
onTriggered: () => paginator.currentIndex = parent.index
onViewMoreTriggered: () =>
{
showVideoPopup(parent.index)
}
} }
} }
} }
@@ -80,6 +103,7 @@ Rectangle
id: videoDetailsPopup id: videoDetailsPopup
anchors.fill: parent anchors.fill: parent
opacity: 0 opacity: 0
visible: opacity > 0.01
Behavior on opacity Behavior on opacity
{ {
@@ -114,7 +138,7 @@ Rectangle
videoDetailsPopup.modelIndex = index videoDetailsPopup.modelIndex = index
videoDetailsPopup.model = searchModel.itemModel videoDetailsPopup.model = searchModel.itemModel
videoDetailsPopup.opacity = 1 videoDetailsPopup.opacity = 1
paginator.opacity = 0 resultsLayout.opacity = 0
popupContainer.opacity = 1 popupContainer.opacity = 1
rootItem.popup = true rootItem.popup = true
} }
@@ -123,7 +147,7 @@ Rectangle
{ {
videoDetailsPopup.opacity = 0 videoDetailsPopup.opacity = 0
popupContainer.opacity = 0 popupContainer.opacity = 0
paginator.opacity = 1 resultsLayout.opacity = 1
rootItem.popup = false rootItem.popup = false
} }
} }
+440 -237
View File
@@ -1,12 +1,13 @@
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls 2.0
import QtQuick.Layouts import QtQuick.Layouts
import QtQuick.Effects import QtQuick.Effects
import KomplexHub import KomplexHub
import KomplexHub.Controls import KomplexHub.Controls
import KomplexHub.Kero import KomplexHub.Kero
import KomplexHubPlugin import KomplexHub.Plugin
import KomplexHubContent
Item Item
{ {
@@ -19,15 +20,15 @@ Item
imagesModel.state === FeaturedImagesModel.Loading || imagesModel.state === FeaturedImagesModel.Loading ||
videosModel.state === FeaturedVideosModel.Loading; videosModel.state === FeaturedVideosModel.Loading;
onWidthChanged:() => { onWidthChanged: () =>
{
packsModel.resultsPerPage = resultsPerRow packsModel.resultsPerPage = resultsPerRow
imagesModel.resultsPerPage = resultsPerRow imagesModel.resultsPerPage = resultsPerRow
videosModel.resultsPerPage = resultsPerRow videosModel.resultsPerPage = resultsPerRow
} }
clip: true
id: homePageRoot id: homePageRoot
clip: true
NewestPacksModel NewestPacksModel
{ {
@@ -47,193 +48,346 @@ Item
resultsPerPage: 0 resultsPerPage: 0
} }
Rectangle Flickable
{ {
anchors.fill: parent id: pageArea
color: palette.base visible: opacity > 0.01
anchors.right: parent.right
anchors.left: parent.left
anchors.top: parent.top
anchors.bottom: parent.bottom
ColumnLayout contentHeight: content.height
contentWidth: content.width
Column
{ {
id: resultsLayout id: content
visible: opacity > 0.01 width: pageArea.width
anchors.fill: parent
anchors.margins: Constants.mediumMargin
Text VerticalSpacer{ height: Constants.largeMargin; width: Constants.largeMargin }
Rectangle
{ {
Layout.alignment: Qt.AlignTop anchors.left: parent.left
Layout.preferredHeight: 50 anchors.right: parent.right
height: childrenRect.height
anchors.margins: Constants.largeMargin
color: palette.text color: palette.base
font.pixelSize: Constants.h2Font.pixelSize border.color: palette.midlight
font.bold: true
text: qsTr("Newest Wallpaper Packs")
verticalAlignment: Qt.AlignVCenter
}
HorizontalPaginator Column
{
id: packsPaginator
Layout.fillWidth: true
Layout.preferredHeight: 245
Layout.alignment: Qt.AlignTop
model: packsModel
delegate: ItemDelegate
{ {
width: resultWidth anchors.left: parent.left
height: resultHeight anchors.right: parent.right
required property string name KeroHeader
required property string author
required property string description
required property string uuid
required property string thumbnail
required property string authorId
required property int index
SearchResultItem
{ {
anchors.fill: parent height: 180
title: parent.name anchors.left: parent.left
author: parent.author anchors.right: parent.right
description: parent.description }
thumbnail: parent.thumbnail
uuid: parent.uuid
selected: packsPaginator.currentIndex === parent.index Rectangle
{
anchors.left: parent.left
anchors.right: parent.right
height: childrenRect.height
onTriggered: () => packsPaginator.currentIndex = parent.index color: palette.window
onViewMoreTriggered: () => Column
{ {
showWallpaperPopup(parent.index) anchors.left: parent.left
} anchors.right: parent.right
anchors.margins: Constants.largeMargin
onThumbnailChanged: () => Text
{ {
console.log(index + " " + thumbnail + " " + parent.thumbnail) anchors.left: parent.left
anchors.right: parent.right
height: 36
color: palette.text
font.pixelSize: Constants.h2Font.pixelSize
font.bold: true
text: qsTr("Featured Komplex Wallpapers")
verticalAlignment: Qt.AlignVCenter
}
HorizontalPaginator
{
anchors.left: parent.left
anchors.right: parent.right
height: 245
id: packsPaginator
model: packsModel
delegate: ItemDelegate
{
width: resultWidth
height: resultHeight
required property string name
required property string author
required property string description
required property string uuid
required property string thumbnail
required property string authorId
required property int index
SearchResultItem
{
anchors.fill: parent
title: parent.name
author: parent.author
description: parent.description
thumbnail: parent.thumbnail
uuid: parent.uuid
selected: packsPaginator.currentIndex === parent.index
onTriggered: () => packsPaginator.currentIndex = parent.index
onViewMoreTriggered: () =>
{
showWallpaperPopup(parent.index)
}
}
}
onViewMoreTriggered: () =>
{
showFeaturedPacksPage()
}
}
Text
{
anchors.left: parent.left
anchors.right: parent.right
height: 36
color: palette.text
font.pixelSize: Constants.h2Font.pixelSize
font.bold: true
text: qsTr("Featured Images")
verticalAlignment: Qt.AlignVCenter
}
HorizontalPaginator
{
id: imagesPaginator
anchors.left: parent.left
anchors.right: parent.right
height: 245
model: imagesModel
delegate: ItemDelegate
{
width: resultWidth
height: resultHeight
required property string author
required property string description
required property string uuid
required property string thumbnail
required property string authorId
required property int index
SearchResultItem
{
anchors.fill: parent
author: parent.author
description: parent.description
thumbnail: parent.thumbnail
uuid: parent.uuid
pexels: true
selected: imagesPaginator.currentIndex === parent.index
onTriggered: () => imagesPaginator.currentIndex = parent.index
onViewMoreTriggered: () =>
{
showImagePopup(parent.index)
}
}
}
onViewMoreTriggered: () =>
{
showFeaturedImagesPage()
}
}
VerticalSpacer { height: Constants.largeMargin; width: Constants.largeMargin }
} }
} }
} }
onViewMoreTriggered: () =>
{
showFeaturedPacksPage()
}
} }
Text VerticalSpacer { height: Constants.largeMargin; width: Constants.largeMargin }
Rectangle
{ {
Layout.alignment: Qt.AlignTop anchors.left: parent.left
Layout.preferredHeight: 50 anchors.right: parent.right
height: childrenRect.height
anchors.margins: Constants.largeMargin
color: palette.text color: palette.base
font.pixelSize: Constants.h2Font.pixelSize border.color: palette.midlight
font.bold: true
text: qsTr("Featured Images")
verticalAlignment: Qt.AlignVCenter
}
HorizontalPaginator Column
{
id: imagesPaginator
Layout.fillWidth: true
Layout.preferredHeight: 245
Layout.alignment: Qt.AlignTop
model: imagesModel
delegate: ItemDelegate
{ {
width: resultWidth anchors.left: parent.left
height: resultHeight anchors.right: parent.right
required property string author KeroHeader
required property string description
required property string uuid
required property string thumbnail
required property string authorId
required property int index
SearchResultItem
{ {
anchors.fill: parent height: 180
title: parent.author anchors.left: parent.left
description: parent.description anchors.right: parent.right
thumbnail: parent.thumbnail title: qsTr("New & Popular Wallpapers")
uuid: parent.uuid image: "qrc:/images/kero/kero_star.png"
pexels: true }
selected: imagesPaginator.currentIndex === parent.index
onTriggered: () => imagesPaginator.currentIndex = parent.index Rectangle
{
anchors.left: parent.left
anchors.right: parent.right
anchors.margins: Constants.largeMargin
onViewMoreTriggered: () => height: childrenRect.height
color: palette.window
Column
{ {
showImagePopup(parent.index) anchors.left: parent.left
anchors.right: parent.right
Text
{
anchors.left: parent.left
anchors.right: parent.right
height: 36
color: palette.text
font.pixelSize: Constants.h2Font.pixelSize
font.bold: true
text: qsTr("Newest Wallpaper Packs")
verticalAlignment: Qt.AlignVCenter
}
HorizontalPaginator
{
anchors.left: parent.left
anchors.right: parent.right
height: 245
id: packsPaginator2
model: packsModel
delegate: ItemDelegate
{
width: resultWidth
height: resultHeight
required property string name
required property string author
required property string description
required property string uuid
required property string thumbnail
required property string authorId
required property int index
SearchResultItem
{
anchors.fill: parent
title: parent.name
author: parent.author
description: parent.description
thumbnail: parent.thumbnail
uuid: parent.uuid
selected: packsPaginator2.currentIndex === parent.index
onTriggered: () => packsPaginator2.currentIndex = parent.index
onViewMoreTriggered: () =>
{
showWallpaperPopup(parent.index)
}
}
}
onViewMoreTriggered: () =>
{
showFeaturedPacksPage()
}
}
Text
{
anchors.left: parent.left
anchors.right: parent.right
height: 36
color: palette.text
font.pixelSize: Constants.h2Font.pixelSize
font.bold: true
text: qsTr("Popular Videos")
verticalAlignment: Qt.AlignVCenter
}
HorizontalPaginator
{
id: videosPaginator
anchors.left: parent.left
anchors.right: parent.right
height: 245
model: videosModel
delegate: ItemDelegate
{
width: resultWidth
height: resultHeight
required property string uuid
required property string author
required property string authorId
required property string authorUrl
required property string thumbnail
required property int index
SearchResultItem
{
anchors.fill: parent
author: parent.author
thumbnail: parent.thumbnail
uuid: parent.uuid
pexels: true
selected: videosPaginator.currentIndex === parent.index
onTriggered: () => videosPaginator.currentIndex = parent.index
onViewMoreTriggered:() => showVideoPopup(parent.index)
}
}
onViewMoreTriggered: () =>
{
showFeaturedVideosPage()
}
}
VerticalSpacer{ height: Constants.largeMargin; width: Constants.largeMargin }
} }
} }
} }
onViewMoreTriggered: () =>
{
showFeaturedImagesPage()
}
} }
Text VerticalSpacer{ height: Constants.largeMargin; width: Constants.largeMargin }
{
Layout.alignment: Qt.AlignTop
Layout.preferredHeight: 50
color: palette.text
font.pixelSize: Constants.h2Font.pixelSize
font.bold: true
text: qsTr("Popular Videos")
verticalAlignment: Qt.AlignVCenter
}
HorizontalPaginator
{
id: videosPaginator
Layout.fillWidth: true
Layout.preferredHeight: 245
Layout.alignment: Qt.AlignTop
model: videosModel
delegate: ItemDelegate
{
width: resultWidth
height: resultHeight
required property string uuid
required property string author
required property string authorId
required property string authorUrl
required property string thumbnail
required property int index
SearchResultItem
{
anchors.fill: parent
title: parent.author
thumbnail: parent.thumbnail
uuid: parent.uuid
pexels: true
selected: videosPaginator.currentIndex === parent.index
onTriggered: () => videosPaginator.currentIndex = parent.index
onViewMoreTriggered:() => showVideoPopup(parent.index)
}
}
onViewMoreTriggered: () =>
{
showFeaturedVideosPage()
}
}
/* spacer */
Item { Layout.fillHeight: true }
} }
} }
@@ -268,7 +422,8 @@ Item
opacity: 0 opacity: 0
visible: opacity > 0.01 visible: opacity > 0.01
Behavior on opacity { Behavior on opacity
{
NumberAnimation NumberAnimation
{ {
duration: 250 duration: 250
@@ -282,9 +437,9 @@ Item
anchors.fill: parent anchors.fill: parent
opacity: 0 opacity: 0
visible: opacity > 0.01 visible: opacity > 0.01
//model: videosModel.itemModel
Behavior on opacity { Behavior on opacity
{
NumberAnimation NumberAnimation
{ {
duration: 250 duration: 250
@@ -298,9 +453,9 @@ Item
anchors.fill: parent anchors.fill: parent
opacity: 0 opacity: 0
visible: opacity > 0.01 visible: opacity > 0.01
//model: videosModel.itemModel
Behavior on opacity { Behavior on opacity
{
NumberAnimation NumberAnimation
{ {
duration: 250 duration: 250
@@ -308,7 +463,8 @@ Item
} }
} }
Behavior on opacity { Behavior on opacity
{
NumberAnimation NumberAnimation
{ {
duration: 250 duration: 250
@@ -316,53 +472,91 @@ Item
} }
} }
FeaturedVideosPage Component
{ {
id: featuredVideosPage id: featuredVideosComponent
FeaturedVideosPage
{
id: featuredVideosPage
anchors.fill: parent
opacity: 0
Behavior on opacity
{
NumberAnimation
{
duration: 250
}
}
Component.onCompleted: () => featuredVideosPage.opacity = 1
}
}
Component
{
id: featuredPacksComponent
FeaturedPacksPage
{
id: featuredPacksPage
anchors.fill: parent
opacity: 0
Behavior on opacity
{
NumberAnimation
{
duration: 250
}
}
Component.onCompleted: () => featuredPacksPage.opacity = 1
}
}
Component
{
id: featuredImagesComponent
FeaturedImagesPage
{
id: featuredImagesPage
anchors.fill: parent
opacity: 0
Behavior on opacity
{
NumberAnimation
{
duration: 250
}
}
Component.onCompleted: () => featuredImagesPage.opacity = 1
}
}
Item
{
id: featuredLoaderItem
anchors.fill: parent anchors.fill: parent
opacity: 0 opacity: 0
visible: opacity > 0.01 visible: opacity > 0.01
enabled: visible
Behavior on opacity { Loader
NumberAnimation {
{ id: featuredLoader
duration: 250 anchors.fill: parent
}
} }
} }
FeaturedPacksPage states:
{ [
id: featuredPacksPage State
anchors.fill: parent {
opacity: 0
visible: opacity > 0.01
Behavior on opacity {
NumberAnimation
{
duration: 250
}
}
}
FeaturedImagesPage
{
id: featuredImagesPage
anchors.fill: parent
opacity: 0
visible: opacity > 0.01
Behavior on opacity {
NumberAnimation
{
duration: 250
}
}
}
states: [
State {
name: "loading" name: "loading"
when: homePageRoot.loading when: homePageRoot.loading
@@ -374,7 +568,7 @@ Item
PropertyChanges PropertyChanges
{ {
target: resultsLayout target: pageArea
opacity: 0 opacity: 0
} }
@@ -384,11 +578,10 @@ Item
opacity: 0 opacity: 0
} }
}, },
State { State
{
name: "idle" name: "idle"
when: packsModel.state !== NewestPacksModel.Loading && when: !popup && !loading
imagesModel.state !== FeaturedImagesModel.Loading &&
videosModel.state !== FeaturedVideosModel.Loading;
PropertyChanges PropertyChanges
{ {
@@ -398,13 +591,31 @@ Item
PropertyChanges PropertyChanges
{ {
target: resultsLayout target: pageArea
opacity: 1 opacity: 1
} }
},
State
{
name: "popup"
when: popup
PropertyChanges
{
target: pageArea
opacity: 0
}
PropertyChanges
{
target: loadingAnimation
opacity: 0
}
} }
] ]
transitions: [ transitions:
[
Transition Transition
{ {
from: "loading" from: "loading"
@@ -417,7 +628,7 @@ Item
} }
NumberAnimation NumberAnimation
{ {
target: resultsLayout target: pageArea
duration: 250 duration: 250
property: "opacity"; property: "opacity";
} }
@@ -426,22 +637,25 @@ Item
function showFeaturedVideosPage() function showFeaturedVideosPage()
{ {
resultsLayout.opacity = 0 pageArea.opacity = 0
featuredVideosPage.opacity = 1 featuredLoaderItem.opacity = 1
featuredLoader.sourceComponent = featuredVideosComponent
popup = true popup = true
} }
function showFeaturedPacksPage() function showFeaturedPacksPage()
{ {
resultsLayout.opacity = 0 pageArea.opacity = 0
featuredPacksPage.opacity = 1 featuredLoaderItem.opacity = 1
featuredLoader.sourceComponent = featuredPacksComponent
popup = true popup = true
} }
function showFeaturedImagesPage() function showFeaturedImagesPage()
{ {
resultsLayout.opacity = 0 pageArea.opacity = 0
featuredImagesPage.opacity = 1 featuredLoaderItem.opacity = 1
featuredLoader.sourceComponent = featuredImagesComponent
popup = true popup = true
} }
@@ -452,7 +666,6 @@ Item
viewMoreImagePopup.description = imagesModel.data(imagesModel.index(index,0), FeaturedImagesModel.DescriptionRole) viewMoreImagePopup.description = imagesModel.data(imagesModel.index(index,0), FeaturedImagesModel.DescriptionRole)
viewMoreImagePopup.uuid = imagesModel.data(imagesModel.index(index,0), FeaturedImagesModel.UuidRole) viewMoreImagePopup.uuid = imagesModel.data(imagesModel.index(index,0), FeaturedImagesModel.UuidRole)
viewMoreImagePopup.thumbnail = imagesModel.data(imagesModel.index(index,0), FeaturedImagesModel.LargeThumbnailRole) viewMoreImagePopup.thumbnail = imagesModel.data(imagesModel.index(index,0), FeaturedImagesModel.LargeThumbnailRole)
viewMoreImagePopup.original = imagesModel.data(imagesModel.index(index,0), FeaturedImagesModel.OriginalUrlRole)
viewMoreImagePopup.portrait = imagesModel.data(imagesModel.index(index,0), FeaturedImagesModel.PortraitUrlRole) viewMoreImagePopup.portrait = imagesModel.data(imagesModel.index(index,0), FeaturedImagesModel.PortraitUrlRole)
viewMoreImagePopup.landscape = imagesModel.data(imagesModel.index(index,0), FeaturedImagesModel.LandscapeUrlRole) viewMoreImagePopup.landscape = imagesModel.data(imagesModel.index(index,0), FeaturedImagesModel.LandscapeUrlRole)
viewMoreImagePopup.backgroundPortrait = imagesModel.data(imagesModel.index(index,0), FeaturedImagesModel.BackgroundPortraitRole) viewMoreImagePopup.backgroundPortrait = imagesModel.data(imagesModel.index(index,0), FeaturedImagesModel.BackgroundPortraitRole)
@@ -463,7 +676,7 @@ Item
viewMoreImagePopup.fullScreenSize = imagesModel.data(imagesModel.index(index,0), FeaturedImagesModel.ScreenSizeRole) viewMoreImagePopup.fullScreenSize = imagesModel.data(imagesModel.index(index,0), FeaturedImagesModel.ScreenSizeRole)
viewMoreImagePopup.opacity = 1 viewMoreImagePopup.opacity = 1
popupContainer.opacity = 1 popupContainer.opacity = 1
resultsLayout.opacity = 0 pageArea.opacity = 0
homePageRoot.popup = true homePageRoot.popup = true
} }
@@ -477,7 +690,7 @@ Item
viewMoreVideoPopup.modelIndex = index viewMoreVideoPopup.modelIndex = index
viewMoreVideoPopup.model = videosModel.itemModel viewMoreVideoPopup.model = videosModel.itemModel
viewMoreVideoPopup.opacity = 1 viewMoreVideoPopup.opacity = 1
resultsLayout.opacity = 0 pageArea.opacity = 0
popupContainer.opacity = 1 popupContainer.opacity = 1
homePageRoot.popup = true homePageRoot.popup = true
} }
@@ -488,38 +701,28 @@ Item
viewMoreWallpaperPopup.authorId = packsModel.data(packsModel.index(index,0), NewestPacksModel.AuthorIdRole) viewMoreWallpaperPopup.authorId = packsModel.data(packsModel.index(index,0), NewestPacksModel.AuthorIdRole)
viewMoreWallpaperPopup.description = packsModel.data(packsModel.index(index,0), NewestPacksModel.DescriptionRole) viewMoreWallpaperPopup.description = packsModel.data(packsModel.index(index,0), NewestPacksModel.DescriptionRole)
viewMoreWallpaperPopup.thumbnail = packsModel.data(packsModel.index(index,0), NewestPacksModel.ThumbnailRole) viewMoreWallpaperPopup.thumbnail = packsModel.data(packsModel.index(index,0), NewestPacksModel.ThumbnailRole)
viewMoreWallpaperPopup.name = packsModel.data(packsModel.index(index,0), NewestPacksModel.NameRole)
viewMoreWallpaperPopup.uuid = packsModel.data(packsModel.index(index,0), NewestPacksModel.UuidRole)
viewMoreWallpaperPopup.opacity = 1 viewMoreWallpaperPopup.opacity = 1
popupContainer.opacity = 1 popupContainer.opacity = 1
resultsLayout.opacity = 0 pageArea.opacity = 0
homePageRoot.popup = true homePageRoot.popup = true
} }
function closePopup() function closePopup()
{ {
if(featuredVideosPage.popup) if(featuredLoader.item && featuredLoader.item.popup)
{ {
featuredVideosPage.closePopup() featuredLoader.item.closePopup()
return
}
if(featuredImagesPage.popup)
{
featuredImagesPage.closePopup()
return
}
if(featuredPacksPage.popup)
{
featuredPacksPage.closePopup()
return return
} }
featuredVideosPage.opacity = 0 featuredLoaderItem.opacity = 0
featuredImagesPage.opacity = 0
featuredPacksPage.opacity = 0
viewMoreImagePopup.opacity = 0 viewMoreImagePopup.opacity = 0
viewMoreVideoPopup.opacity = 0 viewMoreVideoPopup.opacity = 0
viewMoreWallpaperPopup.opacity = 0 viewMoreWallpaperPopup.opacity = 0
popupContainer.opacity = 0 popupContainer.opacity = 0
resultsLayout.opacity = 1 pageArea.opacity = 1
homePageRoot.popup = false homePageRoot.popup = false
} }
} }
+3 -1
View File
@@ -5,7 +5,9 @@ import QtQuick.Layouts
import KomplexHub import KomplexHub
import KomplexHub.Controls import KomplexHub.Controls
import KomplexHub.Kero import KomplexHub.Kero
import KomplexHubPlugin import KomplexHub.Plugin
import KomplexHub.Views
import KomplexHub.Pages
Item Item
{ {
@@ -2,10 +2,13 @@ import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import QtQuick.Dialogs import QtQuick.Dialogs
import KomplexHub import KomplexHub
import KomplexHub.Controls import KomplexHub.Controls
import KomplexHub.Kero import KomplexHub.Kero
import KomplexHubPlugin import KomplexHub.Plugin
import KomplexHub.Views
import KomplexHub.Pages
Rectangle { Rectangle {
id: root id: root
+9 -4
View File
@@ -1,9 +1,12 @@
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import KomplexHub import KomplexHub
import KomplexHub.Controls import KomplexHub.Controls
import KomplexHub.Kero import KomplexHub.Kero
import KomplexHubPlugin import KomplexHub.Plugin
import KomplexHub.Views
import KomplexHub.Pages
Item Item
{ {
@@ -33,8 +36,8 @@ Item
{ {
id: resultDelegate id: resultDelegate
width: 256 width: resultWidth
height: 245 height: resultHeight
required property string name required property string name
required property string author required property string author
@@ -47,7 +50,8 @@ Item
SearchResultItem SearchResultItem
{ {
anchors.fill: parent anchors.fill: parent
title: parent.author title: parent.name
author: parent.author
description: parent.description description: parent.description
thumbnail: parent.thumbnail thumbnail: parent.thumbnail
uuid: parent.uuid uuid: parent.uuid
@@ -108,6 +112,7 @@ Item
viewMoreWallpaperPopup.authorId = searchModel.data(searchModel.index(index,0), PackSearchModel.AuthorIdRole) viewMoreWallpaperPopup.authorId = searchModel.data(searchModel.index(index,0), PackSearchModel.AuthorIdRole)
viewMoreWallpaperPopup.description = searchModel.data(searchModel.index(index,0), PackSearchModel.DescriptionRole) viewMoreWallpaperPopup.description = searchModel.data(searchModel.index(index,0), PackSearchModel.DescriptionRole)
viewMoreWallpaperPopup.thumbnail = searchModel.data(searchModel.index(index,0), PackSearchModel.ThumbnailRole) viewMoreWallpaperPopup.thumbnail = searchModel.data(searchModel.index(index,0), PackSearchModel.ThumbnailRole)
viewMoreWallpaperPopup.uuid = searchModel.data(searchModel.index(index,0), PackSearchModel.UuidRole)
viewMoreWallpaperPopup.opacity = 1 viewMoreWallpaperPopup.opacity = 1
popupContainer.opacity = 1 popupContainer.opacity = 1
paginator.opacity = 0 paginator.opacity = 0
+5
View File
@@ -1,8 +1,13 @@
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import KomplexHub import KomplexHub
import KomplexHub.Controls import KomplexHub.Controls
import KomplexHub.Kero
import KomplexHub.Plugin
import KomplexHub.Views
import KomplexHub.Pages
Item { Item {
id: loginFormRoot id: loginFormRoot
+145
View File
@@ -0,0 +1,145 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import KomplexHub
import KomplexHub.Controls
import KomplexHub.Kero
import KomplexHub.Plugin
import KomplexHub.Views
import KomplexHub.Pages
Rectangle
{
id: rootItem
property string query
readonly property bool searchable: false
property bool popup: false
property int resultWidth: 256
property int resultHeight: 245
color: palette.base
NewestPacksModel
{
id: packsModel
resultsPerPage: paginator.resultsPerPage
Component.onCompleted: () => nextPage()
}
ColumnLayout
{
id: resultsLayout
visible: opacity > 0.01
anchors.fill: parent
anchors.margins: Constants.mediumMargin
KeroHeader
{
Layout.alignment: Qt.AlignTop
Layout.fillWidth: true
Layout.preferredHeight: 180
title: qsTr("Newest Live Wallpapers")
description: qsTr("Live Wallpaper Packs from Komplex or ShaderToy")
image: "qrc:/images/kero/kero_star.png"
}
PaginatorGrid
{
Layout.alignment: Qt.AlignTop
Layout.fillHeight: true
Layout.fillWidth: true
id: paginator
model: packsModel
loading: model.state === NewestPacksModel.Loading
delegate: ItemDelegate
{
id: resultDelegate
width: resultWidth
height: resultHeight
required property string name
required property string author
required property string description
required property string uuid
required property string thumbnail
required property string authorId
required property int index
SearchResultItem
{
anchors.fill: parent
title: parent.name
author: parent.author
description: parent.description
thumbnail: parent.thumbnail
uuid: parent.uuid
selected: paginator.currentIndex === parent.index
onTriggered: () => paginator.currentIndex = parent.index
onViewMoreTriggered: () =>
{
showWallpaperPopup(parent.index)
}
}
}
}
}
Rectangle
{
id: popupContainer
anchors.fill: parent
opacity: 0
visible: opacity > 0.01
color: palette.base
PackView
{
id: viewMoreWallpaperPopup
anchors.fill: parent
opacity: 0
visible: opacity > 0.01
Behavior on opacity {
NumberAnimation
{
duration: 250
}
}
}
Behavior on opacity {
NumberAnimation
{
duration: 250
}
}
}
function closePopup()
{
viewMoreWallpaperPopup.opacity = 0
popupContainer.opacity = 0
resultsLayout.opacity = 1
rootItem.popup = false
}
function showWallpaperPopup(index)
{
viewMoreWallpaperPopup.author = packsModel.data(packsModel.index(index,0), NewestPacksModel.AuthorRole)
viewMoreWallpaperPopup.authorId = packsModel.data(packsModel.index(index,0), NewestPacksModel.AuthorIdRole)
viewMoreWallpaperPopup.description = packsModel.data(packsModel.index(index,0), NewestPacksModel.DescriptionRole)
viewMoreWallpaperPopup.thumbnail = packsModel.data(packsModel.index(index,0), NewestPacksModel.ThumbnailRole)
viewMoreWallpaperPopup.opacity = 1
popupContainer.opacity = 1
resultsLayout.opacity = 0
rootItem.popup = true
}
}
+5
View File
@@ -1,8 +1,13 @@
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import KomplexHub import KomplexHub
import KomplexHub.Controls
import KomplexHub.Kero import KomplexHub.Kero
import KomplexHub.Plugin
import KomplexHub.Views
import KomplexHub.Pages
Item { Item {
readonly property bool searchable: false readonly property bool searchable: false
@@ -1,7 +1,13 @@
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import KomplexHub import KomplexHub
import KomplexHub.Controls
import KomplexHub.Kero
import KomplexHub.Plugin
import KomplexHub.Views
import KomplexHub.Pages
Item { Item {
id: root id: root
+3 -1
View File
@@ -5,7 +5,9 @@ import QtQuick.Layouts
import KomplexHub import KomplexHub
import KomplexHub.Controls import KomplexHub.Controls
import KomplexHub.Kero import KomplexHub.Kero
import KomplexHubPlugin import KomplexHub.Plugin
import KomplexHub.Views
import KomplexHub.Pages
Item Item
{ {
@@ -31,9 +31,12 @@ import QtQuick.Layouts
//import org.kde.plasma.core as PlasmaCore //import org.kde.plasma.core as PlasmaCore
import QtCore import QtCore
import Qt.labs.folderlistmodel 2.15 import Qt.labs.folderlistmodel 2.15
import KomplexHub import KomplexHub
import KomplexHub.Controls import KomplexHub.Controls
import KomplexHubPlugin import KomplexHub.Plugin
import KomplexHub.Views
import KomplexHub.Pages
//import com.github.digitalartifex.komplex 1.0 as Komplex //import com.github.digitalartifex.komplex 1.0 as Komplex
+13
View File
@@ -0,0 +1,13 @@
qt_add_library(KomplexHubViews STATIC)
qt6_add_qml_module(KomplexHubViews
URI "KomplexHub.Views"
VERSION 1.0
RESOURCE_PREFIX "/qt/qml"
QML_FILES
"CompletedView.qml"
"DownloadView.qml"
"ErrorView.qml"
"ImageView.qml"
"PackView.qml"
"VideoView.qml"
)
+66
View File
@@ -0,0 +1,66 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import KomplexHub
import KomplexHub.Kero
import KomplexHub.Controls
import KomplexHub.Plugin
Item
{
property DownloadManager manager: null
ColumnLayout
{
anchors.fill: parent
VerticalSpacer { }
KeroSuccessAvatar
{
Layout.fillWidth: true
Layout.fillHeight: true
Layout.preferredHeight: 512
Layout.maximumHeight: 512
}
RowLayout
{
Layout.fillWidth: true
Layout.preferredHeight: 36
Layout.maximumHeight: 36
Layout.margins: Constants.largeMargin
Item
{
Layout.fillHeight: true
Layout.fillWidth: true
}
SquareButton
{
Layout.preferredWidth: 186
Layout.fillHeight: true
text: qsTr("Okay")
onTriggered: () =>
{
if(manager != null)
{
manager.reset()
}
}
}
SquareButton
{
Layout.preferredWidth: 186
Layout.fillHeight: true
text: qsTr("Set Wallpaper")
icon.source: "qrc:/images/icons/icons8-download.svg"
}
}
VerticalSpacer {}
}
}
+131
View File
@@ -0,0 +1,131 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtQuick.Effects
import KomplexHub
import KomplexHub.Controls
import KomplexHub.Plugin
import KomplexHub.Kero
Item
{
property string thumbnail
property DownloadManager manager
Rectangle
{
anchors.fill: parent
color: palette.base
BackgroundImage
{
source: thumbnail
}
ColumnLayout
{
anchors.fill: parent
anchors.margins: Constants.largeMargin
Item { Layout.preferredHeight: 64; Layout.fillWidth: true }
KeroBuildingAnimation
{
Layout.fillWidth: true
Layout.fillHeight: true
}
VerticalSpacer {}
Text
{
text: qsTr("Download Progress")
font: Constants.h3Font
color : palette.text
Layout.preferredHeight: Constants.largeMargin
}
RowLayout
{
Layout.fillWidth: true
Layout.preferredHeight: Constants.largeMargin
ProgressBar
{
Layout.fillWidth: true
value: manager.downloadProgress
}
Text
{
text: manager.downloadedBytes
font: Constants.h4Font
color : palette.text
}
Text
{
text: "/"
font: Constants.h4Font
color : palette.text
Layout.preferredHeight: 32
}
Text
{
text: manager.downloadSize
font: Constants.h4Font
color : palette.text
Layout.preferredHeight: 32
}
}
Text
{
text: qsTr("Install Progress")
font: Constants.h3Font
color : palette.text
height: 32
}
RowLayout
{
Layout.fillWidth: true
Layout.preferredHeight: Constants.largeMargin
ProgressBar
{
Layout.fillWidth: true
value: manager.compileProgress
}
Text
{
text: manager.compileStepsCompleted
font: Constants.h4Font
color : palette.text
Layout.preferredHeight: Constants.largeMargin
}
Text
{
text: "/"
font: Constants.h4Font
color : palette.text
Layout.preferredHeight: Constants.largeMargin
}
Text
{
text: manager.compileSteps
font: Constants.h4Font
color : palette.text
Layout.preferredHeight: Constants.largeMargin
}
}
Item { Layout.preferredHeight: Constants.largeMargin * 2; Layout.fillWidth: true }
}
}
}
+58
View File
@@ -0,0 +1,58 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import KomplexHub
import KomplexHub.Kero
import KomplexHub.Controls
import KomplexHub.Plugin
Item
{
property DownloadManager manager: null
ColumnLayout
{
anchors.fill: parent
VerticalSpacer { }
KeroWarningAvatar
{
Layout.fillWidth: true
Layout.fillHeight: true
Layout.preferredHeight: 512
Layout.maximumHeight: 512
}
RowLayout
{
Layout.fillWidth: true
Layout.preferredHeight: 36
Layout.maximumHeight: 36
Layout.margins: Constants.largeMargin
Item
{
Layout.fillHeight: true
Layout.fillWidth: true
}
SquareButton
{
Layout.preferredWidth: 186
Layout.fillHeight: true
text: qsTr("Okay")
onTriggered: () =>
{
if(manager != null)
{
manager.reset()
}
}
}
}
VerticalSpacer {}
}
}
+339
View File
@@ -0,0 +1,339 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtQuick.Effects
import KomplexHub
import KomplexHub.Controls
import KomplexHub.Kero
import KomplexHub.Plugin
Item
{
property string uuid
property string author
property string authorUrl
property string description
property string thumbnail
property string portrait
property string landscape
property string fullScreen
property string portraitSize
property string landscapeSize
property string fullScreenSize
property string backgroundPortrait
property string backgroundLandscape
property int imageHeight
property int imageWidth
id: rootItem
DownloadManager
{
id: downloadManager
}
Rectangle
{
id: pageView
anchors.fill: parent
color: palette.base
BackgroundImage
{
anchors.fill: parent
source: width > height ? backgroundLandscape : backgroundPortrait
}
ColumnLayout
{
anchors.fill: parent
anchors.margins: Constants.largeMargin
spacing: Constants.largeMargin
ImageFrame
{
Layout.fillWidth: true
Layout.alignment: Qt.AlignTop | Qt.AlignHCenter
Layout.topMargin: Constants.largeMargin
Layout.preferredHeight: width / 1.77777777778
Layout.maximumWidth: 800
source: rootItem.thumbnail
}
Text
{
id: titleText
text: rootItem.author
color: palette.text
font.bold: true
font.pixelSize: Constants.h3Font.pixelSize
elide: Text.ElideRight
Layout.fillWidth: true
Layout.alignment: Qt.AlignTop | Qt.AlignLeft
}
Text
{
id: descriptionText
text: rootItem.description
color: palette.text
font.pointSize: Constants.h4Font.pixelSize
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
Layout.alignment: Qt.AlignTop| Qt.AlignLeft
Layout.fillWidth: true
}
/** Spacer **/
Item
{
Layout.fillWidth: true
Layout.preferredHeight: 32
}
Text
{
text: qsTr("Available Downloads")
color: palette.text
font.bold: true
font.pixelSize: Constants.h3Font.pixelSize
elide: Text.ElideRight
Layout.fillWidth: true
Layout.alignment: Qt.AlignTop| Qt.AlignLeft
}
RowLayout
{
Layout.fillWidth: true
ComboBox
{
id: downloadSelector
model:[
"Screen (" + fullScreenSize + ")",
"Portrait (" + portraitSize + ")",
"Landscape (" + landscapeSize + ")"
]
Layout.fillWidth: true
Layout.preferredHeight: 36
}
SquareButton
{
Layout.preferredHeight: 36
Layout.preferredWidth: 128
text: qsTr("Download")
icon.source: "qrc:/images/icons/icons8-download.svg"
onTriggered: () => rootItem.download()
}
}
/** Spacer **/
Item { Layout.fillWidth: true; Layout.fillHeight: true }
RowLayout
{
Layout.fillWidth: true
Layout.alignment: Qt.AlignBottom
Text {
text: qsTr("Images Provided Courtesy of Pexels")
elide: Text.ElideLeft
color: palette.text
font.bold: true
font.pixelSize: Constants.h6Font.pixelSize
Layout.fillWidth: true
Layout.alignment: Qt.AlignLeft
}
Image
{
transform: Image.PreserveAspectFit
source: "qrc:/images/icons/pexels-icon-filled-256.svg"
Layout.alignment: Qt.AlignRight
Layout.preferredHeight: 32
Layout.preferredWidth: 32
}
}
}
states:
[
State
{
name: "downloading"
when: downloadManager.state === DownloadManager.Downloading
PropertyChanges
{
target: pageView
opacity: 0
}
PropertyChanges
{
target: downloadView
opacity: 1
}
PropertyChanges
{
target: completedView
opacity: 0
}
PropertyChanges
{
target: errorView
opacity: 0
}
},
State
{
name: "complete"
when: downloadManager.state === DownloadManager.Complete
PropertyChanges
{
target: pageView
opacity: 0
}
PropertyChanges
{
target: downloadView
opacity: 0
}
PropertyChanges
{
target: completedView
opacity: 1
}
PropertyChanges
{
target: errorView
opacity: 0
}
},
State
{
name: "error"
when: downloadManager.state === DownloadManager.Error
PropertyChanges
{
target: pageView
opacity: 0
}
PropertyChanges
{
target: downloadView
opacity: 0
}
PropertyChanges
{
target: completedView
opacity: 0
}
PropertyChanges
{
target: errorView
opacity: 1
}
},
State
{
name: "idle"
when: downloadManager.state === DownloadManager.Idle
PropertyChanges
{
target: pageView
opacity: 1
}
PropertyChanges
{
target: downloadView
opacity: 0
}
PropertyChanges
{
target: completedView
opacity: 0
}
PropertyChanges
{
target: errorView
opacity: 0
}
}
]
}
DownloadView
{
id: downloadView
anchors.fill: parent
manager: downloadManager
thumbnail: rootItem.thumbnail
opacity: 0
visible: opacity > 0.01
}
CompletedView
{
id: completedView
anchors.fill: parent
opacity: 0
visible: opacity > 0.01
manager: downloadManager
}
ErrorView
{
id: errorView
anchors.fill: parent
opacity: 0
visible: opacity > 0.01
manager: downloadManager
}
function download()
{
let url = ""
switch(downloadSelector.currentIndex)
{
case 1:
url = portrait
break;
case 2:
url = landscape
break;
case 0:
default:
url = fullScreen
break;
}
downloadManager.downloadImage(author, authorUrl, description, url)
}
}
+309
View File
@@ -0,0 +1,309 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtQuick.Effects
import KomplexHub
import KomplexHub.Controls
import KomplexHub.Kero
import KomplexHub.Plugin
Item
{
property string uuid
property string author
property string authorId
property string description
property string thumbnail
property string name
property int imageHeight
property int imageWidth
id: rootItem
DownloadManager
{
id: downloadManager
}
Rectangle
{
id: pageView
anchors.fill: parent
color: palette.base
BackgroundImage
{
anchors.fill: parent
source: rootItem.thumbnail
}
ColumnLayout
{
anchors.fill: parent
anchors.margins: Constants.largeMargin
spacing: Constants.largeMargin
ImageFrame
{
Layout.fillWidth: true
Layout.alignment: Qt.AlignTop| Qt.AlignHCenter
Layout.topMargin: Constants.largeMargin
Layout.preferredHeight: width / 1.77777777778
Layout.maximumWidth: 800
source: rootItem.thumbnail
}
Text
{
id: titleText
text: rootItem.name
color: palette.text
font.bold: true
font.pixelSize: Constants.h3Font.pixelSize
elide: Text.ElideRight
Layout.fillWidth: true
Layout.alignment: Qt.AlignTop| Qt.AlignLeft
}
Text
{
id: descriptionText
text: rootItem.description
color: palette.text
font.pointSize: Constants.h4Font.pixelSize
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
Layout.alignment: Qt.AlignTop| Qt.AlignLeft
Layout.fillWidth: true
}
Text
{
id: authorText
text: qsTr("By: ") + rootItem.author
color: palette.text
font.pointSize: Constants.h5Font.pixelSize
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
horizontalAlignment: Qt.AlignRight
Layout.alignment: Qt.AlignTop | Qt.AlignRight
Layout.fillWidth: true
}
/** Spacer **/
Item
{
Layout.fillWidth: true
Layout.preferredHeight: 32
}
RowLayout
{
Layout.fillWidth: true
Item { Layout.fillWidth: true }
SquareButton
{
Layout.preferredHeight: 36
Layout.preferredWidth: 128
text: qsTr("Download")
icon.source: "qrc:/images/icons/icons8-download.svg"
onTriggered: () => rootItem.download()
}
}
/** Spacer **/
Item { Layout.fillWidth: true; Layout.fillHeight: true }
RowLayout
{
Layout.fillWidth: true
Layout.alignment: Qt.AlignBottom
Text {
text: qsTr("Shaders Provided Courtesy of ShaderToy, Komplex and Their Respective Authors")
elide: Text.ElideLeft
color: palette.text
font.bold: true
font.pixelSize: Constants.h6Font.pixelSize
Layout.fillWidth: true
Layout.alignment: Qt.AlignLeft
}
Image
{
transform: Image.PreserveAspectFit
source: "qrc:/images/icons/pexels-icon-filled-256.svg"
Layout.alignment: Qt.AlignRight
Layout.preferredHeight: 32
Layout.preferredWidth: 32
}
}
}
states:
[
State
{
name: "downloading"
when: downloadManager.state === DownloadManager.Downloading
PropertyChanges
{
target: pageView
opacity: 0
}
PropertyChanges
{
target: downloadView
opacity: 1
}
PropertyChanges
{
target: completedView
opacity: 0
}
PropertyChanges
{
target: errorView
opacity: 0
}
},
State
{
name: "complete"
when: downloadManager.state === DownloadManager.Complete
PropertyChanges
{
target: pageView
opacity: 0
}
PropertyChanges
{
target: downloadView
opacity: 0
}
PropertyChanges
{
target: completedView
opacity: 1
}
PropertyChanges
{
target: errorView
opacity: 0
}
},
State
{
name: "error"
when: downloadManager.state === DownloadManager.Error
PropertyChanges
{
target: pageView
opacity: 0
}
PropertyChanges
{
target: downloadView
opacity: 0
}
PropertyChanges
{
target: completedView
opacity: 0
}
PropertyChanges
{
target: errorView
opacity: 1
}
},
State
{
name: "idle"
when: downloadManager.state === DownloadManager.Idle
PropertyChanges
{
target: pageView
opacity: 1
}
PropertyChanges
{
target: downloadView
opacity: 0
}
PropertyChanges
{
target: completedView
opacity: 0
}
PropertyChanges
{
target: errorView
opacity: 0
}
}
]
}
DownloadView
{
id: downloadView
anchors.fill: parent
manager: downloadManager
thumbnail: rootItem.thumbnail
opacity: 0
visible: opacity > 0.01
}
CompletedView
{
id: completedView
anchors.fill: parent
opacity: 0
visible: opacity > 0.01
manager: downloadManager
}
ErrorView
{
id: errorView
anchors.fill: parent
opacity: 0
visible: opacity > 0.01
manager: downloadManager
}
function download()
{
downloadManager.downloadPack(uuid)
}
Component.onCompleted: () => downloadManager.reset()
}
+313
View File
@@ -0,0 +1,313 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtQuick.Effects
import KomplexHub
import KomplexHub.Controls
import KomplexHub.Kero
import KomplexHub.Plugin
Item
{
property string uuid
property string author
property string authorUrl
property string thumbnail
property alias model: downloadSelector.model
property int modelIndex
property int imageHeight
property int imageWidth
visible: opacity > 0.01
Connections
{
target: model ? model : null
function onRowCountChanged()
{
downloadSelector.currentIndex = 0
}
}
DownloadManager
{
id: downloadManager
}
id: rootItem
Rectangle
{
id: pageView
anchors.fill: parent
color: palette.base
BackgroundImage
{
anchors.fill: parent
source: rootItem.thumbnail
}
ColumnLayout
{
anchors.fill: parent
anchors.margins: Constants.largeMargin
spacing: Constants.largeMargin
ImageFrame
{
Layout.fillWidth: true
Layout.alignment: Qt.AlignTop| Qt.AlignHCenter
Layout.topMargin: Constants.largeMargin
Layout.preferredHeight: width / 1.77777777778
Layout.maximumWidth: 800
source: rootItem.thumbnail
}
Text
{
id: titleText
text: rootItem.author
color: palette.text
font.bold: true
font.pixelSize: Constants.h3Font.pixelSize
elide: Text.ElideRight
Layout.fillWidth: true
Layout.alignment: Qt.AlignTop| Qt.AlignLeft
}
/** Spacer **/
Item
{
Layout.fillWidth: true
Layout.preferredHeight: 32
}
Text
{
text: qsTr("Available Downloads")
color: palette.text
font.bold: true
font.pixelSize: Constants.h3Font.pixelSize
elide: Text.ElideRight
Layout.fillWidth: true
Layout.alignment: Qt.AlignTop| Qt.AlignLeft
}
RowLayout
{
Layout.fillWidth: true
ComboBox
{
id: downloadSelector
textRole: "text"
valueRole: "url"
Layout.fillWidth: true
Layout.preferredHeight: 36
}
SquareButton
{
Layout.preferredHeight: 36
Layout.preferredWidth: 128
text: qsTr("Download")
icon.source: "qrc:/images/icons/icons8-download.svg"
onTriggered: () => rootItem.download()
}
}
/** Spacer **/
Item { Layout.fillWidth: true; Layout.fillHeight: true }
RowLayout
{
Layout.fillWidth: true
Layout.alignment: Qt.AlignBottom
Text {
text: qsTr("Videos Provided Courtesy of Pexels and Their Respective Authors")
elide: Text.ElideLeft
color: palette.text
font.bold: true
font.pixelSize: Constants.h6Font.pixelSize
Layout.fillWidth: true
Layout.alignment: Qt.AlignLeft
}
Image
{
transform: Image.PreserveAspectFit
source: "qrc:/images/icons/pexels-icon-filled-256.svg"
Layout.alignment: Qt.AlignRight
Layout.preferredHeight: 32
Layout.preferredWidth: 32
}
}
}
states:
[
State
{
name: "downloading"
when: downloadManager.state === DownloadManager.Downloading
PropertyChanges
{
target: pageView
opacity: 0
}
PropertyChanges
{
target: downloadView
opacity: 1
}
PropertyChanges
{
target: completedView
opacity: 0
}
PropertyChanges
{
target: errorView
opacity: 0
}
},
State
{
name: "complete"
when: downloadManager.state === DownloadManager.Complete
PropertyChanges
{
target: pageView
opacity: 0
}
PropertyChanges
{
target: downloadView
opacity: 0
}
PropertyChanges
{
target: completedView
opacity: 1
}
PropertyChanges
{
target: errorView
opacity: 0
}
},
State
{
name: "error"
when: downloadManager.state === DownloadManager.Error
PropertyChanges
{
target: pageView
opacity: 0
}
PropertyChanges
{
target: downloadView
opacity: 0
}
PropertyChanges
{
target: completedView
opacity: 0
}
PropertyChanges
{
target: errorView
opacity: 1
}
},
State
{
name: "idle"
when: downloadManager.state === DownloadManager.Idle
PropertyChanges
{
target: pageView
opacity: 1
}
PropertyChanges
{
target: downloadView
opacity: 0
}
PropertyChanges
{
target: completedView
opacity: 0
}
PropertyChanges
{
target: errorView
opacity: 0
}
}
]
}
DownloadView
{
id: downloadView
anchors.fill: parent
manager: downloadManager
thumbnail: rootItem.thumbnail
opacity: 0
visible: opacity > 0.01
}
CompletedView
{
id: completedView
anchors.fill: parent
opacity: 0
visible: opacity > 0.01
manager: downloadManager
}
ErrorView
{
id: errorView
anchors.fill: parent
opacity: 0
visible: opacity > 0.01
manager: downloadManager
}
function download()
{
downloadManager.downloadImage(author, authorUrl, downloadSelector.currentValue)
}
}
+1
View File
@@ -18,5 +18,6 @@ qt6_add_qml_module(KomplexHubModule
"WallpaperModelData.qml" "WallpaperModelData.qml"
) )
set_target_properties(KomplexHubModule PROPERTIES VERSION "1.0")
add_subdirectory("Controls") add_subdirectory("Controls")
add_subdirectory("Kero") add_subdirectory("Kero")
+3 -3
View File
@@ -63,7 +63,7 @@ QtObject {
readonly property int normalAnimationDuration: 250 readonly property int normalAnimationDuration: 250
readonly property int fastAnimationDuration: 125 readonly property int fastAnimationDuration: 125
property StudioApplication application: StudioApplication { // property StudioApplication application: StudioApplication {
fontPath: Qt.resolvedUrl("../KomplexHubContent/" + relativeFontDirectory) // fontPath: Qt.resolvedUrl("../KomplexHubContent/" + relativeFontDirectory)
} // }
} }
@@ -0,0 +1,32 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Effects
Item
{
property alias source: image.source
property alias imageOpacity: effect.opacity
property alias blur: effect.blur
property alias saturation: effect.saturation
Image
{
anchors.fill: parent
id: image
source: thumbnail
fillMode: Image.PreserveAspectFit
visible: false
}
MultiEffect
{
id: effect
anchors.fill: image
source: image
blurEnabled: true
blurMax: 64
blur: 1.0
opacity: 0.25
saturation: -0.8
}
}
+9 -9
View File
@@ -1,8 +1,8 @@
### This file is automatically generated by Qt Design Studio. ### This file is automatically generated by Qt Design Studio.
### Do not change ### Do not change
qt_add_library(KomplexHubModule_Controls STATIC) qt_add_library(KomplexHubControls STATIC)
qt6_add_qml_module(KomplexHubModule_Controls qt6_add_qml_module(KomplexHubControls
URI "KomplexHub.Controls" URI "KomplexHub.Controls"
VERSION 1.0 VERSION 1.0
RESOURCE_PREFIX "/qt/qml" RESOURCE_PREFIX "/qt/qml"
@@ -14,12 +14,12 @@ qt6_add_qml_module(KomplexHubModule_Controls
"Throbber.qml" "Throbber.qml"
"SearchResultItem.qml" "SearchResultItem.qml"
"SearchResultList.qml" "SearchResultList.qml"
QML_FILES PaginationBox.qml "PaginationBox.qml"
QML_FILES PaginatorGrid.qml "PaginatorGrid.qml"
QML_FILES HorizontalPaginator.qml "HorizontalPaginator.qml"
QML_FILES ImageView.qml "VerticalSpacer.qml"
QML_FILES "ImageFrame.qml"
QML_FILES VideoView.qml "BackgroundImage.qml"
QML_FILES PackView.qml
) )
#set_target_properties(KomplexHubControls PROPERTIES VERSION "1.0")
@@ -5,7 +5,7 @@ import QtQuick.Layouts
import KomplexHub import KomplexHub
import KomplexHub.Controls import KomplexHub.Controls
import KomplexHub.Kero import KomplexHub.Kero
import KomplexHubPlugin import KomplexHub.Plugin
Item Item
{ {
@@ -28,6 +28,7 @@ Item
signal viewMoreTriggered() signal viewMoreTriggered()
id: rootItem id: rootItem
clip: true
Item Item
{ {
@@ -47,8 +48,6 @@ Item
height: 245 height: 245
color: palette.accent color: palette.accent
radius: 5 radius: 5
// x: resultsView.currentItem.x
// y: resultsView.currentItem.y
Behavior on x { SpringAnimation { spring: 3; damping: 0.2 } } Behavior on x { SpringAnimation { spring: 3; damping: 0.2 } }
Behavior on y { SpringAnimation { spring: 3; damping: 0.2 } } Behavior on y { SpringAnimation { spring: 3; damping: 0.2 } }
} }
@@ -59,6 +58,7 @@ Item
id: resultsView id: resultsView
Layout.fillHeight: true Layout.fillHeight: true
Layout.fillWidth: true Layout.fillWidth: true
clip: true
spacing: Constants.mediumMargin spacing: Constants.mediumMargin
@@ -134,7 +134,7 @@ Item
Item Item
{ {
Layout.fillHeight: true Layout.fillHeight: true
Layout.preferredWidth: 128 Layout.preferredWidth: 64
Rectangle Rectangle
{ {
id: gradientMap id: gradientMap
+34
View File
@@ -0,0 +1,34 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
Item
{
property alias source: viewImage.source
id: rootItem
Rectangle
{
anchors.fill: parent
Layout.alignment: Qt.AlignCenter
color: palette.base.darker()
border.color: palette.midlight
Throbber
{
anchors.fill: parent
id: loadingThrobber
visible: viewImage.status === Image.Loading
}
Image
{
id: viewImage
anchors.fill: parent
transform: Image.PreserveAspectCrop
source: rootItem.source
visible: !(status === Image.Loading)
}
}
}
-195
View File
@@ -1,195 +0,0 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtQuick.Effects
import KomplexHub
import KomplexHub.Controls
import KomplexHub.Kero
import KomplexHubPlugin
Item
{
property string uuid
property string author
property string authorUrl
property string description
property string thumbnail
property string portrait
property string landscape
property string original
property string fullScreen
property string portraitSize
property string landscapeSize
property string fullScreenSize
property string backgroundPortrait
property string backgroundLandscape
property int imageHeight
property int imageWidth
id: rootItem
Rectangle
{
anchors.fill: parent
color: palette.base
Image
{
id: backgroundImage
source: width > height ? backgroundLandscape : backgroundPortrait
transform: Image.PreserveAspectCrop
anchors.fill: parent
visible: false
}
MultiEffect
{
anchors.fill: backgroundImage
source: backgroundImage
blurEnabled: true
blurMax: 64
blur: 1.0
opacity: 0.25
saturation: -0.8
}
ColumnLayout
{
anchors.fill: parent
anchors.margins: Constants.largeMargin
spacing: Constants.largeMargin
RowLayout
{
Layout.fillWidth: true
Layout.alignment: Qt.AlignTop| Qt.AlignHCenter
Layout.topMargin: 32
Rectangle
{
Layout.fillWidth: true
Layout.preferredHeight: width / 1.77777777778
Layout.maximumWidth: 800
Layout.alignment: Qt.AlignHCenter
color: palette.base.darker()
Throbber
{
anchors.fill: parent
id: loadingThrobber
visible: viewImage.status === Image.Loading
}
Image
{
id: viewImage
anchors.fill: parent
transform: Image.PreserveAspectCrop
source: rootItem.thumbnail
visible: !(status === Image.Loading)
}
}
}
Text
{
id: titleText
text: rootItem.author
color: palette.text
font.bold: true
font.pixelSize: Constants.h3Font.pixelSize
elide: Text.ElideRight
Layout.fillWidth: true
Layout.alignment: Qt.AlignTop| Qt.AlignLeft
}
Text
{
id: descriptionText
text: rootItem.description
color: palette.text
font.pointSize: Constants.h4Font.pixelSize
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
Layout.alignment: Qt.AlignTop| Qt.AlignLeft
Layout.fillWidth: true
}
/** Spacer **/
Item
{
Layout.fillWidth: true
Layout.preferredHeight: 32
}
Text
{
text: qsTr("Available Downloads")
color: palette.text
font.bold: true
font.pixelSize: Constants.h3Font.pixelSize
elide: Text.ElideRight
Layout.fillWidth: true
Layout.alignment: Qt.AlignTop| Qt.AlignLeft
}
RowLayout
{
Layout.fillWidth: true
ComboBox
{
id: downloadSelector
model:[
"Screen (" + fullScreenSize + ")",
"Portrait (" + portraitSize + ")",
"Landscape (" + landscapeSize + ")"
]
Layout.fillWidth: true
Layout.preferredHeight: 36
}
SquareButton
{
Layout.preferredHeight: 36
Layout.preferredWidth: 128
text: qsTr("Download")
icon.source: "qrc:/images/icons/icons8-download.svg"
}
}
/** Spacer **/
Item { Layout.fillWidth: true; Layout.fillHeight: true }
RowLayout
{
Layout.fillWidth: true
Layout.alignment: Qt.AlignBottom
Text {
text: qsTr("Images Provided Courtesy of Pexels")
elide: Text.ElideLeft
color: palette.text
font.bold: true
font.pixelSize: Constants.h6Font.pixelSize
Layout.fillWidth: true
Layout.alignment: Qt.AlignLeft
}
Image
{
transform: Image.PreserveAspectFit
source: "qrc:/images/icons/pexels-icon-filled-256.svg"
Layout.alignment: Qt.AlignRight
Layout.preferredHeight: 32
Layout.preferredWidth: 32
}
}
}
}
}
-177
View File
@@ -1,177 +0,0 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtQuick.Effects
import KomplexHub
import KomplexHub.Controls
import KomplexHub.Kero
import KomplexHubPlugin
Item
{
property string uuid
property string author
property string authorId
property string description
property string thumbnail
property int imageHeight
property int imageWidth
id: rootItem
Rectangle
{
anchors.fill: parent
color: palette.base
Image
{
id: backgroundImage
source: thumbnail
transform: Image.PreserveAspectCrop
anchors.fill: parent
visible: false
}
MultiEffect
{
anchors.fill: backgroundImage
source: backgroundImage
blurEnabled: true
blurMax: 64
blur: 1.0
opacity: 0.25
saturation: -0.8
}
ColumnLayout
{
anchors.fill: parent
anchors.margins: Constants.largeMargin
spacing: Constants.largeMargin
RowLayout
{
Layout.fillWidth: true
Layout.alignment: Qt.AlignTop| Qt.AlignHCenter
Layout.topMargin: 32
Rectangle
{
Layout.fillWidth: true
Layout.preferredHeight: width / 1.77777777778
Layout.maximumWidth: 800
Layout.alignment: Qt.AlignHCenter
color: palette.base.darker()
Throbber
{
anchors.fill: parent
id: loadingThrobber
visible: viewImage.status === Image.Loading
}
Image
{
id: viewImage
anchors.fill: parent
transform: Image.PreserveAspectCrop
source: rootItem.thumbnail
visible: !(status === Image.Loading)
}
}
}
Text
{
id: titleText
text: rootItem.author
color: palette.text
font.bold: true
font.pixelSize: Constants.h3Font.pixelSize
elide: Text.ElideRight
Layout.fillWidth: true
Layout.alignment: Qt.AlignTop| Qt.AlignLeft
}
Text
{
id: descriptionText
text: rootItem.description
color: palette.text
font.pointSize: Constants.h4Font.pixelSize
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
Layout.alignment: Qt.AlignTop| Qt.AlignLeft
Layout.fillWidth: true
}
/** Spacer **/
Item
{
Layout.fillWidth: true
Layout.preferredHeight: 32
}
// Text
// {
// text: qsTr("Available Downloads")
// color: palette.text
// font.bold: true
// font.pixelSize: Constants.h3Font.pixelSize
// elide: Text.ElideRight
// Layout.fillWidth: true
// Layout.alignment: Qt.AlignTop| Qt.AlignLeft
// }
RowLayout
{
Layout.fillWidth: true
Item { Layout.fillWidth: true }
SquareButton
{
Layout.preferredHeight: 36
Layout.preferredWidth: 128
text: qsTr("Download")
icon.source: "qrc:/images/icons/icons8-download.svg"
}
}
/** Spacer **/
Item { Layout.fillWidth: true; Layout.fillHeight: true }
RowLayout
{
Layout.fillWidth: true
Layout.alignment: Qt.AlignBottom
Text {
text: qsTr("Shaders Provided Courtesy of ShaderToy and Their Respective Authors")
elide: Text.ElideLeft
color: palette.text
font.bold: true
font.pixelSize: Constants.h6Font.pixelSize
Layout.fillWidth: true
Layout.alignment: Qt.AlignLeft
}
Image
{
transform: Image.PreserveAspectFit
source: "qrc:/images/icons/pexels-icon-filled-256.svg"
Layout.alignment: Qt.AlignRight
Layout.preferredHeight: 32
Layout.preferredWidth: 32
}
}
}
}
}
+1 -1
View File
@@ -5,7 +5,7 @@ import QtQuick.Layouts
import KomplexHub import KomplexHub
import KomplexHub.Controls import KomplexHub.Controls
import KomplexHub.Kero import KomplexHub.Kero
import KomplexHubPlugin import KomplexHub.Plugin
Item Item
{ {
+23 -56
View File
@@ -16,7 +16,7 @@ Item {
signal triggered signal triggered
signal viewMoreTriggered signal viewMoreTriggered
id: mainItem id: rootItem
width: 256 width: 256
height: 256 height: 256
clip: true clip: true
@@ -48,7 +48,7 @@ Item {
onReleased: () => { onReleased: () => {
if(!states.selected) if(!states.selected)
{ {
mainItem.triggered() rootItem.triggered()
} }
} }
} }
@@ -57,47 +57,13 @@ Item {
{ {
anchors.fill: parent anchors.fill: parent
Rectangle ImageFrame
{ {
Layout.preferredWidth: 250 Layout.preferredWidth: 250
Layout.preferredHeight: 141 Layout.preferredHeight: 141
Layout.alignment: Qt.AlignHCenter | Qt.AlignTop Layout.alignment: Qt.AlignHCenter | Qt.AlignTop
Layout.topMargin: 3 Layout.topMargin: 3
source: rootItem.thumbnail
border.color: palette.alternateBase.lighter(1.75)
color: palette.base.lighter(1.25)
Throbber
{
anchors.fill: parent
id: loadingThrobber
visible: viewImage.status === Image.Loading
}
Image
{
property int retries: 0
id: viewImage
anchors.fill: parent
source: mainItem.thumbnail
visible: !(status === Image.Loading)
fillMode: Image.PreserveAspectCrop
onStatusChanged: () =>
{
// if(status === Image.Error)
// {
// if(retries <= 3)
// {
// ++retries
// let src = source
// source = ""
// source = src
// }
// }
}
}
Image Image
{ {
@@ -108,18 +74,18 @@ Item {
width: 24 width: 24
height: 24 height: 24
transform: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
opacity: 0.5 opacity: 0.5
source: "qrc:/images/icons/pexels-icon-filled-256.svg" source: "qrc:/images/icons/pexels-icon-filled-256.svg"
visible: mainItem.pexels visible: rootItem.pexels
} }
} }
Text Text
{ {
color: palette.text color: palette.text
text: mainItem.title text: rootItem.title
font.pixelSize: 16 font.pixelSize: 16
font.bold: true font.bold: true
@@ -131,25 +97,13 @@ Item {
Item { Layout.fillHeight: true } Item { Layout.fillHeight: true }
Text
{
color: palette.text
font.pixelSize: 12
text: "By: " + mainItem.author
leftPadding: 12
Layout.alignment: Qt.AlignLeft | Qt.AlignBottom
Layout.preferredWidth: 250
visible: !mainItem.pexels
}
Text Text
{ {
id: descriptionText id: descriptionText
clip: true clip: true
color: palette.text color: palette.text
font.pixelSize: 12 font.pixelSize: 12
text: mainItem.description text: rootItem.description
wrapMode: Text.WrapAtWordBoundaryOrAnywhere wrapMode: Text.WrapAtWordBoundaryOrAnywhere
textFormat: Text.PlainText textFormat: Text.PlainText
elide: Text.ElideRight elide: Text.ElideRight
@@ -162,6 +116,19 @@ Item {
Layout.bottomMargin: 3 Layout.bottomMargin: 3
} }
Text
{
color: palette.text
font.pixelSize: 12
text: "By: " + rootItem.author
leftPadding: Constants.mediumMargin
rightPadding: Constants.mediumMargin
horizontalAlignment: Qt.AlignRight
Layout.alignment: Qt.AlignLeft | Qt.AlignBottom
Layout.fillWidth: true
}
SquareButton SquareButton
{ {
id: viewMoreButton id: viewMoreButton
@@ -176,7 +143,7 @@ Item {
opacity: 0 opacity: 0
onTriggered: () => { onTriggered: () => {
mainItem.viewMoreTriggered() rootItem.viewMoreTriggered()
} }
} }
@@ -189,7 +156,7 @@ Item {
id: states id: states
property bool clicked: false property bool clicked: false
property bool hovered: false property bool hovered: false
property alias selected: mainItem.selected property alias selected: rootItem.selected
property bool idle: true property bool idle: true
onIdleChanged: () => onIdleChanged: () =>
@@ -0,0 +1,9 @@
import QtQuick
import QtQuick.Layouts
Rectangle
{
Layout.fillHeight: true
color: "transparent"
}
-191
View File
@@ -1,191 +0,0 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtQuick.Effects
import KomplexHub
import KomplexHub.Controls
import KomplexHub.Kero
import KomplexHubPlugin
Item
{
property string uuid
property string author
property string authorUrl
property string thumbnail
property alias model: downloadSelector.model
property int modelIndex
property int imageHeight
property int imageWidth
visible: opacity > 0.01
onVisibleChanged: () =>
{
if(!visible)
{
model = null
}
}
Connections
{
target: model
function onRowCountChanged()
{
downloadSelector.currentIndex = 0
}
}
id: rootItem
Rectangle
{
anchors.fill: parent
color: palette.base
Image
{
id: backgroundImage
source: thumbnail
anchors.fill: parent
visible: false
fillMode: Image.PreserveAspectFit
}
MultiEffect
{
anchors.fill: backgroundImage
source: backgroundImage
blurEnabled: true
blurMax: 64
blur: 1.0
opacity: 0.25
saturation: -0.8
}
ColumnLayout
{
anchors.fill: parent
anchors.margins: Constants.largeMargin
spacing: Constants.largeMargin
RowLayout
{
Layout.fillWidth: true
Layout.alignment: Qt.AlignTop| Qt.AlignHCenter
Layout.topMargin: 32
Rectangle
{
Layout.fillWidth: true
Layout.preferredHeight: width / 1.77777777778
Layout.maximumWidth: 800
Layout.alignment: Qt.AlignHCenter
color: palette.base.darker()
Throbber
{
anchors.fill: parent
id: loadingThrobber
visible: viewImage.status === Image.Loading
}
Image
{
id: viewImage
anchors.fill: parent
source: rootItem.thumbnail
visible: !(status === Image.Loading)
fillMode: Image.PreserveAspectCrop
}
}
}
Text
{
id: titleText
text: rootItem.author
color: palette.text
font.bold: true
font.pixelSize: Constants.h3Font.pixelSize
elide: Text.ElideRight
Layout.fillWidth: true
Layout.alignment: Qt.AlignTop| Qt.AlignLeft
}
/** Spacer **/
Item
{
Layout.fillWidth: true
Layout.preferredHeight: 32
}
Text
{
text: qsTr("Available Downloads")
color: palette.text
font.bold: true
font.pixelSize: Constants.h3Font.pixelSize
elide: Text.ElideRight
Layout.fillWidth: true
Layout.alignment: Qt.AlignTop| Qt.AlignLeft
}
RowLayout
{
Layout.fillWidth: true
ComboBox
{
id: downloadSelector
textRole: "text"
valueRole: "url"
Layout.fillWidth: true
Layout.preferredHeight: 36
}
SquareButton
{
Layout.preferredHeight: 36
Layout.preferredWidth: 128
text: qsTr("Download")
icon.source: "qrc:/images/icons/icons8-download.svg"
}
}
/** Spacer **/
Item { Layout.fillWidth: true; Layout.fillHeight: true }
RowLayout
{
Layout.fillWidth: true
Layout.alignment: Qt.AlignBottom
Text {
text: qsTr("Videos Provided Courtesy of Pexels and Their Respective Authors")
elide: Text.ElideLeft
color: palette.text
font.bold: true
font.pixelSize: Constants.h6Font.pixelSize
Layout.fillWidth: true
Layout.alignment: Qt.AlignLeft
}
Image
{
transform: Image.PreserveAspectFit
source: "qrc:/images/icons/pexels-icon-filled-256.svg"
Layout.alignment: Qt.AlignRight
Layout.preferredHeight: 32
Layout.preferredWidth: 32
}
}
}
}
}
+5 -2
View File
@@ -1,5 +1,5 @@
qt_add_library(KomplexHubModule_Kero STATIC) qt_add_library(KomplexHubKero STATIC)
qt6_add_qml_module(KomplexHubModule_Kero qt6_add_qml_module(KomplexHubKero
URI "KomplexHub.Kero" URI "KomplexHub.Kero"
VERSION 1.0 VERSION 1.0
RESOURCE_PREFIX "/qt/qml" RESOURCE_PREFIX "/qt/qml"
@@ -11,4 +11,7 @@ qt6_add_qml_module(KomplexHubModule_Kero
"KeroLoadingAnimation.qml" "KeroLoadingAnimation.qml"
"KeroNoResultsAvatar.qml" "KeroNoResultsAvatar.qml"
"KeroWarningAvatar.qml" "KeroWarningAvatar.qml"
"KeroHeader.qml"
"KeroSuccessAvatar.qml"
) )
#set_target_properties(KomplexHubKero PROPERTIES VERSION "1.0")
@@ -4,9 +4,9 @@ import QtQuick.Layouts
import KomplexHub import KomplexHub
Item { Item {
property string title: qsTr("Loading") property string title: qsTr("Building")
property string description: qsTr("Kero is busy looking for wallpapers..we promise") property string description: qsTr("Kero is getting your wallpaper ready")
property color color: palette.window property color color: "transparent"
id: keroLoadingOverlayRoot id: keroLoadingOverlayRoot
+82
View File
@@ -0,0 +1,82 @@
import QtQuick
import QtQuick.Controls 2.0
import QtQuick.Layouts
import KomplexHub
Item
{
property string title: qsTr("Wallpaper Spotlight")
property string description: qsTr("Featured Images and Live Wallpaper Packs")
property color color: palette.alternateBase
property string image: "qrc:/images/kero/kero_spotlight.png"
id: rootItem
Rectangle
{
anchors.fill: parent
color: rootItem.color
border.color: palette.midlight
RowLayout
{
anchors.fill: parent
Item
{
Layout.fillHeight: true
Layout.fillWidth: true
}
Rectangle
{
Layout.fillHeight: true
Layout.preferredWidth: height
Layout.alignment: Qt.AlignLeft
color: "transparent"
Image
{
anchors.fill: parent
source: image
antialiasing: true
fillMode: Image.PreserveAspectFit
}
}
ColumnLayout
{
Layout.fillHeight: true
Layout.fillWidth: true
Layout.alignment: Qt.AlignLeft
Text
{
color: palette.text
text: rootItem.title
font: Constants.h1Font
Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom
}
Text
{
id: errorText
text: rootItem.description
color: palette.text.darker()
Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom
Layout.bottomMargin: Constants.largeMargin
}
}
Item
{
Layout.fillHeight: true
Layout.fillWidth: true
}
}
}
}
@@ -0,0 +1,66 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import KomplexHub
Item {
property string title: qsTr("Success!")
property string description: qsTr("Your new wallpaper is ready!")
property color color: "transparent"
id: keroHelloAvatarRoot
Rectangle {
id: keroHelloAvatarBackground
anchors.fill: parent
color: keroHelloAvatarRoot.color
ColumnLayout {
anchors.fill: parent
Rectangle {
Layout.fillHeight: true
Layout.fillWidth: true
Layout.minimumWidth: 64
Layout.minimumHeight: 64
Layout.maximumWidth: 512
Layout.maximumHeight: 512
Layout.alignment: Qt.AlignCenter
color: "transparent"
Image {
anchors.fill: parent
source: "qrc:/images/kero/kero_success.png"
antialiasing: true
fillMode: Image.PreserveAspectFit
}
ColumnLayout {
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
Text {
color: palette.text
text: keroHelloAvatarRoot.title
font: Constants.h1Font
Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom
}
Text {
id: errorText
text: keroHelloAvatarRoot.description
color: palette.text.darker()
Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom
Layout.bottomMargin: Constants.largeMargin
}
}
}
}
}
}
+1 -1
View File
@@ -6,7 +6,7 @@ import KomplexHub
Item { Item {
property string title: qsTr("Warning") property string title: qsTr("Warning")
property string description: qsTr("Kero noticed there might be an issue") property string description: qsTr("Kero noticed there might be an issue")
property color color: palette.window property color color: "transparent"
id: keroWarningAvatarRoot id: keroWarningAvatarRoot
+35 -3
View File
@@ -1,12 +1,38 @@
find_package(
Qt6
REQUIRED COMPONENTS
Core
Gui
GuiPrivate
Widgets
Qml
Quick
QuickControls2
QuickTimeline
ShaderTools
ShaderToolsPrivate
Concurrent
)
find_package(
OpenGL REQUIRED COMPONENTS OpenGL
)
find_package(
Vulkan REQUIRED COMPONENTS glslang SPIRV-Tools
)
add_library( add_library(
KomplexHubPlugin KomplexHubPlugin
STATIC STATIC
) )
set_target_properties(KomplexHubPlugin PROPERTIES VERSION "1.0")
qt_add_qml_module( qt_add_qml_module(
KomplexHubPlugin KomplexHubPlugin
URI URI
KomplexHubPlugin "KomplexHub.Plugin"
VERSION VERSION
1.0 1.0
SOURCES SOURCES
@@ -62,6 +88,7 @@ qt_add_qml_module(
common/qwallet.cpp common/qwallet.cpp
usermodel.h usermodel.h
usermodel.cpp usermodel.cpp
SOURCES
) )
target_compile_definitions( target_compile_definitions(
@@ -73,8 +100,13 @@ target_compile_definitions(
add_subdirectory(3rdparty/qtkeychain) add_subdirectory(3rdparty/qtkeychain)
target_link_libraries(KomplexHubPlugin PRIVATE target_link_libraries(KomplexHubPlugin PRIVATE
Qt${QT_VERSION_MAJOR}::Core Qt6::Core
Qt${QT_VERSION_MAJOR}::Gui Qt6::Concurrent
Qt6::Gui
Qt6::GuiPrivate
Qt6::ShaderTools
Qt6::ShaderToolsPrivate
Vulkan::Vulkan
qt6keychain qt6keychain
) )
+24 -24
View File
@@ -1,5 +1,6 @@
#include "coreservices.h" #include "coreservices.h"
#include "logging.h" #include "logging.h"
#include "userservices.h"
QNetworkAccessManager *CoreServices::s_networkAccessManager = nullptr; QNetworkAccessManager *CoreServices::s_networkAccessManager = nullptr;
QMutex CoreServices::s_networkAccessMutex; QMutex CoreServices::s_networkAccessMutex;
@@ -11,28 +12,31 @@ auto CoreServices::networkAccessManager() -> QWeakPointer<QNetworkAccessManager>
if(!s_networkAccessPointer) if(!s_networkAccessPointer)
{ {
s_networkAccessManager = new QNetworkAccessManager(QCoreApplication::instance()); if(!s_networkAccessManager)
s_networkAccessManager->setAutoDeleteReplies(true); {
s_networkAccessManager = new QNetworkAccessManager(QCoreApplication::instance());
s_networkAccessManager->setAutoDeleteReplies(true);
QObject::connect( QObject::connect(
s_networkAccessManager, s_networkAccessManager,
&QNetworkAccessManager::sslErrors, &QNetworkAccessManager::sslErrors,
s_networkAccessManager, s_networkAccessManager,
[] (QNetworkReply *reply, const QList<QSslError> &errors) [] (QNetworkReply *reply, const QList<QSslError> &errors)
{
for(const auto &error : errors)
{ {
LOG_ERROR( for(const auto &error : errors)
"CoreServices::networkAccessManager", {
error.errorString().toStdString().c_str() LOG_ERROR(
); "CoreServices::networkAccessManager",
} error.errorString().toStdString().c_str()
);
}
#ifdef KOMPLEX_LOCAL_DEV #ifdef KOMPLEX_LOCAL_DEV
reply->ignoreSslErrors(); reply->ignoreSslErrors();
#endif #endif
} }
); );
}
s_networkAccessPointer = QSharedPointer<QNetworkAccessManager>( s_networkAccessPointer = QSharedPointer<QNetworkAccessManager>(
s_networkAccessManager, s_networkAccessManager,
@@ -45,11 +49,7 @@ auto CoreServices::networkAccessManager() -> QWeakPointer<QNetworkAccessManager>
auto CoreServices::sessionToken() -> QByteArray auto CoreServices::sessionToken() -> QByteArray
{ {
LOG_ERROR_X(true, return UserServices::userCredentials().sessionToken;
"CoreServices::sessionToken",
"User services not yet implemented",
{}
);
} }
auto CoreServices::screenSize() -> QSize auto CoreServices::screenSize() -> QSize
+178 -17
View File
@@ -19,36 +19,197 @@
#ifndef EXCEPTIONS_H #ifndef EXCEPTIONS_H
#define EXCEPTIONS_H #define EXCEPTIONS_H
#include <QString> #include <QString>
#include <exception> #include <string>
#include <filesystem>
#include "komplex_global.h" #include "komplex_global.h"
struct KOMPLEX_EXPORT Exception : std::exception struct KOMPLEX_EXPORT network_exception : std::ios_base::failure
{ {
explicit Exception(const QString &message, quint16 errorCode = 0) network_exception(const std::string &message, const std::string &details, const std::error_code &code) :
: std::exception(), message(message), errorCode(errorCode){} details(details),
std::ios_base::failure(message, code) { }
const QString message; network_exception(const std::string &message, const std::error_code &code) :
const quint16 errorCode; std::ios_base::failure(message, code) { }
network_exception(const QString &message, const QString &details, const std::error_code &code) :
details(details.toStdString()),
std::ios_base::failure(message.toStdString(), code) { }
network_exception(const QString &message, const int code = errno) :
std::ios_base::failure
(
message.toStdString(),
std::error_code
(
code,
std::system_category()
)
) { }
const std::string details;
}; };
struct KOMPLEX_EXPORT NetworkException : Exception struct KOMPLEX_EXPORT file_exception : std::filesystem::filesystem_error
{ {
NetworkException(const QString &message, qsizetype errorCode = 0) : Exception(message, errorCode) {} file_exception(const std::string &message, const std::string &details, const std::error_code &code) :
details(details),
std::filesystem::filesystem_error(message, code) { }
file_exception(const std::string &message, const std::error_code &code) :
std::filesystem::filesystem_error(message, code) { }
file_exception(const std::string &message, const int code = errno) :
std::filesystem::filesystem_error
(
message,
std::error_code
(
code,
std::system_category()
)
) { }
file_exception(const std::string &message, const std::string &details, const int code = errno) :
details(details),
std::filesystem::filesystem_error
(
message,
std::error_code
(
code,
std::system_category()
)
) { }
const std::string details;
}; };
struct KOMPLEX_EXPORT FileException : Exception
struct KOMPLEX_EXPORT sql_exception : std::ios_base::failure
{ {
FileException(const QString &message, qsizetype errorCode = 0) : Exception(message, errorCode) {} sql_exception(const std::string &message, const std::string &details, const std::error_code &code) :
details(details),
std::ios_base::failure(message, code) { }
sql_exception(const std::string &message, const std::error_code &code) :
std::ios_base::failure(message, code) { }
sql_exception(const std::string &message, const int code = errno) :
std::ios_base::failure
(
message,
std::error_code
(
code,
std::system_category()
)
) { }
const std::string details;
}; };
struct KOMPLEX_EXPORT SqlException : Exception
struct KOMPLEX_EXPORT wallet_exception : std::ios_base::failure
{ {
SqlException(const QString &message, qsizetype errorCode = 0) : Exception(message, errorCode) {} wallet_exception(const std::string &message, const std::string &details, const std::error_code &code) :
details(details),
std::ios_base::failure(message, code) { }
wallet_exception(const std::string &message, const std::error_code &code) :
std::ios_base::failure(message, code) { }
wallet_exception(const std::string &message, const std::string &details, const int code = errno) :
details(details),
std::ios_base::failure
(
message,
std::error_code
(
code,
std::system_category()
)
) { }
wallet_exception(const std::string &message, const int code = errno) :
std::ios_base::failure
(
message,
std::error_code
(
code,
std::system_category()
)
) { }
const std::string details;
}; };
struct KOMPLEX_EXPORT WalletException : Exception
struct KOMPLEX_EXPORT process_exception : std::runtime_error
{ {
WalletException(const QString &message, qsizetype errorCode = 0) : Exception(message, errorCode) {} process_exception(const std::string &message, const std::string &details, const std::error_code &code) :
details(details),
code(code),
std::runtime_error(message) { }
process_exception(const std::string &message, const std::error_code &code) :
code(code),
std::runtime_error(message) { }
process_exception(const std::string &message, const int code = errno) :
code
(
std::error_code
(
code,
std::system_category()
)
),
std::runtime_error
(
message
) { }
process_exception(const std::string &message, const std::string &details, const int code = errno) :
details(details),
code
(
std::error_code
(
code,
std::system_category()
)
),
std::runtime_error (message) { }
const std::string details;
const std::error_code code;
}; };
struct KOMPLEX_EXPORT ShaderCompilerException : Exception
namespace shader
{ {
ShaderCompilerException(const QString &message, qsizetype errorCode = 0) : Exception(message, errorCode) {} struct KOMPLEX_EXPORT logic_error : std::logic_error
}; {
logic_error(const std::string &message, const std::string &details, const std::error_code &code) :
details(details),
code(code),
std::logic_error(message) { }
logic_error(const std::string &message, const std::error_code &code) :
code(code),
std::logic_error(message) { }
logic_error(const std::string &message, const std::string &details = {}, const int code = errno) :
code
(
std::error_code
(
code,
std::system_category()
)
),
std::logic_error(message) { }
const std::string details;
const std::error_code code;
};
}
#endif // EXCEPTIONS_H #endif // EXCEPTIONS_H
+18 -4
View File
@@ -1,5 +1,6 @@
#include "qwallet.h" #include "qwallet.h"
#include "../3rdparty/qtkeychain/qtkeychain/keychain.h" #include "../3rdparty/qtkeychain/qtkeychain/keychain.h"
#include "common/exceptions.h"
auto QWallet::read(const QString &service, const QString &key) const -> QFuture<QByteArray> auto QWallet::read(const QString &service, const QString &key) const -> QFuture<QByteArray>
{ {
@@ -29,7 +30,11 @@ auto QWallet::read(const QString &service, const QString &key) const -> QFuture<
else else
{ {
m_errorString = qPrintable(j->errorString()); m_errorString = qPrintable(j->errorString());
throw std::exception(); throw wallet_exception
(
QStringLiteral("Wallet read error").toStdString(),
errorString().toStdString()
);
} }
loop.quit(); loop.quit();
@@ -65,11 +70,15 @@ auto QWallet::write(const QString &service, const QString &key, const QByteArray
this, this,
[this, key, &loop, &success](QKeychain::Job *job) [this, key, &loop, &success](QKeychain::Job *job)
{ {
auto j = static_cast<QKeychain::ReadPasswordJob*>(job); auto j = static_cast<QKeychain::WritePasswordJob*>(job);
if (j->error() != QKeychain::NoError) if (j->error() != QKeychain::NoError)
{ {
setErrorString(qPrintable(j->errorString())); setErrorString(qPrintable(j->errorString()));
throw std::exception(); throw wallet_exception
(
QStringLiteral("Wallet write error").toStdString(),
errorString().toStdString()
);
} }
loop.quit(); loop.quit();
@@ -102,7 +111,7 @@ auto QWallet::remove(const QString &service, const QString &key) -> QFuture<void
this, this,
[this, key, &loop, &value](QKeychain::Job *job) [this, key, &loop, &value](QKeychain::Job *job)
{ {
auto j = static_cast<QKeychain::ReadPasswordJob*>(job); auto j = static_cast<QKeychain::DeletePasswordJob*>(job);
if (j->error() != QKeychain::NoError) if (j->error() != QKeychain::NoError)
{ {
m_errorString = qPrintable(j->errorString()); m_errorString = qPrintable(j->errorString());
@@ -133,3 +142,8 @@ auto QWallet::errorString() const -> const QString &
{ {
return m_errorString; return m_errorString;
} }
auto QWallet::setErrorString(const QString &errorString) const -> void
{
m_errorString = errorString;
}
@@ -337,14 +337,17 @@ private:
return false; return false;
} }
qsizetype windowSize = this->windowSize(); qsizetype prefetchThreshold = SLIDING_CACHE_PREFETCH_THRESHOLD;
if(windowSize == 0) if(prefetchThreshold >= windowSize())
{ {
windowSize = SLIDING_CACHE_WINDOW_SIZE; prefetchThreshold = std::floor
(
static_cast<qreal>(windowSize()) * 0.8
);
} }
while (index >= m_windowOffset + (SLIDING_CACHE_WINDOW_SIZE - SLIDING_CACHE_PREFETCH_THRESHOLD)) while (index >= m_windowOffset + (windowSize() - prefetchThreshold))
{ {
if(!slideForward()) if(!slideForward())
{ {
@@ -414,7 +417,7 @@ private:
m_windowOffset = 0; m_windowOffset = 0;
} }
QThread::sleep(KOMPLEX_RATE_LIMIT); // QThread::sleep(KOMPLEX_RATE_LIMIT);
FetchResult<T> result = m_fetch( FetchResult<T> result = m_fetch(
m_windowOffset, m_windowOffset,
@@ -497,7 +500,7 @@ private:
false false
); );
QThread::sleep(KOMPLEX_RATE_LIMIT); // QThread::sleep(KOMPLEX_RATE_LIMIT);
m_windowOffset -= movementSize; m_windowOffset -= movementSize;
+1 -1
View File
@@ -83,7 +83,7 @@ private:
QString m_errorString; QString m_errorString;
inline static UserCredentials s_userCredentials; inline static UserCredentials s_userCredentials;
inline const static char PART_SEPARATOR = static_cast<char>('\0x1f'); inline const static char PART_SEPARATOR = static_cast<char>('\x1f');
Q_PROPERTY(UserCredentials userCredentials READ userCredentials NOTIFY userCredentialsChanged FINAL) Q_PROPERTY(UserCredentials userCredentials READ userCredentials NOTIFY userCredentialsChanged FINAL)
Q_PROPERTY(QString errorString READ errorString WRITE setErrorString NOTIFY errorStringChanged FINAL) Q_PROPERTY(QString errorString READ errorString WRITE setErrorString NOTIFY errorStringChanged FINAL)
File diff suppressed because it is too large Load Diff
+21 -8
View File
@@ -68,13 +68,13 @@ public:
* out of it * out of it
* @param url * @param url
*/ */
auto downloadImage Q_INVOKABLE auto downloadImage
( (
const QString &author, const QString &author,
const QString &authorId, const QString &authorId,
const QString &description, const QString &description,
const QUrl &url const QUrl &url
) noexcept(false) -> void; ) -> void;
/** /**
* @brief downloadVideo * @brief downloadVideo
@@ -85,13 +85,12 @@ public:
* @param description * @param description
* @param url * @param url
*/ */
auto downloadVideo Q_INVOKABLE auto downloadVideo
( (
const QString &author, const QString &author,
const QString &authorId, const QString &authorId,
const QString &description,
const QUrl &url const QUrl &url
) noexcept(false) -> void; ) -> void;
/** /**
* @brief downloadPack * @brief downloadPack
@@ -100,13 +99,13 @@ public:
* @param id * @param id
* @return File info of the installed pack * @return File info of the installed pack
*/ */
auto downloadPack(const QString &id) noexcept(false) -> void; Q_INVOKABLE auto downloadPack(const QString &id) -> void;
auto compilerOutput() const -> const QString & { return m_compilerOutput; } auto compilerOutput() const -> const QString & { return m_compilerOutput; }
auto errorTitle() const -> const QString & { return m_errorTitle; } auto errorTitle() const -> const QString & { return m_errorTitle; }
auto errorMessage() const -> const QString & { return m_errorMessage; } auto errorMessage() const -> const QString & { return m_errorMessage; }
auto state() const -> State { return m_state; } auto state() const -> State { return m_state; }
auto reset() -> void; Q_INVOKABLE auto reset() -> void;
auto downloadProgress() -> qreal { return m_downloadProgress; } auto downloadProgress() -> qreal { return m_downloadProgress; }
auto compileProgress() -> qreal; auto compileProgress() -> qreal;
auto compileSteps() -> qint64; auto compileSteps() -> qint64;
@@ -118,6 +117,9 @@ public:
auto downloadedBytes() const -> qint64 { return m_downloadedBytes; } auto downloadedBytes() const -> qint64 { return m_downloadedBytes; }
auto setDownloadedBytes(qint64 downloadedBytes) -> void; auto setDownloadedBytes(qint64 downloadedBytes) -> void;
auto lastInstalledFile() const -> const QString &;
auto setLastInstalledFile(const QString &lastInstalledFile) -> void;
protected: protected:
auto setError(const QString &title, const QString &message) -> void; auto setError(const QString &title, const QString &message) -> void;
auto setCompilerOutput(const QString &compilerOutput) -> void; auto setCompilerOutput(const QString &compilerOutput) -> void;
@@ -136,11 +138,16 @@ signals:
auto compileStepsChanged() -> void; auto compileStepsChanged() -> void;
auto compileStepsCompletedChanged() -> void; auto compileStepsCompletedChanged() -> void;
auto lastInstalledFileChanged() -> void;
private: private:
auto compile(const QUrl &uri) noexcept(false) -> QUrl; auto compile(const QUrl &uri) noexcept(false) -> QUrl;
auto install(const QUrl &uri) noexcept(false) -> QUrl; auto install(const QUrl &uri) noexcept(false) -> QUrl;
auto download(const QNetworkRequest &request, const QString &id, RequestType type = Get) -> QFuture<QUrl>; auto download(const QNetworkRequest &request, const QString &id, RequestType type = Get, const QString &filename = QString()) -> QFuture<QUrl>;
auto readShaderToyEntry(const QUrl &uri) noexcept(false) -> ShaderToyEntry; auto readShaderToyEntry(const QUrl &uri) noexcept(false) -> ShaderToyEntry;
auto validateUri(const QUrl &uri) noexcept(false) -> void;
QString m_lastInstalledFile;
QString m_compilerOutput; QString m_compilerOutput;
QString m_errorTitle; QString m_errorTitle;
@@ -153,9 +160,14 @@ private:
State m_state; State m_state;
QMutex m_downloadMutex; QMutex m_downloadMutex;
QMutex m_fileMutex;
PackCompiler *m_compiler = nullptr; PackCompiler *m_compiler = nullptr;
QProcess m_moveProcess;
QFuture<QUrl> m_downloadFuture;
Q_PROPERTY(QString compilerOutput READ compilerOutput WRITE setCompilerOutput NOTIFY compilerOutputChanged FINAL) Q_PROPERTY(QString compilerOutput READ compilerOutput WRITE setCompilerOutput NOTIFY compilerOutputChanged FINAL)
Q_PROPERTY(QString errorTitle READ errorTitle NOTIFY errorChanged FINAL) Q_PROPERTY(QString errorTitle READ errorTitle NOTIFY errorChanged FINAL)
Q_PROPERTY(QString errorMessage READ errorMessage NOTIFY errorChanged FINAL) Q_PROPERTY(QString errorMessage READ errorMessage NOTIFY errorChanged FINAL)
@@ -166,6 +178,7 @@ private:
Q_PROPERTY(qint64 downloadedBytes READ downloadedBytes WRITE setDownloadedBytes NOTIFY downloadedBytesChanged FINAL) Q_PROPERTY(qint64 downloadedBytes READ downloadedBytes WRITE setDownloadedBytes NOTIFY downloadedBytesChanged FINAL)
Q_PROPERTY(qint64 compileSteps READ compileSteps NOTIFY compileStepsChanged FINAL) Q_PROPERTY(qint64 compileSteps READ compileSteps NOTIFY compileStepsChanged FINAL)
Q_PROPERTY(qint64 compileStepsCompleted READ compileStepsCompleted NOTIFY compileStepsCompletedChanged FINAL) Q_PROPERTY(qint64 compileStepsCompleted READ compileStepsCompleted NOTIFY compileStepsCompletedChanged FINAL)
Q_PROPERTY(QString lastInstalledFile READ lastInstalledFile WRITE setLastInstalledFile NOTIFY lastInstalledFileChanged FINAL)
}; };
Q_DECLARE_METATYPE(DownloadManager) Q_DECLARE_METATYPE(DownloadManager)
+46 -13
View File
@@ -5,49 +5,56 @@ FeaturedImagesModel::FeaturedImagesModel(QObject *parent) : QAbstractListModel{p
m_paginator = new FeaturedImagesPaginator(this); m_paginator = new FeaturedImagesPaginator(this);
PaginationNotifier *notifier = static_cast<PaginationNotifier*>(m_paginator); PaginationNotifier *notifier = static_cast<PaginationNotifier*>(m_paginator);
QObject::connect( QObject::connect
(
notifier, notifier,
&PaginationNotifier::resultsPerPageChanged, &PaginationNotifier::resultsPerPageChanged,
this, this,
&FeaturedImagesModel::resultsPerPageChanged &FeaturedImagesModel::resultsPerPageChanged
); );
QObject::connect( QObject::connect
(
notifier, notifier,
&PaginationNotifier::totalResultsChanged, &PaginationNotifier::totalResultsChanged,
this, this,
&FeaturedImagesModel::totalResultsChanged &FeaturedImagesModel::totalResultsChanged
); );
QObject::connect( QObject::connect
(
notifier, notifier,
&PaginationNotifier::totalPagesChanged, &PaginationNotifier::totalPagesChanged,
this, this,
&FeaturedImagesModel::totalPagesChanged &FeaturedImagesModel::totalPagesChanged
); );
QObject::connect( QObject::connect
(
notifier, notifier,
&PaginationNotifier::pageChanged, &PaginationNotifier::pageChanged,
this, this,
&FeaturedImagesModel::pageChanged &FeaturedImagesModel::pageChanged
); );
QObject::connect( QObject::connect
(
notifier, notifier,
&PaginationNotifier::pageChanged, &PaginationNotifier::pageChanged,
this, this,
&FeaturedImagesModel::resetDataModel &FeaturedImagesModel::resetDataModel
); );
QObject::connect( QObject::connect
(
notifier, notifier,
&PaginationNotifier::fetchComplete, &PaginationNotifier::fetchComplete,
this, this,
&FeaturedImagesModel::resetState &FeaturedImagesModel::resetState
); );
QObject::connect( QObject::connect
(
notifier, notifier,
&PaginationNotifier::fetching, &PaginationNotifier::fetching,
this, this,
@@ -172,13 +179,19 @@ auto FeaturedImagesModel::state() const -> FeaturedImagesModel::State
auto FeaturedImagesModel::setState(State state) -> void auto FeaturedImagesModel::setState(State state) -> void
{ {
if (m_state == state) QFuture<void> aether = QtConcurrent::run
{ (
return; [this, state]
} {
if (m_state == state)
{
return;
}
m_state = state; m_state = state;
emit stateChanged(); emit stateChanged();
}
);
} }
auto FeaturedImagesModel::resetState() -> void auto FeaturedImagesModel::resetState() -> void
@@ -343,3 +356,23 @@ auto FeaturedImagesModel::totalPages() const -> qsizetype
return 0; return 0;
} }
auto FeaturedImagesModel::hasNextPage() const -> bool
{
if(m_paginator == nullptr)
{
return false;
}
return m_paginator->page() < m_paginator->totalPages();
}
auto FeaturedImagesModel::hasPreviousPage() const -> bool
{
if(m_paginator == nullptr)
{
return false;
}
return m_paginator->page() > 0;
}
+16
View File
@@ -213,6 +213,20 @@ public:
*/ */
Q_INVOKABLE auto previousPage() -> void; Q_INVOKABLE auto previousPage() -> void;
/**
* @brief hasNextPage
* Calculates if there are more pages based on the current page calculation
* @return
*/
auto hasNextPage() const -> bool;
/**
* @brief hasPreviousPage
* If page is greater than 1, returns true
* @return
*/
auto hasPreviousPage() const -> bool;
protected: protected:
/** /**
* @brief setErrorString * @brief setErrorString
@@ -343,6 +357,8 @@ private:
Q_PROPERTY(qsizetype resultsPerPage READ resultsPerPage WRITE setResultsPerPage NOTIFY resultsPerPageChanged FINAL) Q_PROPERTY(qsizetype resultsPerPage READ resultsPerPage WRITE setResultsPerPage NOTIFY resultsPerPageChanged FINAL)
Q_PROPERTY(qsizetype totalResults READ totalResults NOTIFY totalResultsChanged FINAL) Q_PROPERTY(qsizetype totalResults READ totalResults NOTIFY totalResultsChanged FINAL)
Q_PROPERTY(qsizetype totalPages READ totalPages NOTIFY totalPagesChanged FINAL) Q_PROPERTY(qsizetype totalPages READ totalPages NOTIFY totalPagesChanged FINAL)
Q_PROPERTY(bool hasNextPage READ hasNextPage NOTIFY pageChanged FINAL)
Q_PROPERTY(bool hasPreviousPage READ hasPreviousPage NOTIFY pageChanged FINAL)
Q_PROPERTY(qsizetype page READ page NOTIFY pageChanged FINAL) Q_PROPERTY(qsizetype page READ page NOTIFY pageChanged FINAL)
}; };
Q_DECLARE_METATYPE(FeaturedImagesModel) Q_DECLARE_METATYPE(FeaturedImagesModel)
+20
View File
@@ -311,6 +311,26 @@ auto FeaturedPacksModel::previousPage() -> void
} }
} }
auto FeaturedPacksModel::hasNextPage() const -> bool
{
if(m_paginator == nullptr)
{
return false;
}
return m_paginator->page() < m_paginator->totalPages();
}
auto FeaturedPacksModel::hasPreviousPage() const -> bool
{
if(m_paginator == nullptr)
{
return false;
}
return m_paginator->page() > 0;
}
qsizetype FeaturedPacksModel::page() const qsizetype FeaturedPacksModel::page() const
{ {
if(m_paginator != nullptr) if(m_paginator != nullptr)
+16
View File
@@ -208,6 +208,20 @@ public:
*/ */
Q_INVOKABLE auto previousPage() -> void; Q_INVOKABLE auto previousPage() -> void;
/**
* @brief hasNextPage
* Calculates if there are more pages based on the current page calculation
* @return
*/
auto hasNextPage() const -> bool;
/**
* @brief hasPreviousPage
* If page is greater than 1, returns true
* @return
*/
auto hasPreviousPage() const -> bool;
protected: protected:
/** /**
* @brief setErrorString * @brief setErrorString
@@ -310,6 +324,8 @@ private:
Q_PROPERTY(qsizetype resultsPerPage READ resultsPerPage WRITE setResultsPerPage NOTIFY resultsPerPageChanged FINAL) Q_PROPERTY(qsizetype resultsPerPage READ resultsPerPage WRITE setResultsPerPage NOTIFY resultsPerPageChanged FINAL)
Q_PROPERTY(qsizetype totalResults READ totalResults NOTIFY totalResultsChanged FINAL) Q_PROPERTY(qsizetype totalResults READ totalResults NOTIFY totalResultsChanged FINAL)
Q_PROPERTY(qsizetype totalPages READ totalPages NOTIFY totalPagesChanged FINAL) Q_PROPERTY(qsizetype totalPages READ totalPages NOTIFY totalPagesChanged FINAL)
Q_PROPERTY(bool hasNextPage READ hasNextPage NOTIFY pageChanged FINAL)
Q_PROPERTY(bool hasPreviousPage READ hasPreviousPage NOTIFY pageChanged FINAL)
Q_PROPERTY(qsizetype page READ page NOTIFY pageChanged FINAL) Q_PROPERTY(qsizetype page READ page NOTIFY pageChanged FINAL)
}; };
Q_DECLARE_METATYPE(FeaturedPacksModel) Q_DECLARE_METATYPE(FeaturedPacksModel)
+32 -6
View File
@@ -160,13 +160,19 @@ auto FeaturedVideosModel::state() const -> FeaturedVideosModel::State
auto FeaturedVideosModel::setState(State state) -> void auto FeaturedVideosModel::setState(State state) -> void
{ {
if (m_state == state) QFuture<void> aether = QtConcurrent::run
{ (
return; [this, state]
} {
if (m_state == state)
{
return;
}
m_state = state; m_state = state;
emit stateChanged(); emit stateChanged();
}
);
} }
auto FeaturedVideosModel::resetState() -> void auto FeaturedVideosModel::resetState() -> void
@@ -365,3 +371,23 @@ auto FeaturedVideosModel::totalPages() const -> qsizetype
return 0; return 0;
} }
auto FeaturedVideosModel::hasNextPage() const -> bool
{
if(m_paginator == nullptr)
{
return false;
}
return m_paginator->page() < m_paginator->totalPages();
}
auto FeaturedVideosModel::hasPreviousPage() const -> bool
{
if(m_paginator == nullptr)
{
return false;
}
return m_paginator->page() > 0;
}
+16
View File
@@ -231,6 +231,20 @@ public:
*/ */
auto setWindowSize(qsizetype size) -> void; auto setWindowSize(qsizetype size) -> void;
/**
* @brief hasNextPage
* Calculates if there are more pages based on the current page calculation
* @return
*/
auto hasNextPage() const -> bool;
/**
* @brief hasPreviousPage
* If page is greater than 1, returns true
* @return
*/
auto hasPreviousPage() const -> bool;
protected: protected:
/** /**
* @brief setErrorString * @brief setErrorString
@@ -327,6 +341,8 @@ private:
Q_PROPERTY(qsizetype totalResults READ totalResults NOTIFY totalResultsChanged FINAL) Q_PROPERTY(qsizetype totalResults READ totalResults NOTIFY totalResultsChanged FINAL)
Q_PROPERTY(qsizetype totalPages READ totalPages NOTIFY totalPagesChanged FINAL) Q_PROPERTY(qsizetype totalPages READ totalPages NOTIFY totalPagesChanged FINAL)
Q_PROPERTY(qsizetype page READ page NOTIFY pageChanged FINAL) Q_PROPERTY(qsizetype page READ page NOTIFY pageChanged FINAL)
Q_PROPERTY(bool hasNextPage READ hasNextPage NOTIFY pageChanged FINAL)
Q_PROPERTY(bool hasPreviousPage READ hasPreviousPage NOTIFY pageChanged FINAL)
Q_PROPERTY(VideoItemModel *itemModel READ itemModel CONSTANT FINAL) Q_PROPERTY(VideoItemModel *itemModel READ itemModel CONSTANT FINAL)
Q_PROPERTY(qsizetype windowSize READ windowSize WRITE setWindowSize NOTIFY windowSizeChanged FINAL) Q_PROPERTY(qsizetype windowSize READ windowSize WRITE setWindowSize NOTIFY windowSizeChanged FINAL)
}; };
+36 -9
View File
@@ -159,13 +159,19 @@ auto NewestPacksModel::state() const -> NewestPacksModel::State
auto NewestPacksModel::setState(State state) -> void auto NewestPacksModel::setState(State state) -> void
{ {
if (m_state == state) QFuture<void> aether = QtConcurrent::run
{ (
return; [this, state]
} {
if (m_state == state)
{
return;
}
m_state = state; m_state = state;
emit stateChanged(); emit stateChanged();
}
);
} }
auto NewestPacksModel::resetState() -> void auto NewestPacksModel::resetState() -> void
@@ -224,7 +230,7 @@ auto NewestPacksModel::setResultsPerPage(qsizetype resultsPerPage) -> void
{ {
if(m_paginator != nullptr) if(m_paginator != nullptr)
{ {
QFuture<void> future = QtConcurrent::run QFuture<void> aether = QtConcurrent::run
( (
[this, resultsPerPage] [this, resultsPerPage]
{ {
@@ -277,7 +283,7 @@ auto NewestPacksModel::nextPage() const -> void
{ {
if(m_paginator != nullptr) if(m_paginator != nullptr)
{ {
QFuture<void> future = QtConcurrent::run QFuture<void> aether = QtConcurrent::run
( (
[this] [this]
{ {
@@ -291,7 +297,7 @@ auto NewestPacksModel::previousPage() const -> void
{ {
if(m_paginator != nullptr) if(m_paginator != nullptr)
{ {
QFuture<void> future = QtConcurrent::run QFuture<void> aether = QtConcurrent::run
( (
[this] [this]
{ {
@@ -320,3 +326,24 @@ auto NewestPacksModel::totalPages() const -> qsizetype
return 0; return 0;
} }
auto NewestPacksModel::hasNextPage() const -> bool
{
if(m_paginator == nullptr)
{
return false;
}
return m_paginator->page() < m_paginator->totalPages();
}
auto NewestPacksModel::hasPreviousPage() const -> bool
{
if(m_paginator == nullptr)
{
return false;
}
return m_paginator->page() > 0;
}
+16
View File
@@ -215,6 +215,20 @@ public:
*/ */
Q_INVOKABLE auto previousPage() const -> void; Q_INVOKABLE auto previousPage() const -> void;
/**
* @brief hasNextPage
* Calculates if there are more pages based on the current page calculation
* @return
*/
auto hasNextPage() const -> bool;
/**
* @brief hasPreviousPage
* If page is greater than 1, returns true
* @return
*/
auto hasPreviousPage() const -> bool;
protected: protected:
/** /**
* @brief setErrorString * @brief setErrorString
@@ -321,6 +335,8 @@ private:
Q_PROPERTY(qsizetype totalResults READ totalResults NOTIFY totalResultsChanged FINAL) Q_PROPERTY(qsizetype totalResults READ totalResults NOTIFY totalResultsChanged FINAL)
Q_PROPERTY(qsizetype totalPages READ totalPages NOTIFY totalPagesChanged FINAL) Q_PROPERTY(qsizetype totalPages READ totalPages NOTIFY totalPagesChanged FINAL)
Q_PROPERTY(qsizetype page READ page NOTIFY pageChanged FINAL) Q_PROPERTY(qsizetype page READ page NOTIFY pageChanged FINAL)
Q_PROPERTY(bool hasNextPage READ hasNextPage NOTIFY pageChanged FINAL)
Q_PROPERTY(bool hasPreviousPage READ hasPreviousPage NOTIFY pageChanged FINAL)
}; };
Q_DECLARE_METATYPE(NewestPacksModel) Q_DECLARE_METATYPE(NewestPacksModel)
File diff suppressed because it is too large Load Diff
+239 -113
View File
@@ -36,6 +36,8 @@
#include <qobject.h> #include <qobject.h>
#include <qtmetamacros.h> #include <qtmetamacros.h>
#include <QPainter> #include <QPainter>
#include <QtShaderTools>
#include <QtShaderTools/rhi/qshaderbaker.h>
#include <QtConcurrent/qtconcurrentrun.h> #include <QtConcurrent/qtconcurrentrun.h>
#include <qcontainerfwd.h> #include <qcontainerfwd.h>
#include <qmargins.h> #include <qmargins.h>
@@ -43,21 +45,42 @@
#include <qtmetamacros.h> #include <qtmetamacros.h>
#include <qurl.h> #include <qurl.h>
#include "common/komplex_global.h" #include "common/komplex_global.h"
#if __has_include("vulkan/vulkan_core.h")
#define HAS_VULKAN
#include <vulkan/vulkan_core.h>
#endif
#if __has_include("GL/gl.h")
#define HAS_OPENGL
#include <GL/gl.h>
#endif
struct KOMPLEX_EXPORT BuildContext
{
QMap<QByteArray, QByteArray> commonData;
QPromise<QUrl> promise;
};
/** /**
* @brief The PackCompiler class * @brief The PackCompiler class
* [1] Extract Pack (GZip) * [1] Extract Pack (GZip)
* [2] Verify directory is a pack and has shaders * [2] Verify directory is a pack and has shaders
* [3] Load shader code * [3] Load Common shader code
* [4] Append Common and Global files, if they exist * [4] Walk the shader directory
* [5] Add uniform and replace variable use * [5] Load shader code
* [6] Run C Preprocessor (cpp -P) to process macros * [6] Append type specific common code and global code
* [7] Append version macro * [7] Replace uniform variable use
* [8] Compile with Qt Shader Baker * [8] Add uniform header
* [9] Add uniform footer
* [10] Run preprocessor to process macros
* [11] Append version macro
* [12] Compile with QShaderBaker
* [13] Save
*/ */
class KOMPLEX_EXPORT PackCompiler : public QObject class PackCompiler : public QObject
{ {
Q_OBJECT Q_OBJECT
QML_ELEMENT
public: public:
enum State enum State
@@ -70,7 +93,6 @@ public:
Q_ENUM(State) Q_ENUM(State)
explicit PackCompiler(QObject *parent = nullptr); explicit PackCompiler(QObject *parent = nullptr);
~PackCompiler() override;
auto compilerOutput() const -> const QString & { return m_compilerOutput; } auto compilerOutput() const -> const QString & { return m_compilerOutput; }
auto progress() -> qreal { return m_progress; } auto progress() -> qreal { return m_progress; }
@@ -78,62 +100,11 @@ public:
auto totalSteps() -> qint64 { return m_totalSteps; } auto totalSteps() -> qint64 { return m_totalSteps; }
auto errorTitle() const -> const QString & { return m_errorTitle; } auto errorTitle() const -> const QString & { return m_errorTitle; }
auto errorMessage() const -> const QString & { return m_errorMessage; } auto errorMessage() const -> const QString & { return m_errorMessage; }
auto reset() -> void;
auto process(const QUrl &uri) -> QFuture<QUrl>;
auto status() const -> const QString & { return m_status; } auto status() const -> const QString & { return m_status; }
auto state() const -> State { return m_state; } auto state() const -> State { return m_state; }
auto reset() -> void;
protected: auto build(const QUrl &uri) -> QUrl;
/**
* @brief prepareShaders
* Scans the pack's shader directory and sends each file to
* prepareFile()
* @param uri
* Directory to prepare
*/
auto prepareShaders(const QUrl &uri) noexcept(false) -> void;
/**
* @brief prepareFile
* Prepares the individual file by appending the header, footer,
* common files and replacing standard variable names
* @param uri
*/
auto prepareFile(const QUrl &uri) noexcept(false) -> void;
/**
* @brief validateDirectory
*
* @param uri
* @return true
* @return false
*/
auto validateDirectory(const QUrl &uri) -> bool;
auto extract(const QUrl &sourceUri, const QUrl &destinationUri) noexcept(false) -> void;
auto copyFile(const QUrl &sourceUri, const QUrl &destinationUri) noexcept(false) -> void;
auto compile(const QUrl &uri) noexcept(false) -> void;
auto preprocess(const QUrl &uri) noexcept(false) -> void;
auto appendVersion(const QUrl &uri) noexcept(false) -> void;
auto compileShader(const QUrl &uri) noexcept(false) -> void;
auto loadCommonFragmentData(const QUrl &uri) -> QByteArray;
auto loadCommonVertexData(const QUrl &uri) -> QByteArray;
auto loadGlobalData(const QUrl &uri) -> QByteArray;
auto setError(const QString &title, const QString &message, const QUrl &uri = {}) -> void;
auto setCompilerOutput(const QString &compilerOutput) -> void;
auto setState(State state) -> void;
auto setProgress(qreal progress) -> void;
auto setTotalSteps(qint64 steps) -> void;
auto setCurrentStep(qint64 step) -> void;
auto setStatus(const QString &status) -> void;
auto incrementCompileStep() -> void;
auto removeDirectory(const QUrl &uri) -> bool;
signals: signals:
auto compilerOutputChanged() -> void; auto compilerOutputChanged() -> void;
@@ -144,38 +115,213 @@ signals:
auto progressChanged() -> void; auto progressChanged() -> void;
auto currentStepChanged() -> void; auto currentStepChanged() -> void;
auto totalStepsChanged() -> void; auto totalStepsChanged() -> void;
auto compileComplete(const QUrl &uri) -> void; auto compileComplete(const QUrl &uri) -> void;
auto statusChanged() -> void; auto statusChanged() -> void;
auto packReady(const QString &) -> void; auto packReady(const QString &) -> void;
auto errorStepChanged() -> void; auto errorStepChanged() -> void;
auto errorRatingChanged() -> void; auto errorRatingChanged() -> void;
private: private:
//[1]
/**
* @brief extract
* Extracts the packfile and deletes the source
* @param uri of the tar.gz pack
* @return uri of the extracted directory
*/
auto extract(const QUrl &uri) noexcept(false) -> const QUrl;
//[2]
/**
* @brief validatePack
* Validates that the directory is a valid pack and has shaders to compile
* @param uri of the directory provided by extract
*/
auto validatePack(const QUrl &uri) const noexcept(false) -> void;
//[3]
/**
* @brief loadCommonData
* Loads the common and global shader code from the shader directory of the uri
* @param uri
*/
auto loadCommonData(const QUrl &uri) -> QMap<QByteArray,QByteArray>;
//[4-5]
/**
* @brief processShaders
* Walks the shader directory, loads the code and calls 6-13 for each
* @param uri
* @param context
*/
auto processShaders(const QUrl &uri, BuildContext *context) -> void;
//[6]
/**
* @brief appendCommonData
* Appends the type specific common code to the shader data
* @param data
* Pointer to shader data
* @param suffix
* Shader file suffix
* @param context
* Pointer to build context object
*/
auto appendCommonData(QByteArray *data, const QByteArray &suffix, BuildContext *context) noexcept(true) -> void;
//[7]
/**
* @brief replaceUniformVariables
* Replaces standard variables such as iFrame with their uniform buffer name
* @param data
* Pointer to the shader data
*/
auto replaceUniformVariables(QByteArray *data) noexcept(true) -> void;
//[8]
/**
* @brief appendUniformHeader
* Adds header and uniform buffer to the shader data
* @param data
* Pointer to the shader data
*/
auto appendUniformHeader(QByteArray *data) noexcept(true) -> void;
//[9]
/**
* @brief appendUniformFooter
* Adds the uniform footer to the shader data
* @param data
* Pointer to the shader data
*/
auto appendUniformFooter(QByteArray *data) noexcept(true) -> void;
//[10]
/**
* @brief preprocess
* I have had issues with defines in code so passing it to a c/c++
* preprocessor is required. I am now using clang for this as clang
* is more modern and can use stdin
* @param data
*/
auto preprocess(QByteArray *data) noexcept(false) -> void;
//[11]
/**
* @brief appendVersion
* The version header confuses the preprocessor, so add it at the end
* @param data
*/
auto appendVersion(QByteArray *data) noexcept(true) -> void;
//[12]
/**
* @brief compile
* Compiles the shader data in memory and returns the shader object.
* @param data
* Shader data
* @param filename
* Filename of the shader
* @param stage
* Type of shader, based on suffix of original file
* @return
* Compiled shader object
*/
auto compile(const QByteArray &data, const QString &filename, const QShader::Stage stage) noexcept(false) -> QShader;
//[13]
auto save(const QUrl &uri, const QShader &shader) noexcept(false) -> void;
//helpers
auto validateUri(const QUrl &uri) const noexcept(false) -> void;
auto run(const QString &command, const QStringList &arguments, const QByteArray &data = {}) noexcept(false) -> QByteArray;
auto readFile(const QUrl &uri) noexcept(false) -> QByteArray;
auto writeFile(const QUrl &uri, const QByteArray &data) noexcept(false) -> void;
auto copyFile(const QUrl &sourceUri, const QUrl &destinationUri) noexcept(false) -> void;
auto createDirectory(const QUrl &uri) noexcept(false) -> void;
auto removeDirectory(const QUrl &uri) noexcept(false) -> void;
auto getStageFromSuffix(const QString &suffix) const -> QShader::Stage;
auto setError(const QString &title, const QString &message, const QUrl &uri = {}) -> void;
auto setCompilerOutput(const QString &compilerOutput) -> void;
auto setState(State state) -> void;
auto setProgress(qreal progress) -> void;
auto setTotalSteps(qint64 steps) -> void;
auto setCurrentStep(qint64 step) -> void;
auto setStatus(const QString &status) -> void;
auto incrementCompileStep() -> void;
#ifdef HAS_VULKAN
auto vulkanVersion() const -> qint32;
#endif
#ifdef HAS_OPENGL
auto openGlVersion() const -> qint32;
#endif
//members
static inline const QStringList m_updateVariables static inline const QStringList m_updateVariables
{
QStringLiteral("iTime"),
QStringLiteral("iTimeDelta"),
QStringLiteral("iFrameRate"),
QStringLiteral("iSampleRate"),
QStringLiteral("iFrame"),
QStringLiteral("iDate"),
QStringLiteral("iMouse"),
QStringLiteral("iResolution"),
QStringLiteral("iColorTheme"),
QStringLiteral("iChannelTime"),
QStringLiteral("iChannelResolution")
};
static inline const QStringList m_shaderNameFilters
{
QStringLiteral("*.frag"),
QStringLiteral("*.vert"),
QStringLiteral("*.tese"),
QStringLiteral("*.tesc"),
QStringLiteral("*.geom"),
QStringLiteral("*.comp"),
QStringLiteral("*.glsl")
};
static inline const QMap<QString, QShader::Stage> m_shaderStages
{
{ {
QStringLiteral("iTime"), QStringLiteral("frag"),
QStringLiteral("iTimeDelta"), QShader::FragmentStage
QStringLiteral("iFrameRate"), },
QStringLiteral("iSampleRate"), {
QStringLiteral("iFrame"), QStringLiteral("vert"),
QStringLiteral("iDate"), QShader::VertexStage
QStringLiteral("iMouse"), },
QStringLiteral("iResolution"), {
QStringLiteral("iColorTheme"), QStringLiteral("tese"),
QStringLiteral("iChannelTime"), QShader::TessellationEvaluationStage
QStringLiteral("iChannelResolution") },
}; {
QStringLiteral("tesc"),
QShader::TessellationControlStage
},
{
QStringLiteral("geom"),
QShader::GeometryStage
},
{
QStringLiteral("comp"),
QShader::ComputeStage
}
};
static inline const QByteArray m_version static inline const QByteArray m_version
{ {
R"(#version 450)" R"(#version 450)"
}; };
static inline const QString m_header static inline const QByteArray m_header
{ {
R"(layout(location = 0) in vec2 qt_TexCoord0; R"(layout(location = 0) in vec2 qt_TexCoord0;
layout(location = 0) out vec4 fragColor; layout(location = 0) out vec4 fragColor;
layout(std140, binding = 0) uniform buf { layout(std140, binding = 0) uniform buf {
@@ -200,16 +346,20 @@ layout(binding = 3) uniform sampler2D iChannel2;
layout(binding = 4) uniform sampler2D iChannel3; layout(binding = 4) uniform sampler2D iChannel3;
vec2 fragCoord = vec2(qt_TexCoord0.x, 1.0 - qt_TexCoord0.y) * ubuf.iResolution.xy;)" vec2 fragCoord = vec2(qt_TexCoord0.x, 1.0 - qt_TexCoord0.y) * ubuf.iResolution.xy;)"
}; };
static inline const QString m_footer static inline const QByteArray m_footer
{ {
R"(void main() { R"(
void main() {
vec4 color = vec4(0.0); vec4 color = vec4(0.0);
mainImage(color, fragCoord); mainImage(color, fragCoord);
fragColor = color; fragColor = color;
})" })"
}; };
QMap<QByteArray, QByteArray> m_commonData;
QMap<QByteArray, QShaderBaker> m_shaders;
QString m_compilerOutput; QString m_compilerOutput;
QString m_errorMessage; QString m_errorMessage;
@@ -224,34 +374,10 @@ vec2 fragCoord = vec2(qt_TexCoord0.x, 1.0 - qt_TexCoord0.y) * ubuf.iResolution.x
QMutex m_downloadMutex; QMutex m_downloadMutex;
QFuture<QUrl> m_buildFuture;
static inline QList<QRegularExpression> m_variableExpressions; static inline QList<QRegularExpression> m_variableExpressions;
static inline const QRegularExpression m_commonFragmentExpression = QRegularExpression
(
QString("^common\\.frag$"),
QRegularExpression::CaseInsensitiveOption
);
static inline const QRegularExpression m_commonVertexExpression = QRegularExpression
(
QString("^common\\.vert$"),
QRegularExpression::CaseInsensitiveOption
);
static inline const QRegularExpression m_fragmentExpression = QRegularExpression
(
QString("^.{1,}\\.frag$"),
QRegularExpression::CaseInsensitiveOption |
QRegularExpression::DotMatchesEverythingOption
);
static inline const QRegularExpression m_vertexExpression = QRegularExpression
(
QString("^.{1,}\\.vert$"),
QRegularExpression::CaseInsensitiveOption |
QRegularExpression::DotMatchesEverythingOption
);
Q_PROPERTY(QString compilerOutput READ compilerOutput WRITE setCompilerOutput NOTIFY compilerOutputChanged FINAL) Q_PROPERTY(QString compilerOutput READ compilerOutput WRITE setCompilerOutput NOTIFY compilerOutputChanged FINAL)
Q_PROPERTY(QString errorTitle READ errorTitle NOTIFY errorTitleChanged FINAL) Q_PROPERTY(QString errorTitle READ errorTitle NOTIFY errorTitleChanged FINAL)
Q_PROPERTY(QString errorMessage READ errorMessage NOTIFY errorMessageChanged FINAL) Q_PROPERTY(QString errorMessage READ errorMessage NOTIFY errorMessageChanged FINAL)
@@ -36,11 +36,8 @@ class KOMPLEX_EXPORT FeaturedImagesPaginator : public ImagePaginator
public: public:
explicit FeaturedImagesPaginator(QObject *parent = nullptr) : ImagePaginator(parent) explicit FeaturedImagesPaginator(QObject *parent = nullptr) : ImagePaginator(parent)
{ {
setUri( setUri(KOMPLEX_ENDPOINT_IMAGES_FEATURED);
QString::fromUtf8(KOMPLEX_ENDPOINT_IMAGES_FEATURED) controller()->setWindowSize(32);
);
controller()->setWindowSize(20);
} }
}; };
@@ -36,10 +36,7 @@ class KOMPLEX_EXPORT FeaturedPacksPaginator : public WallpaperPaginator
public: public:
explicit FeaturedPacksPaginator(QObject *parent = nullptr) : WallpaperPaginator(parent) explicit FeaturedPacksPaginator(QObject *parent = nullptr) : WallpaperPaginator(parent)
{ {
setUri( setUri(KOMPLEX_ENDPOINT_PACKS_FEATURED);
QString::fromUtf8(KOMPLEX_ENDPOINT_PACKS_FEATURED)
);
controller()->setWindowSize(32); controller()->setWindowSize(32);
} }
}; };
@@ -36,11 +36,8 @@ class KOMPLEX_EXPORT FeaturedVideosPaginator : public VideoPaginator
public: public:
explicit FeaturedVideosPaginator(QObject *parent = nullptr) : VideoPaginator(parent) explicit FeaturedVideosPaginator(QObject *parent = nullptr) : VideoPaginator(parent)
{ {
setUri( setUri(KOMPLEX_ENDPOINT_VIDEOS_FEATURED);
QString::fromUtf8(KOMPLEX_ENDPOINT_VIDEOS_FEATURED) controller()->setWindowSize(32);
);
controller()->setWindowSize(20);
} }
}; };
@@ -38,10 +38,7 @@ class KOMPLEX_EXPORT ImageSearchPaginator : public ImagePaginator
public: public:
explicit ImageSearchPaginator(QObject *parent = nullptr) : ImagePaginator(parent) explicit ImageSearchPaginator(QObject *parent = nullptr) : ImagePaginator(parent)
{ {
setUri( setUri(KOMPLEX_ENDPOINT_IMAGES_SEARCH);
QString::fromUtf8(KOMPLEX_ENDPOINT_IMAGES_SEARCH)
);
setQueryable(true); setQueryable(true);
} }
}; };
@@ -36,10 +36,7 @@ class KOMPLEX_EXPORT NewestPacksPaginator : public WallpaperPaginator
public: public:
explicit NewestPacksPaginator(QObject *parent = nullptr) : WallpaperPaginator(parent) explicit NewestPacksPaginator(QObject *parent = nullptr) : WallpaperPaginator(parent)
{ {
setUri( setUri(KOMPLEX_ENDPOINT_PACKS_NEWEST);
QString::fromUtf8(KOMPLEX_ENDPOINT_PACKS_NEWEST)
);
controller()->setWindowSize(20); controller()->setWindowSize(20);
} }
}; };
@@ -36,10 +36,7 @@ class KOMPLEX_EXPORT PackSearchPaginator : public WallpaperPaginator
public: public:
explicit PackSearchPaginator(QObject *parent = nullptr) : WallpaperPaginator(parent) explicit PackSearchPaginator(QObject *parent = nullptr) : WallpaperPaginator(parent)
{ {
setUri( setUri(KOMPLEX_ENDPOINT_PACKS_SEARCH);
QString::fromUtf8(KOMPLEX_ENDPOINT_PACKS_SEARCH)
);
setQueryable(true); setQueryable(true);
} }
}; };
+2 -2
View File
@@ -303,13 +303,13 @@ public:
return m_cacheController.windowSize(); return m_cacheController.windowSize();
} }
protected:
auto queryable() const -> bool auto queryable() const -> bool
{ {
return m_queryable; return m_queryable;
} }
protected:
auto setQueryable(bool queryable) -> void auto setQueryable(bool queryable) -> void
{ {
m_queryable = queryable; m_queryable = queryable;
@@ -245,6 +245,8 @@ protected:
loop.exec(); loop.exec();
} }
manager.clear();
LOG_ERROR_X(reply->error() != QNetworkReply::NoError, LOG_ERROR_X(reply->error() != QNetworkReply::NoError,
"NewestPacksPaginator::getNetworkReply", "NewestPacksPaginator::getNetworkReply",
reply->errorString().toStdString().c_str(), reply->errorString().toStdString().c_str(),
@@ -36,10 +36,7 @@ class KOMPLEX_EXPORT VideoSearchPaginator : public VideoPaginator
public: public:
explicit VideoSearchPaginator(QObject *parent = nullptr) : VideoPaginator(parent) explicit VideoSearchPaginator(QObject *parent = nullptr) : VideoPaginator(parent)
{ {
setUri( setUri(KOMPLEX_ENDPOINT_VIDEOS_SEARCH);
QString::fromUtf8(KOMPLEX_ENDPOINT_VIDEOS_SEARCH)
);
setQueryable(true); setQueryable(true);
} }
}; };
@@ -248,6 +248,8 @@ protected:
loop.exec(); loop.exec();
} }
manager.clear();
LOG_ERROR_X(reply->error() != QNetworkReply::NoError, LOG_ERROR_X(reply->error() != QNetworkReply::NoError,
"NewestPacksPaginator::getNetworkReply", "NewestPacksPaginator::getNetworkReply",
reply->errorString().toStdString().c_str(), reply->errorString().toStdString().c_str(),
+113 -3
View File
@@ -34,7 +34,10 @@
</tr> </tr>
</table> </table>
Most of the development of Komplex and it's associated apps will now happen here, instead of Github. <small>Note: Application style is based on your system theme. It will look different than it does in the screenshots. I am using a modified KVantum Glass, Blur and Neon Sunset Wallpaper Pack.</small>
## Development
Most of the development of Komplex and applications under its project umbrella will now happen on https://git.digitalartifex.dev instead of Github.
## Installation ## Installation
@@ -51,10 +54,11 @@ Most of the development of Komplex and it's associated apps will now happen here
- Qt6 Shader Tools - Qt6 Shader Tools
- CMake - CMake
- clang - clang
- C Pre Processor (cpp)
#### Build #### Build
```console ```console
$ git clone gitea@git.digitalartifex.dev:digitalartifex/komplex-hub.git $ git clone --recursive gitea@git.digitalartifex.dev:digitalartifex/komplex-hub.git
$ mkdir build $ mkdir build
$ cmake -S ./ -B ./build/ $ cmake -S ./ -B ./build/
$ cmake --build ./build $ cmake --build ./build
@@ -74,4 +78,110 @@ Content purchases will be processed through the website using Paypal as will art
## Status ## Status
This app is currently under development and is pre-alpha. The API is now being hosted on https://komplex.dev. However, there is no download functionality as of yet. BETA should be here within a few weeks. ### Legend
| Status | Icon | Description |
|-------|:-------:|--------|
| Not started | ❌ | Either no work has been done yet or so little work that it is unusable in its current state.
| In Progress | ✔ | *Some* work has been completed, but is not yet functional and/or feature complete
| Complete | ✅ | Planned features completed
### API Status
| Feature | Status |
|-------|:-------:|
| Packs | ✔ | |
| - Download Packs | ✅ | |
| - Newest Packs | ✅ | |
| - Featured Packs | ✔ | |
| - Search Packs | ✅ | |
| - Submit Packs | ✔ | |
| - Thumbnails | ✅ | |
| | | |
| Cubemaps | ✔ | |
| - Download Cubemaps | ✅ | |
| - Newest Cubemaps | ✅ | |
| - Featured Cubemaps | ✔ | |
| - Search Cubemaps | ✅ | |
| - Submit Cubemaps | ✔ | - |
| | | |
| Filter Shaders | ✔ | |
| - Download Filter Shaders | ✅ | |
| - Newest Filter Shaders | ✅ | |
| - Featured Filter Shaders | ✔ | |
| - Search Filter Shaders | ✅ | |
| - Submit Filter Shaders | ✔ | - |
| | | |
| Images | ✅ | |
| - Featured Images | ✅ | |
| - Search Images | ✅ | |
| | | |
| Videos | ✅ | |
| - Popular Videos | ✅ | |
| - Search Videos | ✅ | |
| | | |
| Accounts | ✔ | |
| - User Accounts | ✔ | |
| - User Authentication | ✔ | |
| - User Editing | ❌ | |
| - User Configuration | ❌ | |
| - User Media | ❌ | |
| - Author Profiles | ❌ | |
### Media Hub Status
| Feature | Status |
|-------|:-------:|
| Spotlight/Homepage | ✔ | |
| - Newest Packs | ✅ | |
| - Featured Packs | ✔ | |
| - Featured Images | ✅ | |
| - Popular Videos | ✅ | |
| - View More | ✅ | |
| | | |
| Media Search | ✅ | |
| - Packs | ✅ | |
| - Videos | ✅ | |
| - Images | ✅ | |
| | | |
| Media Downloader | ✅ | |
| - Packs | ✅ | |
| - Videos | ✅ | |
| - Images | ✅ | |
| | | |
| Detailed Views | ✅ | |
| - Packs | ✅ | |
| - Videos | ✅ | |
| - Images | ✅ | |
| | | |
| App Management | ✔ | |
| Installed Media Manager | ✔ | |
| Settings Manager | ✅ | |
| | | |
| Account Management | ❌ | |
| User Accounts | ❌ | |
| - User Login | ❌ | |
| - User Profile | ❌ | |
| - Author Profile | ❌ | |
| About Page | ✅ | |
### Pack Designer
| Feature | Status |
|-------|:-------:|
| All Design & Features | ❌ | |
### Site
| Feature | Status |
|-------|:-------:|
| Site Base | ✔ | |
| Accounts | ✔ | |
| Gallery | ❌ | |
| Payment Gateway | ❌ | |
| - Artist Payout | ❌ | |
| - User Media Purchase | ❌ | |
This app is currently under development and is currently BETA1 and the new API is live. Please do expect bugs in pack compiling at this stage.
"Featured" Live wallpapers is currently a duplicated of "Newest". The featured endpoint will take manual curation, so this will take some time.
Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 MiB

After

Width:  |  Height:  |  Size: 2.0 MiB

+2 -2
View File
@@ -11,8 +11,8 @@ target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE
KomplexHubModuleplugin KomplexHubModuleplugin
KomplexHubContentplugin KomplexHubContentplugin
KomplexHubPluginplugin KomplexHubPluginplugin
KomplexHubModule_Controlsplugin KomplexHubControlsplugin
KomplexHubModule_Keroplugin KomplexHubKeroplugin
Qt6::Quick Qt6::Quick
Qt6::Core Qt6::Core
Qt6::Gui Qt6::Gui