diff --git a/KomplexHubContent/pages/FeaturedImagesPage.qml b/KomplexHubContent/pages/FeaturedImagesPage.qml index dcb0cee..f0fa3a3 100644 --- a/KomplexHubContent/pages/FeaturedImagesPage.qml +++ b/KomplexHubContent/pages/FeaturedImagesPage.qml @@ -5,7 +5,7 @@ import QtQuick.Layouts import KomplexHub import KomplexHub.Controls import KomplexHub.Kero -import KomplexHubPlugin +import KomplexHub.Plugin Rectangle { diff --git a/KomplexHubContent/pages/FeaturedPacksPage.qml b/KomplexHubContent/pages/FeaturedPacksPage.qml index cdcd069..1cfb482 100644 --- a/KomplexHubContent/pages/FeaturedPacksPage.qml +++ b/KomplexHubContent/pages/FeaturedPacksPage.qml @@ -5,7 +5,7 @@ import QtQuick.Layouts import KomplexHub import KomplexHub.Controls import KomplexHub.Kero -import KomplexHubPlugin +import KomplexHub.Plugin Rectangle { diff --git a/KomplexHubContent/pages/FeaturedVideosPage.qml b/KomplexHubContent/pages/FeaturedVideosPage.qml index 71ea25d..e63e82b 100644 --- a/KomplexHubContent/pages/FeaturedVideosPage.qml +++ b/KomplexHubContent/pages/FeaturedVideosPage.qml @@ -5,7 +5,7 @@ import QtQuick.Layouts import KomplexHub import KomplexHub.Controls import KomplexHub.Kero -import KomplexHubPlugin +import KomplexHub.Plugin Rectangle { diff --git a/KomplexHubContent/pages/HomePage.qml b/KomplexHubContent/pages/HomePage.qml index 1436775..b3b6350 100644 --- a/KomplexHubContent/pages/HomePage.qml +++ b/KomplexHubContent/pages/HomePage.qml @@ -6,7 +6,7 @@ import QtQuick.Effects import KomplexHub import KomplexHub.Controls import KomplexHub.Kero -import KomplexHubPlugin +import KomplexHub.Plugin Item { @@ -64,7 +64,7 @@ Item id: content width: pageArea.width - VerticalSpacer{ height: Constants.largeMargin } + VerticalSpacer{ height: Constants.largeMargin; width: Constants.largeMargin } Rectangle { @@ -153,11 +153,6 @@ Item { showWallpaperPopup(parent.index) } - - onThumbnailChanged: () => - { - console.log(index + " " + thumbnail + " " + parent.thumbnail) - } } } @@ -225,13 +220,13 @@ Item } } - VerticalSpacer{ height: Constants.largeMargin } + VerticalSpacer{ height: Constants.largeMargin; width: Constants.largeMargin } } } } } - VerticalSpacer{ height: Constants.largeMargin } + VerticalSpacer{ height: Constants.largeMargin; width: Constants.largeMargin } Rectangle { @@ -322,11 +317,6 @@ Item { showWallpaperPopup(parent.index) } - - onThumbnailChanged: () => - { - console.log(index + " " + thumbnail + " " + parent.thumbnail) - } } } @@ -390,13 +380,13 @@ Item } } - VerticalSpacer{ height: Constants.largeMargin } + VerticalSpacer{ height: Constants.largeMargin; width: Constants.largeMargin } } } } } - VerticalSpacer{ height: Constants.largeMargin } + VerticalSpacer{ height: Constants.largeMargin; width: Constants.largeMargin } } } @@ -607,6 +597,12 @@ Item target: pageArea opacity: 0 } + + PropertyChanges + { + target: loadingAnimation + opacity: 0 + } } ] @@ -661,7 +657,6 @@ Item viewMoreImagePopup.description = imagesModel.data(imagesModel.index(index,0), FeaturedImagesModel.DescriptionRole) viewMoreImagePopup.uuid = imagesModel.data(imagesModel.index(index,0), FeaturedImagesModel.UuidRole) 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.landscape = imagesModel.data(imagesModel.index(index,0), FeaturedImagesModel.LandscapeUrlRole) viewMoreImagePopup.backgroundPortrait = imagesModel.data(imagesModel.index(index,0), FeaturedImagesModel.BackgroundPortraitRole) diff --git a/KomplexHubContent/pages/ImageSearchPage.qml b/KomplexHubContent/pages/ImageSearchPage.qml index 60656e3..e22906f 100644 --- a/KomplexHubContent/pages/ImageSearchPage.qml +++ b/KomplexHubContent/pages/ImageSearchPage.qml @@ -5,7 +5,7 @@ import QtQuick.Layouts import KomplexHub import KomplexHub.Controls import KomplexHub.Kero -import KomplexHubPlugin +import KomplexHub.Plugin Item { diff --git a/KomplexHubContent/pages/InstalledWallpaperPage.qml b/KomplexHubContent/pages/InstalledWallpaperPage.qml index b67049e..75ed181 100644 --- a/KomplexHubContent/pages/InstalledWallpaperPage.qml +++ b/KomplexHubContent/pages/InstalledWallpaperPage.qml @@ -5,7 +5,7 @@ import QtQuick.Dialogs import KomplexHub import KomplexHub.Controls import KomplexHub.Kero -import KomplexHubPlugin +import KomplexHub.Plugin Rectangle { id: root diff --git a/KomplexHubContent/pages/LiveSearchPage.qml b/KomplexHubContent/pages/LiveSearchPage.qml index 98237ba..11fc194 100644 --- a/KomplexHubContent/pages/LiveSearchPage.qml +++ b/KomplexHubContent/pages/LiveSearchPage.qml @@ -3,7 +3,7 @@ import QtQuick.Controls import KomplexHub import KomplexHub.Controls import KomplexHub.Kero -import KomplexHubPlugin +import KomplexHub.Plugin Item { diff --git a/KomplexHubContent/pages/NewestPacksPage.qml b/KomplexHubContent/pages/NewestPacksPage.qml index c51fcfc..04772b0 100644 --- a/KomplexHubContent/pages/NewestPacksPage.qml +++ b/KomplexHubContent/pages/NewestPacksPage.qml @@ -5,7 +5,7 @@ import QtQuick.Layouts import KomplexHub import KomplexHub.Controls import KomplexHub.Kero -import KomplexHubPlugin +import KomplexHub.Plugin Rectangle { diff --git a/KomplexHubContent/pages/VideoSearchPage.qml b/KomplexHubContent/pages/VideoSearchPage.qml index 063500b..fdf3969 100644 --- a/KomplexHubContent/pages/VideoSearchPage.qml +++ b/KomplexHubContent/pages/VideoSearchPage.qml @@ -5,7 +5,7 @@ import QtQuick.Layouts import KomplexHub import KomplexHub.Controls import KomplexHub.Kero -import KomplexHubPlugin +import KomplexHub.Plugin Item { diff --git a/KomplexHubContent/pages/WallpaperSettingsPage.qml b/KomplexHubContent/pages/WallpaperSettingsPage.qml index 13d3499..bd60786 100644 --- a/KomplexHubContent/pages/WallpaperSettingsPage.qml +++ b/KomplexHubContent/pages/WallpaperSettingsPage.qml @@ -33,7 +33,7 @@ import QtCore import Qt.labs.folderlistmodel 2.15 import KomplexHub import KomplexHub.Controls -import KomplexHubPlugin +import KomplexHub.Plugin //import com.github.digitalartifex.komplex 1.0 as Komplex diff --git a/KomplexHubModule/Controls/BackgroundImage.qml b/KomplexHubModule/Controls/BackgroundImage.qml new file mode 100644 index 0000000..5ca60a2 --- /dev/null +++ b/KomplexHubModule/Controls/BackgroundImage.qml @@ -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 + } +} diff --git a/KomplexHubModule/Controls/CMakeLists.txt b/KomplexHubModule/Controls/CMakeLists.txt index 1306fdd..8fc39a5 100644 --- a/KomplexHubModule/Controls/CMakeLists.txt +++ b/KomplexHubModule/Controls/CMakeLists.txt @@ -22,5 +22,10 @@ qt6_add_qml_module(KomplexHubModule_Controls QML_FILES VideoView.qml QML_FILES PackView.qml QML_FILES VerticalSpacer.qml + QML_FILES DownloadView.qml + QML_FILES ImageFrame.qml + QML_FILES BackgroundImage.qml + QML_FILES CompletedView.qml + QML_FILES ErrorView.qml ) diff --git a/KomplexHubModule/Controls/HorizontalPaginator.qml b/KomplexHubModule/Controls/HorizontalPaginator.qml index e79cb4c..395a9af 100644 --- a/KomplexHubModule/Controls/HorizontalPaginator.qml +++ b/KomplexHubModule/Controls/HorizontalPaginator.qml @@ -5,7 +5,7 @@ import QtQuick.Layouts import KomplexHub import KomplexHub.Controls import KomplexHub.Kero -import KomplexHubPlugin +import KomplexHub.Plugin Item { diff --git a/KomplexHubModule/Controls/ImageFrame.qml b/KomplexHubModule/Controls/ImageFrame.qml new file mode 100644 index 0000000..32f737a --- /dev/null +++ b/KomplexHubModule/Controls/ImageFrame.qml @@ -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) + } + } + +} diff --git a/KomplexHubModule/Controls/PackView.qml b/KomplexHubModule/Controls/PackView.qml index c5423f0..33619c7 100644 --- a/KomplexHubModule/Controls/PackView.qml +++ b/KomplexHubModule/Controls/PackView.qml @@ -6,7 +6,7 @@ import QtQuick.Effects import KomplexHub import KomplexHub.Controls import KomplexHub.Kero -import KomplexHubPlugin +import KomplexHub.Plugin Item { @@ -26,24 +26,10 @@ Item anchors.fill: parent color: palette.base - Image + BackgroundImage { - 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 + source: rootItem.thumbnail } ColumnLayout @@ -52,36 +38,15 @@ Item anchors.margins: Constants.largeMargin spacing: Constants.largeMargin - RowLayout + ImageFrame { Layout.fillWidth: true Layout.alignment: Qt.AlignTop| Qt.AlignHCenter - Layout.topMargin: 32 + Layout.topMargin: Constants.largeMargin + Layout.preferredHeight: width / 1.77777777778 + Layout.maximumWidth: 800 - 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) - } - } + source: rootItem.thumbnail } Text @@ -116,18 +81,6 @@ Item 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 diff --git a/KomplexHubModule/Controls/PaginatorGrid.qml b/KomplexHubModule/Controls/PaginatorGrid.qml index 92ec13a..b9d3897 100644 --- a/KomplexHubModule/Controls/PaginatorGrid.qml +++ b/KomplexHubModule/Controls/PaginatorGrid.qml @@ -5,7 +5,7 @@ import QtQuick.Layouts import KomplexHub import KomplexHub.Controls import KomplexHub.Kero -import KomplexHubPlugin +import KomplexHub.Plugin Item { diff --git a/KomplexHubModule/Controls/SearchResultItem.qml b/KomplexHubModule/Controls/SearchResultItem.qml index d22d34b..1fd6605 100644 --- a/KomplexHubModule/Controls/SearchResultItem.qml +++ b/KomplexHubModule/Controls/SearchResultItem.qml @@ -16,7 +16,7 @@ Item { signal triggered signal viewMoreTriggered - id: mainItem + id: rootItem width: 256 height: 256 clip: true @@ -48,7 +48,7 @@ Item { onReleased: () => { if(!states.selected) { - mainItem.triggered() + rootItem.triggered() } } } @@ -57,47 +57,13 @@ Item { { anchors.fill: parent - Rectangle + ImageFrame { Layout.preferredWidth: 250 Layout.preferredHeight: 141 Layout.alignment: Qt.AlignHCenter | Qt.AlignTop Layout.topMargin: 3 - - 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 - // } - // } - } - } + source: rootItem.thumbnail Image { @@ -112,14 +78,57 @@ Item { opacity: 0.5 source: "qrc:/images/icons/pexels-icon-filled-256.svg" - visible: mainItem.pexels + visible: rootItem.pexels } } + // Rectangle + // { + // Layout.preferredWidth: 250 + // Layout.preferredHeight: 141 + // Layout.alignment: Qt.AlignHCenter | Qt.AlignTop + // Layout.topMargin: 3 + + // 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: rootItem.thumbnail + // // visible: !(status === Image.Loading) + // // fillMode: Image.PreserveAspectCrop + + // // onStatusChanged: () => + // // { + // // // if(status === Image.Error) + // // // { + // // // if(retries <= 3) + // // // { + // // // ++retries + // // // let src = source + // // // source = "" + // // // source = src + // // // } + // // // } + // // } + // // } + // } + Text { color: palette.text - text: mainItem.title + text: rootItem.title font.pixelSize: 16 font.bold: true @@ -135,12 +144,12 @@ Item { { color: palette.text font.pixelSize: 12 - text: "By: " + mainItem.author + text: "By: " + rootItem.author leftPadding: 12 Layout.alignment: Qt.AlignLeft | Qt.AlignBottom Layout.preferredWidth: 250 - visible: !mainItem.pexels + visible: !rootItem.pexels } Text @@ -149,7 +158,7 @@ Item { clip: true color: palette.text font.pixelSize: 12 - text: mainItem.description + text: rootItem.description wrapMode: Text.WrapAtWordBoundaryOrAnywhere textFormat: Text.PlainText elide: Text.ElideRight @@ -176,7 +185,7 @@ Item { opacity: 0 onTriggered: () => { - mainItem.viewMoreTriggered() + rootItem.viewMoreTriggered() } } @@ -189,7 +198,7 @@ Item { id: states property bool clicked: false property bool hovered: false - property alias selected: mainItem.selected + property alias selected: rootItem.selected property bool idle: true onIdleChanged: () => diff --git a/KomplexHubModule/Controls/VerticalSpacer.qml b/KomplexHubModule/Controls/VerticalSpacer.qml index b944c7e..40d6b4e 100644 --- a/KomplexHubModule/Controls/VerticalSpacer.qml +++ b/KomplexHubModule/Controls/VerticalSpacer.qml @@ -1,9 +1,9 @@ import QtQuick +import QtQuick.Layouts Rectangle { - height: 36 + Layout.fillHeight: true + color: "transparent" - anchors.left: parent.left - anchors.right: parent.right } diff --git a/KomplexHubModule/Controls/VideoView.qml b/KomplexHubModule/Controls/VideoView.qml index fbe48c3..899cfa3 100644 --- a/KomplexHubModule/Controls/VideoView.qml +++ b/KomplexHubModule/Controls/VideoView.qml @@ -6,7 +6,7 @@ import QtQuick.Effects import KomplexHub import KomplexHub.Controls import KomplexHub.Kero -import KomplexHubPlugin +import KomplexHub.Plugin Item { @@ -46,24 +46,10 @@ Item anchors.fill: parent color: palette.base - Image + BackgroundImage { - 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 + source: rootItem.thumbnail } ColumnLayout @@ -72,36 +58,15 @@ Item anchors.margins: Constants.largeMargin spacing: Constants.largeMargin - RowLayout + ImageFrame { Layout.fillWidth: true Layout.alignment: Qt.AlignTop| Qt.AlignHCenter - Layout.topMargin: 32 + Layout.topMargin: Constants.largeMargin + Layout.preferredHeight: width / 1.77777777778 + Layout.maximumWidth: 800 - 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 - } - } + source: rootItem.thumbnail } Text