代码拉取完成,页面将自动刷新
/*
* Copyright (C) 2021 CuteOS.
*
* Author: Reion Wong <reionwong@gmail.com>
*
* 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
* 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 <http://www.gnu.org/licenses/>.
*/
import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Templates 2.12 as T
import QtQuick.Window 2.12
import CuteUI 1.0 as CuteUI
import QtGraphicalEffects 1.0
import "./"
T.Menu
{
id: control
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
contentWidth + leftPadding + rightPadding)
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
contentHeight + topPadding + bottomPadding)
margins: 0
verticalPadding: CuteUI.Units.smallSpacing
spacing: CuteUI.Units.smallSpacing
transformOrigin: !cascade ? Item.Top : (mirrored ? Item.TopRight : Item.TopLeft)
delegate: CuteUIMenuItem { }
enter: Transition {
NumberAnimation {
property: "opacity"
from: 0
to: 1
easing.type: Easing.InOutCubic
duration: 100
}
}
exit: Transition {
NumberAnimation {
property: "opacity"
from: 1
to: 0
easing.type: Easing.InOutCubic
duration: 200
}
}
Overlay.modal: Item {
Rectangle {
anchors.fill: parent
color: 'transparent'
}
}
contentItem: ListView {
implicitHeight: contentHeight
implicitWidth: {
var maxWidth = 0;
for (var i = 0; i < contentItem.children.length; ++i) {
maxWidth = Math.max(maxWidth, contentItem.children[i].implicitWidth);
}
return maxWidth;
}
model: control.contentModel
interactive: Window.window ? contentHeight > Window.window.height : false
clip: true
currentIndex: control.currentIndex || 0
spacing: control.spacing
keyNavigationEnabled: true
keyNavigationWraps: true
ScrollBar.vertical: ScrollBar {}
}
background: CuteUI.RoundedRect {
radius: CuteUI.Theme.hugeRadius
opacity: 1
layer.enabled: true
layer.effect: DropShadow {
transparentBorder: true
radius: 32
samples: 32
horizontalOffset: 0
verticalOffset: 0
color: Qt.rgba(0, 0, 0, 0.11)
}
}
T.Overlay.modal: Rectangle {
color: Qt.rgba(control.CuteUI.Theme.backgroundColor.r,
control.CuteUI.Theme.backgroundColor.g,
control.CuteUI.Theme.backgroundColor.b, 0.4)
Behavior on opacity {
NumberAnimation {
duration: 150
easing.type: Easing.InOutCubic
}
}
}
T.Overlay.modeless: Rectangle {
color: Qt.rgba(control.CuteUI.Theme.backgroundColor.r,
control.CuteUI.Theme.backgroundColor.g,
control.CuteUI.Theme.backgroundColor.b, 0.4)
Behavior on opacity {
NumberAnimation {
duration: 150
easing.type: Easing.InOutCubic
}
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。