From e1cee053cc58d7ccd9263517c28ae311bdf0d91a Mon Sep 17 00:00:00 2001 From: qiqi Date: Mon, 20 Mar 2023 15:32:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=A0=87=E7=AD=BE=E9=9B=86?= =?UTF-8?q?=E4=B8=AD=E6=98=BE=E7=A4=BA=E5=8C=BA=E5=9F=9F=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E7=A9=BA=E7=99=BD=E5=A4=84=E5=85=B3=E9=97=AD=E7=9A=84=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=EF=BC=8C=E4=BC=98=E5=8C=96=E6=94=B6=E8=97=8F=E5=8C=BA?= =?UTF-8?q?=E5=9F=9F=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- qml/AppUI/SelectionPage.qml | 34 ++++++++++++++++++++++++---- qml/extensions/FavoriteExtension.qml | 4 +++- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/qml/AppUI/SelectionPage.qml b/qml/AppUI/SelectionPage.qml index 1b28a37..eaf00b0 100644 --- a/qml/AppUI/SelectionPage.qml +++ b/qml/AppUI/SelectionPage.qml @@ -1,3 +1,21 @@ +/* + * 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 . + * + */ + import QtQuick 2.12 import QtQuick.Layouts 1.2 import org.ukui.menu.core 1.0 @@ -27,6 +45,11 @@ Item { } } + MouseArea { + anchors.fill: parent + onClicked: viewHide.start(); + } + GridView { id: selectionArea anchors.centerIn: parent @@ -56,7 +79,7 @@ Item { delegate: AppControls2.StyleBackground { height: selectionArea.itemHeight; width: selectionArea.itemWidth - alpha: itemMouseArea.containsPress ? 0.82 : itemMouseArea.containsMouse ? 0.55 : 0.00 + alpha: (itemMouseArea.containsPress && !model.isDisable) ? 0.82 : (itemMouseArea.containsMouse && !model.isDisable) ? 0.55 : 0.00 useStyleTransparent: false radius: 8 @@ -72,11 +95,12 @@ Item { MouseArea { id: itemMouseArea anchors.fill: parent - hoverEnabled: true - visible: !model.isDisable + hoverEnabled: !model.isDisable onClicked: { - viewHide.start(); - root.labelSelected(model.id); + if (!model.isDisable) { + viewHide.start(); + root.labelSelected(model.id); + } } } } diff --git a/qml/extensions/FavoriteExtension.qml b/qml/extensions/FavoriteExtension.qml index b52b1b3..1bd8566 100644 --- a/qml/extensions/FavoriteExtension.qml +++ b/qml/extensions/FavoriteExtension.qml @@ -47,7 +47,9 @@ UkuiMenuExtension { id: favoriteView anchors.fill: parent anchors.leftMargin: 16 - anchors.topMargin: 14 + anchors.topMargin: 12 + anchors.bottomMargin: 6 + clip: true cellWidth: itemHeight + spacing; cellHeight: cellWidth property int exchangedStartIndex: 0 property int spacing: 4