ukui-menu/qml/AppUI/FullScreenAppItem.qml

73 lines
2.2 KiB
QML

/*
* Copyright (C) 2024, 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/>.
*
* Authors: hxf <hewenfei@kylinos.cn>
*
*/
import QtQuick 2.12
import QtQuick.Layouts 1.12
import org.ukui.quick.items 1.0 as UkuiItems
import org.ukui.quick.platform 1.0 as Platform
MouseArea {
id: root
property alias icon: appIcon
property alias text: appName
property alias background: styleBackground
hoverEnabled: true
UkuiItems.StyleBackground {
id: styleBackground
anchors.fill: parent
radius: Platform.Theme.normalRadius
useStyleTransparency: false
paletteRole: Platform.Theme.WindowText
alpha: root.containsPress ? 0.15 : root.containsMouse ? 0.08 : 0
ColumnLayout {
anchors.fill: parent
anchors.topMargin: 16
spacing: 0
UkuiItems.Icon {
id: appIcon
Layout.minimumWidth: 32
Layout.minimumHeight: 32
Layout.maximumWidth: 96
Layout.maximumHeight: 96
Layout.preferredWidth: 96
Layout.preferredHeight: 96
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
}
UkuiItems.StyleText {
id: appName
Layout.fillWidth: true
Layout.fillHeight: true
elide: Text.ElideRight
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
paletteRole: Platform.Theme.Text
}
}
}
}