1 Star 0 Fork 6

豆腐干二等分/ukui-clipboard

forked from openKylin/ukui-clipboard 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
ShadowComponent.qml 1.66 KB
一键复制 编辑 原始数据 按行查看 历史
pangyi 提交于 2024-05-19 20:03 . Feat: 为窗口增加阴影
/*
* Copyright (C) 2022, 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.0
import QtGraphicalEffects 1.12
import org.ukui.quick.items 1.0 as UkuiItems
import org.ukui.quick.platform 1.0 as Platform
// 阴影
Item {
id: root
property int radius: 8
property int shadowWidth: 8
layer.enabled: true;
layer.effect: OpacityMask {
maskSource: Rectangle {
width: root.width
height: root.height
radius: root.shadowWidth + root.radius
color: "transparent"
border.width: root.shadowWidth
border.color: "white"
}
}
Rectangle {
x: parent.shadowWidth
y: parent.shadowWidth
width: parent.width - parent.shadowWidth * 2
height: parent.height - parent.shadowWidth * 2
radius: parent.radius
layer.enabled: true
layer.effect: DropShadow {
radius: 12
samples: 25
color: Platform.Theme.color(Platform.Theme.Shadow, Platform.Theme.Active, 0.16)
}
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ll-eleven/ukui-clipboard.git
git@gitee.com:ll-eleven/ukui-clipboard.git
ll-eleven
ukui-clipboard
ukui-clipboard
openkylin/nile

搜索帮助