2023-02-22 14:07:53 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2023, KylinSoft Co., Ltd.
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
import QtQuick 2.12
|
|
|
|
import QtQml.Models 2.1
|
|
|
|
import QtQuick.Controls 2.5
|
|
|
|
import org.ukui.menu.core 1.0
|
|
|
|
import org.ukui.menu.extension 1.0
|
|
|
|
import AppControls2 1.0 as AppControls2
|
2024-01-04 11:13:41 +08:00
|
|
|
import org.ukui.quick.platform 1.0 as Platform
|
2023-12-11 16:13:53 +08:00
|
|
|
import org.ukui.quick.items 1.0 as UkuiItems
|
2024-01-08 17:25:27 +08:00
|
|
|
import AppUI 1.0 as AppUI
|
2023-02-22 14:07:53 +08:00
|
|
|
|
|
|
|
UkuiMenuExtension {
|
|
|
|
MouseArea {
|
|
|
|
id: viewMouseArea
|
|
|
|
anchors.fill: parent
|
|
|
|
hoverEnabled: true
|
|
|
|
|
2024-01-08 17:25:27 +08:00
|
|
|
onClicked: {
|
|
|
|
folderLoader.isFolderOpened = false;
|
|
|
|
favoriteView.visible = true;
|
|
|
|
favoriteView.isContentShow = true;
|
|
|
|
}
|
|
|
|
|
2023-12-11 16:13:53 +08:00
|
|
|
UkuiItems.StyleBackground {
|
2023-03-02 13:57:13 +08:00
|
|
|
anchors.top: parent.top
|
|
|
|
width: parent.width; height: 1
|
2023-12-11 16:13:53 +08:00
|
|
|
useStyleTransparency: false
|
2023-03-02 13:57:13 +08:00
|
|
|
alpha: 0.15
|
2024-01-04 11:13:41 +08:00
|
|
|
paletteRole: Platform.Theme.Text
|
2023-03-02 13:57:13 +08:00
|
|
|
visible: favoriteView.contentY > 0
|
|
|
|
z: 1
|
|
|
|
}
|
|
|
|
|
2024-01-08 17:25:27 +08:00
|
|
|
AppUI.Folder {
|
|
|
|
id: folderLoader
|
|
|
|
anchors.fill: parent
|
|
|
|
|
|
|
|
isFullScreen: false
|
|
|
|
Component.onCompleted: favoriteView.openFolderSignal.connect(initFolder)
|
|
|
|
Component.onDestruction: favoriteView.openFolderSignal.disconnect(initFolder)
|
|
|
|
}
|
|
|
|
|
|
|
|
FavoriteGridView {
|
2023-02-22 14:07:53 +08:00
|
|
|
id: favoriteView
|
|
|
|
anchors.fill: parent
|
|
|
|
anchors.leftMargin: 16
|
2023-03-20 15:32:46 +08:00
|
|
|
anchors.topMargin: 12
|
|
|
|
anchors.bottomMargin: 6
|
2024-01-08 17:25:27 +08:00
|
|
|
Component.onCompleted: {
|
|
|
|
favoriteView.viewModel.model = extensionData.favoriteAppsModel
|
|
|
|
folderLoader.turnPageFinished.connect(contentShowFinished)
|
2023-02-22 14:07:53 +08:00
|
|
|
}
|
2024-01-08 17:25:27 +08:00
|
|
|
Component.onDestruction: folderLoader.turnPageFinished.disconnect(contentShowFinished)
|
|
|
|
}
|
2023-02-22 14:07:53 +08:00
|
|
|
}
|
|
|
|
}
|