1 Star 0 Fork 1

Lingmo OS/sddm-theme

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
CuteUIMenu.qml 3.73 KB
一键复制 编辑 原始数据 按行查看 历史
Floating dream 提交于 2023-07-23 06:16 . update
/*
* 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
}
}
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/LingmoOS/sddm-theme.git
git@gitee.com:LingmoOS/sddm-theme.git
LingmoOS
sddm-theme
sddm-theme
main

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385