Added popup functionality

This commit is contained in:
Digital Artifex
2026-06-25 03:13:02 -04:00
parent 90f65a8a54
commit c08b654f5b
2 changed files with 54 additions and 3 deletions
+1 -2
View File
@@ -17,8 +17,7 @@ qt6_add_qml_module(KomplexHubContent
"pages/SettingsPage.qml" "pages/SettingsPage.qml"
"pages/UserProfilePage.qml" "pages/UserProfilePage.qml"
"pages/WallpaperSettingsPage.qml" "pages/WallpaperSettingsPage.qml"
QML_FILES pages/VideoSearchPage.qml "pages/VideoSearchPage.qml"
QML_FILES views/ImageView.qml
) )
+53 -1
View File
@@ -14,6 +14,7 @@ import KomplexHubContent
Rectangle { Rectangle {
property MenuButton currentMenuButton property MenuButton currentMenuButton
property bool popup: false
id: windowRoot id: windowRoot
@@ -35,9 +36,41 @@ Rectangle {
color: palette.base.lighter() 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 { ColumnLayout {
opacity: popup ? 0 : 1
visible: opacity > 0.01
id: windowMenuLayout id: windowMenuLayout
anchors.fill: parent
MenuButton { MenuButton {
id: homeMenubutton id: homeMenubutton
@@ -174,6 +207,13 @@ Rectangle {
searchContainer.preferredHeight = 0 searchContainer.preferredHeight = 0
} }
} }
Behavior on opacity {
NumberAnimation
{
duration: 250
}
}
} }
} }
@@ -250,6 +290,7 @@ Rectangle {
{ {
pageLoader.loading = false pageLoader.loading = false
pageLoader.updateSearchTerm(); pageLoader.updateSearchTerm();
popupConnection.target = pageLoader.item
} }
} }
} }
@@ -334,6 +375,17 @@ Rectangle {
opacity: 0 opacity: 0
} }
Connections
{
id: popupConnection
target: pageLoader.item
function onPopupChanged()
{
windowRoot.popup = pageLoader.item.popup
}
}
Component.onCompleted: () => { Component.onCompleted: () => {
homeMenubutton.selected = true homeMenubutton.selected = true
currentMenuButton = homeMenubutton currentMenuButton = homeMenubutton