From 556545791e9b2a0ef780c25349f074b479e79bef Mon Sep 17 00:00:00 2001 From: Wang Zichong Date: Thu, 30 Nov 2023 14:20:33 +0800 Subject: [PATCH] chore: remove no longer used files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 移除不再使用的 v23 设计的 QML 文件。 Log: --- qml/FullscreenFrameV23.qml | 369 ------------------------------------- qml/WindowedFrameV23.qml | 281 ---------------------------- 2 files changed, 650 deletions(-) delete mode 100644 qml/FullscreenFrameV23.qml delete mode 100644 qml/WindowedFrameV23.qml diff --git a/qml/FullscreenFrameV23.qml b/qml/FullscreenFrameV23.qml deleted file mode 100644 index 41dba330..00000000 --- a/qml/FullscreenFrameV23.qml +++ /dev/null @@ -1,369 +0,0 @@ -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -//import QtCore -import QtQml.Models 2.15 -import QtQuick 2.15 -import QtQuick.Layouts 1.15 -import QtQuick.Controls 2.15 -import QtQuick.Window 2.15 -import org.deepin.dtk 1.0 -import org.deepin.vendored 1.0 - -import org.deepin.launchpad 1.0 - -Control { - visible: true - anchors.fill: parent - focus: true - - leftPadding: (DesktopIntegration.dockPosition === Qt.LeftArrow ? DesktopIntegration.dockGeometry.width : 0) + 20 - rightPadding: (DesktopIntegration.dockPosition === Qt.RightArrow ? DesktopIntegration.dockGeometry.width : 0) + 20 - topPadding: (DesktopIntegration.dockPosition === Qt.UpArrow ? DesktopIntegration.dockGeometry.height : 0) + 20 - bottomPadding: (DesktopIntegration.dockPosition === Qt.DownArrow ? DesktopIntegration.dockGeometry.height : 0) + 20 - - Timer { - id: flipPageDelay - interval: 400 - repeat: false - } - - background: Image { - source: DesktopIntegration.backgroundUrl - - Rectangle { - anchors.fill: parent - color: Qt.rgba(0, 0, 0, 0.25) - - MouseArea { - anchors.fill: parent - scrollGestureEnabled: false - onClicked: { - if (!DebugHelper.avoidHideWindow) { - LauncherController.visible = false - } - } - // TODO: this might not be the correct way to handle wheel - onWheel: { - if (flipPageDelay.running) return - let xDelta = wheel.angleDelta.x / 8 - let yDelta = wheel.angleDelta.y / 8 - let toPage = 0; // -1 prev, +1 next, 0 don't change - if (yDelta !== 0) { - toPage = (yDelta > 0) ? -1 : 1 - } else if (xDelta !== 0) { - toPage = (xDelta > 0) ? 1 : -1 - } - let curPage = indicator.currentIndex + toPage - if (curPage >= 0 && curPage < indicator.count) { - flipPageDelay.start() - indicator.currentIndex = curPage - } - } - } - } - } - - contentItem: ColumnLayout { - - Control { - Layout.fillWidth: true - Layout.fillHeight: false - - contentItem: Rectangle { - id: fullscreenHeader - implicitHeight: exitFullscreenBtn.height - color: "transparent" - - IconButton { - id: exitFullscreenBtn - - Accessible.name: "Exit fullscreen" - - anchors.right: fullscreenHeader.right - - ColorSelector.family: Palette.CrystalColor - - icon.name: "exit_fullscreen" - onClicked: { - LauncherController.currentFrame = "WindowedFrame" - } - } - - SearchEdit { - id: searchEdit - - anchors.centerIn: parent - width: (parent.width / 3) > 400 ? 400 : (parent.width / 3) - - placeholder: qsTranslate("WindowedFrame", "Search") - onTextChanged: { -// console.log(text) - SearchFilterProxyModel.setFilterRegularExpression(text) - } - } - } - } - - Item { - Layout.fillWidth: true - Layout.fillHeight: true - - SwipeView { - id: pages - - anchors.fill: parent - visible: searchEdit.text === "" - - currentIndex: indicator.currentIndex - - Repeater { - model: MultipageProxyModel.pageCount(0) // FIXME: should be a property? - - Loader { - active: SwipeView.isCurrentItem || SwipeView.isNextItem || SwipeView.isPreviousItem - id: gridViewLoader - objectName: "Main GridView Loader" - - sourceComponent: Rectangle { - color: "transparent" - - KSortFilterProxyModel { - id: proxyModel - sourceModel: MultipageProxyModel - filterRowCallback: (source_row, source_parent) => { - var index = sourceModel.index(source_row, 0, source_parent); - return sourceModel.data(index, MultipageProxyModel.PageRole) === modelData && - sourceModel.data(index, MultipageProxyModel.FolderIdNumberRole) === 0; - } - } - - GridViewContainer { - id: gridViewContainer - anchors.fill: parent - rows: 4 - columns: 7 - model: proxyModel - padding: 10 - interactive: false - focus: true - activeGridViewFocusOnTab: gridViewLoader.SwipeView.isCurrentItem - delegate: IconItemDelegate { - iconSource: "image://app-icon/" + iconName - width: gridViewContainer.cellSize - height: gridViewContainer.cellSize - icons: folderIcons - padding: 5 - onItemClicked: { - launchApp(desktopId) - } - onFolderClicked: { - let idStr = model.desktopId - let idNum = Number(idStr.replace("internal/folders/", "")) - folderLoader.currentFolderId = idNum - folderGridViewPopup.open() - folderLoader.folderName = model.display - console.log("open folder id:" + idNum) - } - onMenuTriggered: { - showContextMenu(this, model, folderIcons, false, true) - } - } - } - } - - // Since SwipeView will catch the mouse click event so we need to also do it here... - MouseArea { - anchors.fill: parent - onClicked: { - if (!DebugHelper.avoidHideWindow) { - LauncherController.visible = false - } - } - } - } - } - } - - DelegateModel { - id: delegateSearchResultModel - model: SearchFilterProxyModel - delegate: IconItemDelegate { - iconSource: "image://app-icon/" + iconName - width: searchResultGridViewContainer.cellSize - height: searchResultGridViewContainer.cellSize - padding: 5 - onItemClicked: { - launchApp(desktopId) - } - onMenuTriggered: { - showContextMenu(this, model, false, false, true) - } - } - } - - GridViewContainer { - id: searchResultGridViewContainer - - anchors.fill: parent - visible: searchEdit.text !== "" - activeFocusOnTab: visible && gridViewFocus - focus: true - - rows: 4 - columns: 7 - placeholderIcon: "search_no_result" - placeholderText: qsTranslate("WindowedFrame", "No search results") - placeholderIconSize: 256 - model: delegateSearchResultModel - padding: 10 - interactive: false - } - } - - - PageIndicator { - Layout.alignment: Qt.AlignHCenter - - id: indicator - -// visible: pages.visible - count: searchResultGridViewContainer.visible ? 1 : pages.count - currentIndex: searchResultGridViewContainer.visible ? 1 : pages.currentIndex - interactive: true - } - } - - Popup { - id: folderGridViewPopup - - focus: true -// visible: true - - property int cs: searchResultGridViewContainer.cellSize // * 5 / 4 -// anchors.centerIn: parent // seems dtkdeclarative's Popup doesn't have anchors.centerIn - - width: cs * 4 + 20 /* padding */ - height: cs * 3 + 130 /* title height*/ - x: (parent.width - width) / 2 - y: (parent.height - height) / 2 - - modal: true - - Loader { - id: folderLoader - - property string folderName: "Sample Text" - property int currentFolderId: 0 - - active: currentFolderId !== 0 - anchors.fill: parent - - sourceComponent: ColumnLayout { - spacing: 5 - anchors.fill: parent - - Item { - Layout.preferredHeight: 5 - } - - Label { - Layout.fillWidth: true - - font: DTK.fontManager.t3 - horizontalAlignment: Text.AlignHCenter - text: folderLoader.folderName - } - - Rectangle { - Layout.fillWidth: true - Layout.fillHeight: true - color: "transparent" - - SwipeView { - id: folderPagesView - - anchors.fill: parent - - currentIndex: folderPageIndicator.currentIndex - - Repeater { - model: MultipageProxyModel.pageCount(folderLoader.currentFolderId) // FIXME: should be a property? - - Loader { - active: SwipeView.isCurrentItem || SwipeView.isNextItem || SwipeView.isPreviousItem - id: folderGridViewLoader - objectName: "Folder GridView Loader" - - sourceComponent: Rectangle { - anchors.fill: parent - color: "transparent" - - KSortFilterProxyModel { - id: folderProxyModel - sourceModel: MultipageProxyModel - filterRowCallback: (source_row, source_parent) => { - var index = sourceModel.index(source_row, 0, source_parent); - return sourceModel.data(index, MultipageProxyModel.PageRole) === modelData && - sourceModel.data(index, MultipageProxyModel.FolderIdNumberRole) === folderLoader.currentFolderId; - } - } - - GridViewContainer { - id: folderGridViewContainer - anchors.fill: parent - rows: 3 - columns: 4 - model: folderProxyModel - padding: 10 - interactive: false - focus: true - activeGridViewFocusOnTab: folderGridViewLoader.SwipeView.isCurrentItem - delegate: IconItemDelegate { - iconSource: "image://app-icon/" + iconName - width: folderGridViewContainer.cellSize - height: folderGridViewContainer.cellSize - padding: 5 - onItemClicked: { - launchApp(desktopId) - } - onMenuTriggered: { - showContextMenu(this, model, false, false, true) - } - } - } - } - } - } - } - } - - PageIndicator { - Layout.alignment: Qt.AlignHCenter - - id: folderPageIndicator - - count: folderPagesView.count - currentIndex: folderPagesView.currentIndex - interactive: true - } - } - } - } - - Keys.onPressed: { - if (searchEdit.focus === false && !searchEdit.text - && event.modifiers === Qt.NoModifier - && event.key >= Qt.Key_A && event.key <= Qt.Key_Z) { - searchEdit.focus = true - searchEdit.text = event.text - } - } - - Keys.onEscapePressed: { - if (!DebugHelper.avoidHideWindow) { - LauncherController.visible = false; - } - } -} diff --git a/qml/WindowedFrameV23.qml b/qml/WindowedFrameV23.qml deleted file mode 100644 index 0a76cd97..00000000 --- a/qml/WindowedFrameV23.qml +++ /dev/null @@ -1,281 +0,0 @@ -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -import QtQuick 2.15 -import QtQml.Models 2.15 -import QtQuick.Layouts 1.15 -import QtQuick.Controls 2.15 -import QtQuick.Window 2.15 -import org.deepin.dtk 1.0 - -import org.deepin.launchpad 1.0 - -Item { - width: 780 - height: 600 - visible: true - focus: true - - RowLayout { - anchors.fill: parent - anchors.topMargin: 20 - anchors.leftMargin: anchors.topMargin - anchors.rightMargin: anchors.topMargin - anchors.bottomMargin: 0 - - spacing: 10 - - ColumnLayout { - Layout.fillWidth: false - Layout.preferredWidth: 300 - Layout.fillHeight: true - - RowLayout { - Layout.fillWidth: true - Layout.fillHeight: false - - Label { - Layout.fillWidth: true - Layout.fillHeight: true - font: DTK.fontManager.t5 - text: qsTr("Categories") - verticalAlignment: Text.AlignVCenter - } - - ButtonBox { - ColorSelector.family: Palette.CrystalColor - - ToolButton { - icon.name: "title-icon" - checked: CategorizedSortProxyModel.categoryType === CategorizedSortProxyModel.DDECategory - onClicked: { - CategorizedSortProxyModel.categoryType = CategorizedSortProxyModel.DDECategory - } - } - ToolButton { - icon.name: "letter-icon" - checked: CategorizedSortProxyModel.categoryType === CategorizedSortProxyModel.Alphabetary - onClicked: { - CategorizedSortProxyModel.categoryType = CategorizedSortProxyModel.Alphabetary - } - } - } - } - - DelegateModel { - id: delegateCategorizedModel - model: CategorizedSortProxyModel - - delegate: ItemDelegate { - id: itemDelegate - text: model.display - checkable: false - icon.name: iconName - // icon.source: "image://app-icon/" + iconName; - backgroundVisible: false - - TapHandler { - acceptedButtons: Qt.RightButton - onTapped: { - showContextMenu(itemDelegate, model, false, false, false) - } - } - - MouseArea { - anchors.fill: parent - acceptedButtons: Qt.LeftButton - onClicked: { - launchApp(desktopId) - } - } - - Keys.onReturnPressed: { - launchApp(desktopId) - } - } - } - - AppListView { - Layout.fillWidth: true - Layout.fillHeight: true - - model: delegateCategorizedModel - } - - RowLayout { - Layout.bottomMargin: 10 - - Layout.fillWidth: true - Layout.fillHeight: false - Layout.preferredHeight: 50 - -// Rectangle { -// color: 'teal' -// Layout.fillWidth: true -// Layout.fillHeight: true -// Text { -// anchors.centerIn: parent -// text: parent.width + 'x' + parent.height -// } -// } - Button { - text: qsTr("Power") - flat: true - icon { - name: "launcher_power_v23" - width: 16 - height: 16 - } - onClicked: { - DesktopIntegration.openShutdownScreen(); - } - } - - Button { - text: qsTr("Settings") - flat: true - icon { - name: "setting" - width: 16 - height: 16 - } - onClicked: { - DesktopIntegration.openSystemSettings(); - } - } - } - } - - ColumnLayout { - Layout.fillWidth: true - Layout.fillHeight: true - - RowLayout { - Layout.fillHeight: false - - SearchEdit { - id: searchEdit - Layout.fillWidth: true - placeholder: qsTr("Search") - onTextChanged: { - console.log(text) - SearchFilterProxyModel.setFilterRegularExpression(text) - } - } - - IconButton { - icon.name: "switch_to_fullscreen" - ColorSelector.family: Palette.CrystalColor - onClicked: { - LauncherController.currentFrame = "FullscreenFrame" - } - } - } - - Label { - visible: favoriteGridView.visible - text: qsTr("My Favorites") - } - - Item { - id: favoriteGridView - visible: searchEdit.text === "" - - property int rowCount: Math.min(Math.ceil(delegateFavorateModel.count / 4), 2) - - DelegateModel { - id: delegateFavorateModel - model: FavoritedProxyModel - delegate: IconItemDelegate { - iconSource: "image://app-icon/" + iconName - width: favoriteGridViewContainer.cellSize - height: favoriteGridViewContainer.cellSize - onItemClicked: { - launchApp(desktopId) - } - onMenuTriggered: { - showContextMenu(this, model, false, true, false) - } - } - } - - GridViewContainer { - anchors.fill: parent - id: favoriteGridViewContainer - rows: 0 - columns: 4 - placeholderText: qsTr("Add your favorite apps here") - model: delegateFavorateModel - interactive: favoriteGridView.rowCount > 1 - activeFocusOnTab: visible && gridViewFocus - } - - Layout.preferredHeight: rowCount === 0 ? 50 : rowCount * favoriteGridViewContainer.cellSize - Layout.fillWidth: true - } - - Label { - text: qsTr("All Apps") - } - - DelegateModel { - id: delegateAllAppsModel - model: SearchFilterProxyModel - delegate: IconItemDelegate { - iconSource: "image://app-icon/" + iconName - width: allAppsGridContainer.cellSize - height: allAppsGridContainer.cellSize - onItemClicked: { - launchApp(desktopId) - } - onMenuTriggered: { - showContextMenu(this, model, false, false, false) - } - } - } - - GridViewContainer { - id: allAppsGridContainer - rows: 0 - columns: 4 - placeholderIcon: "search_no_result" - placeholderText: qsTr("No search results") - model: delegateAllAppsModel - Layout.fillWidth: true - Layout.fillHeight: true - activeFocusOnTab: gridViewFocus - - MouseArea { - enabled: favoriteGridView.visible && (currentIndex !== -1) - - property int currentIndex: -1 - property int modelType: -1 // 1: fav, 2: all - - anchors.fill: parent - onPressAndHold: { - if (index !== -1) { - currentIndex = index - } - } - onReleased: currentIndex = -1 - } - } - } - } - - Keys.onPressed: { - if (searchEdit.focus === false && !searchEdit.text - && event.modifiers === Qt.NoModifier - && event.key >= Qt.Key_A && event.key <= Qt.Key_Z) { - searchEdit.focus = true - searchEdit.text = event.text - } - } - - Keys.onEscapePressed: { - if (!DebugHelper.avoidHideWindow) { - LauncherController.visible = false; - } - } -}