2023-03-20 15:33:32 +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/>.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2023-04-04 09:33:06 +08:00
|
|
|
import QtQuick 2.12
|
2023-03-06 09:37:06 +08:00
|
|
|
import QtQuick.Layouts 1.12
|
|
|
|
import QtQuick.Controls 2.5
|
|
|
|
import AppControls2 1.0 as AppControls2
|
|
|
|
import org.ukui.menu.core 1.0
|
|
|
|
|
2024-01-09 10:08:53 +08:00
|
|
|
Item {
|
2023-08-14 11:15:54 +08:00
|
|
|
property bool isAppListShow: appList.visible
|
2023-03-31 16:20:05 +08:00
|
|
|
|
2023-04-26 17:04:22 +08:00
|
|
|
function resetFocus() {
|
2023-08-14 11:15:54 +08:00
|
|
|
if (appList.visible) {
|
|
|
|
appList.resetListFocus();
|
|
|
|
} else {
|
|
|
|
selectionPage.viewFocusEnable();
|
|
|
|
}
|
2023-04-26 17:04:22 +08:00
|
|
|
}
|
|
|
|
|
2024-01-09 10:08:53 +08:00
|
|
|
ColumnLayout {
|
|
|
|
anchors.fill: parent
|
|
|
|
spacing: 5
|
2023-03-31 16:20:05 +08:00
|
|
|
|
2024-01-09 10:08:53 +08:00
|
|
|
AppListHeader {
|
|
|
|
id: appListHeader
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.preferredHeight: 48
|
2024-01-18 03:24:01 +08:00
|
|
|
header: AppPageBackend.appModel.header
|
2023-03-31 16:20:05 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
Item {
|
2024-01-09 10:08:53 +08:00
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
|
|
|
|
|
|
|
AppList {
|
|
|
|
id: appList
|
2023-03-31 16:20:05 +08:00
|
|
|
anchors.fill: parent
|
2024-01-09 10:08:53 +08:00
|
|
|
visible: true
|
2024-01-18 03:24:01 +08:00
|
|
|
model: AppPageBackend.appModel
|
2023-03-31 16:20:05 +08:00
|
|
|
|
2024-01-09 10:08:53 +08:00
|
|
|
view.onContentYChanged: {
|
|
|
|
if (view.contentY <= 0) {
|
|
|
|
appListHeader.title = "";
|
|
|
|
} else {
|
|
|
|
appListHeader.title = view.currentSection;
|
2023-03-31 16:20:05 +08:00
|
|
|
}
|
|
|
|
}
|
2024-01-09 10:08:53 +08:00
|
|
|
}
|
2023-04-04 09:33:06 +08:00
|
|
|
|
2024-01-09 10:08:53 +08:00
|
|
|
SelectionPage {
|
|
|
|
id: selectionPage
|
|
|
|
anchors.fill: parent
|
|
|
|
anchors.bottomMargin: 54
|
|
|
|
visible: !appList.visible
|
|
|
|
onViewHideFinished: appList.visible = true
|
|
|
|
onLabelSelected: appList.labelSelection(labelId)
|
2023-03-31 16:20:05 +08:00
|
|
|
}
|
|
|
|
}
|
2023-03-06 09:37:06 +08:00
|
|
|
}
|
|
|
|
}
|