diff --git a/AI_ASSETS b/AI_ASSETS index f39e11b..95c476c 100644 --- a/AI_ASSETS +++ b/AI_ASSETS @@ -3,77 +3,89 @@ ;Kero { - images/kero/kero_build_1.png, - placeholders, - chatgpt5 -} -{ - images/kero/kero_build_2.png, - placeholders, - chatgpt5 -} -{ - images/kero/kero_build_3.png, - placeholders, - chatgpt5 -} -{ - images/kero/kero_build_4.png, - placeholders, - chatgpt5 -} -{ - images/kero/kero_build_error.png, - placeholders, - chatgpt5 -} -{ - images/kero/kero_choice.png, - placeholders, - chatgpt5 -} -{ - images/kero/kero_hello.png, - placeholders, - chatgpt5 -} -{ - images/kero/kero_login.png, - placeholders, - chatgpt5 -} -{ - images/kero/kero_no_results.png, - placeholders, - chatgpt5 -} -{ - images/kero/kero_run_1.png, - placeholders, - chatgpt5 -} -{ - images/kero/kero_run_2.png, - placeholders, - chatgpt5 -} -{ - images/kero/kero_run_3.png, - placeholders, - chatgpt5 -} -{ - images/kero/kero_run_4.png, - placeholders, - chatgpt5 -} -{ - images/kero/kero_warning.png, - placeholders, - chatgpt5 -} -{ - images/kero/kero_success.png, - placeholders, - chatgpt5 + { + images/kero/kero_build_1.png, + placeholders, + chatgpt5 + }, + { + images/kero/kero_build_2.png, + placeholders, + chatgpt5 + }, + { + images/kero/kero_build_3.png, + placeholders, + chatgpt5 + }, + { + images/kero/kero_build_4.png, + placeholders, + chatgpt5 + }, + { + images/kero/kero_build_error.png, + placeholders, + chatgpt5 + }, + { + images/kero/kero_choice.png, + placeholders, + chatgpt5 + }, + { + images/kero/kero_hello.png, + placeholders, + chatgpt5 + }, + { + images/kero/kero_login.png, + placeholders, + chatgpt5 + }, + { + images/kero/kero_no_results.png, + placeholders, + chatgpt5 + }, + { + images/kero/kero_run_1.png, + placeholders, + chatgpt5 + }, + { + images/kero/kero_run_2.png, + placeholders, + chatgpt5 + }, + { + images/kero/kero_run_3.png, + placeholders, + chatgpt5 + }, + { + images/kero/kero_run_4.png, + placeholders, + chatgpt5 + }, + { + images/kero/kero_warning.png, + placeholders, + chatgpt5 + }, + { + images/kero/kero_success.png, + placeholders, + chatgpt5 + }, + { + images/kero/kero_spotlight.png, + placeholders, + chatgpt5 + }, + { + images/kero/kero_star.png, + placeholders, + chatgpt5 + } } \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 2b17a1e..c866e11 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -97,6 +97,8 @@ qt_add_resources(${CMAKE_PROJECT_NAME} "app_images" "images/kero/kero_run_3.png" "images/kero/kero_run_4.png" "images/kero/kero_success.png" + "images/kero/kero_spotlight.png" + "images/kero/kero_star.png" "images/kero/kero_warning.png" ) diff --git a/KomplexHubContent/pages/HomePage.qml b/KomplexHubContent/pages/HomePage.qml index 7665e36..e96618b 100644 --- a/KomplexHubContent/pages/HomePage.qml +++ b/KomplexHubContent/pages/HomePage.qml @@ -1,5 +1,5 @@ import QtQuick -import QtQuick.Controls +import QtQuick.Controls 2.0 import QtQuick.Layouts import QtQuick.Effects @@ -47,193 +47,359 @@ Item resultsPerPage: 0 } - Rectangle + ScrollView { - anchors.fill: parent - color: palette.base + id: resultsLayout + visible: opacity > 0.01 + anchors.right: parent.right + anchors.left: parent.left + anchors.top: parent.top + anchors.bottom: parent.bottom - ColumnLayout + ScrollBar.horizontal.interactive: false + ScrollBar.vertical.interactive: true + + onWidthChanged: content.width = width + + Column { - id: resultsLayout - visible: opacity > 0.01 - anchors.fill: parent - anchors.margins: Constants.mediumMargin + id: content + anchors.right: parent.right + anchors.top: parent.top - Text + VerticalSpacer{ height: Constants.largeMargin } + + Rectangle { - Layout.alignment: Qt.AlignTop - Layout.preferredHeight: 50 + anchors.left: parent.left + anchors.right: parent.right + height: childrenRect.height + anchors.margins: Constants.largeMargin - color: palette.text - font.pixelSize: Constants.h2Font.pixelSize - font.bold: true - text: qsTr("Newest Wallpaper Packs") - verticalAlignment: Qt.AlignVCenter + color: palette.base + border.color: palette.midlight + + Column + { + anchors.left: parent.left + anchors.right: parent.right + + KeroHeader + { + height: 180 + anchors.left: parent.left + anchors.right: parent.right + } + + Rectangle + { + anchors.left: parent.left + anchors.right: parent.right + height: childrenRect.height + + color: palette.window + + Column + { + anchors.left: parent.left + anchors.right: parent.right + anchors.margins: Constants.largeMargin + + 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 Live 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) + } + + onThumbnailChanged: () => + { + console.log(index + " " + thumbnail + " " + parent.thumbnail) + } + } + } + + 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 + title: 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 } + } + } + } } - HorizontalPaginator + VerticalSpacer{ height: Constants.largeMargin } + + Rectangle { - id: packsPaginator - Layout.fillWidth: true - Layout.preferredHeight: 245 - Layout.alignment: Qt.AlignTop + anchors.left: parent.left + anchors.right: parent.right + height: childrenRect.height + anchors.margins: Constants.largeMargin - model: packsModel - delegate: ItemDelegate + color: palette.base + border.color: palette.midlight + + Column { - width: resultWidth - height: resultHeight + anchors.left: parent.left + anchors.right: parent.right - 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 + KeroHeader { - anchors.fill: parent - title: parent.name - author: parent.author - description: parent.description - thumbnail: parent.thumbnail - uuid: parent.uuid + height: 180 + anchors.left: parent.left + anchors.right: parent.right + title: qsTr("New & Popular Wallpapers") + image: "qrc:/images/kero/kero_star.png" + } - selected: packsPaginator.currentIndex === parent.index + Rectangle + { + anchors.left: parent.left + anchors.right: parent.right + anchors.margins: Constants.largeMargin + height: childrenRect.height - onTriggered: () => packsPaginator.currentIndex = parent.index + color: palette.window - onViewMoreTriggered: () => + Column { - showWallpaperPopup(parent.index) - } + anchors.left: parent.left + anchors.right: parent.right - onThumbnailChanged: () => - { - console.log(index + " " + thumbnail + " " + parent.thumbnail) + 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) + } + + onThumbnailChanged: () => + { + console.log(index + " " + thumbnail + " " + parent.thumbnail) + } + } + } + + 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 + 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() + } + } + + VerticalSpacer{ height: Constants.largeMargin } } } } - onViewMoreTriggered: () => - { - showFeaturedPacksPage() - } + VerticalSpacer{} } - - Text - { - Layout.alignment: Qt.AlignTop - Layout.preferredHeight: 50 - - color: palette.text - font.pixelSize: Constants.h2Font.pixelSize - font.bold: true - text: qsTr("Featured Images") - verticalAlignment: Qt.AlignVCenter - } - - HorizontalPaginator - { - id: imagesPaginator - Layout.fillWidth: true - Layout.preferredHeight: 245 - Layout.alignment: Qt.AlignTop - - 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 - title: 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() - } - } - - Text - { - 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 } } } diff --git a/KomplexHubModule/Controls/CMakeLists.txt b/KomplexHubModule/Controls/CMakeLists.txt index 2eb4de4..1306fdd 100644 --- a/KomplexHubModule/Controls/CMakeLists.txt +++ b/KomplexHubModule/Controls/CMakeLists.txt @@ -21,5 +21,6 @@ qt6_add_qml_module(KomplexHubModule_Controls QML_FILES QML_FILES VideoView.qml QML_FILES PackView.qml + QML_FILES VerticalSpacer.qml ) diff --git a/KomplexHubModule/Controls/HorizontalPaginator.qml b/KomplexHubModule/Controls/HorizontalPaginator.qml index 46d9745..e79cb4c 100644 --- a/KomplexHubModule/Controls/HorizontalPaginator.qml +++ b/KomplexHubModule/Controls/HorizontalPaginator.qml @@ -28,6 +28,7 @@ Item signal viewMoreTriggered() id: rootItem + clip: true Item { @@ -57,6 +58,7 @@ Item id: resultsView Layout.fillHeight: true Layout.fillWidth: true + clip: true spacing: Constants.mediumMargin @@ -132,7 +134,7 @@ Item Item { Layout.fillHeight: true - Layout.preferredWidth: 128 + Layout.preferredWidth: 64 Rectangle { id: gradientMap diff --git a/KomplexHubModule/Controls/VerticalSpacer.qml b/KomplexHubModule/Controls/VerticalSpacer.qml new file mode 100644 index 0000000..b944c7e --- /dev/null +++ b/KomplexHubModule/Controls/VerticalSpacer.qml @@ -0,0 +1,9 @@ +import QtQuick + +Rectangle +{ + height: 36 + color: "transparent" + anchors.left: parent.left + anchors.right: parent.right +} diff --git a/KomplexHubModule/Kero/CMakeLists.txt b/KomplexHubModule/Kero/CMakeLists.txt index 76c0489..c515311 100644 --- a/KomplexHubModule/Kero/CMakeLists.txt +++ b/KomplexHubModule/Kero/CMakeLists.txt @@ -11,4 +11,5 @@ qt6_add_qml_module(KomplexHubModule_Kero "KeroLoadingAnimation.qml" "KeroNoResultsAvatar.qml" "KeroWarningAvatar.qml" + QML_FILES KeroHeader.qml ) \ No newline at end of file diff --git a/KomplexHubModule/Kero/KeroHeader.qml b/KomplexHubModule/Kero/KeroHeader.qml new file mode 100644 index 0000000..68c4c50 --- /dev/null +++ b/KomplexHubModule/Kero/KeroHeader.qml @@ -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 + } + } + } +} diff --git a/images/kero/kero_spotlight.png b/images/kero/kero_spotlight.png new file mode 100644 index 0000000..ea1099e Binary files /dev/null and b/images/kero/kero_spotlight.png differ diff --git a/images/kero/kero_star.png b/images/kero/kero_star.png new file mode 100644 index 0000000..502e6e4 Binary files /dev/null and b/images/kero/kero_star.png differ