From c08b654f5b629ebdd4c71df69d857480d68c68d2 Mon Sep 17 00:00:00 2001 From: Digital Artifex <7929434+DigitalArtifex@users.noreply.github.com> Date: Thu, 25 Jun 2026 03:13:02 -0400 Subject: [PATCH] Added popup functionality --- KomplexHubContent/CMakeLists.txt | 3 +- KomplexHubContent/MainScreen.qml | 54 +++++++++++++++++++++++++++++++- 2 files changed, 54 insertions(+), 3 deletions(-) diff --git a/KomplexHubContent/CMakeLists.txt b/KomplexHubContent/CMakeLists.txt index ede62b4..1394b19 100644 --- a/KomplexHubContent/CMakeLists.txt +++ b/KomplexHubContent/CMakeLists.txt @@ -17,8 +17,7 @@ qt6_add_qml_module(KomplexHubContent "pages/SettingsPage.qml" "pages/UserProfilePage.qml" "pages/WallpaperSettingsPage.qml" - QML_FILES pages/VideoSearchPage.qml - QML_FILES views/ImageView.qml + "pages/VideoSearchPage.qml" ) diff --git a/KomplexHubContent/MainScreen.qml b/KomplexHubContent/MainScreen.qml index a2a931a..35f8b35 100644 --- a/KomplexHubContent/MainScreen.qml +++ b/KomplexHubContent/MainScreen.qml @@ -14,6 +14,7 @@ import KomplexHubContent Rectangle { property MenuButton currentMenuButton + property bool popup: false id: windowRoot @@ -35,9 +36,41 @@ Rectangle { color: palette.base.lighter() + ColumnLayout + { + height: popup ? 64 : 0 + opacity: popup ? 1 : 0 + + MenuButton + { + Layout.alignment: Qt.AlignTop + + height: 64 + width: 100 + text: qsTr("Back") + + icon.height: 32 + icon.width: 32 + icon.url: "qrc:/images/icons/icons8-reply-arrow.svg" + + onTriggered: () => { + pageLoader.item.closePopup() + selected = false + } + + Behavior on opacity { + NumberAnimation + { + duration: 250 + } + } + } + } + ColumnLayout { + opacity: popup ? 0 : 1 + visible: opacity > 0.01 id: windowMenuLayout - anchors.fill: parent MenuButton { id: homeMenubutton @@ -174,6 +207,13 @@ Rectangle { searchContainer.preferredHeight = 0 } } + + Behavior on opacity { + NumberAnimation + { + duration: 250 + } + } } } @@ -250,6 +290,7 @@ Rectangle { { pageLoader.loading = false pageLoader.updateSearchTerm(); + popupConnection.target = pageLoader.item } } } @@ -334,6 +375,17 @@ Rectangle { opacity: 0 } + Connections + { + id: popupConnection + target: pageLoader.item + + function onPopupChanged() + { + windowRoot.popup = pageLoader.item.popup + } + } + Component.onCompleted: () => { homeMenubutton.selected = true currentMenuButton = homeMenubutton