添加标签集中显示区域点击空白处关闭的功能,优化收藏区域显示

This commit is contained in:
qiqi 2023-03-20 15:32:46 +08:00 committed by hewenfei
parent ed7966461c
commit e1cee053cc
2 changed files with 32 additions and 6 deletions

View File

@ -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 <https://www.gnu.org/licenses/>.
*
*/
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,9 +95,9 @@ Item {
MouseArea {
id: itemMouseArea
anchors.fill: parent
hoverEnabled: true
visible: !model.isDisable
hoverEnabled: !model.isDisable
onClicked: {
if (!model.isDisable) {
viewHide.start();
root.labelSelected(model.id);
}
@ -82,4 +105,5 @@ Item {
}
}
}
}

View File

@ -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