Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
k54kdk
PyQt Fluent Widgets
提交
b9125406
P
PyQt Fluent Widgets
项目概览
k54kdk
/
PyQt Fluent Widgets
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PyQt Fluent Widgets
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
b9125406
编写于
9月 02, 2021
作者:
之一Yo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
更新滑动条条样式,修复平滑滚动的 bug
上级
928e4ee2
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
14 addition
and
56 deletion
+14
-56
widgets/dialog_with_mask/mask_dialog.py
widgets/dialog_with_mask/mask_dialog.py
+0
-1
widgets/scroll_area/scroll_area.py
widgets/scroll_area/scroll_area.py
+5
-5
widgets/slider/demo.py
widgets/slider/demo.py
+1
-0
widgets/slider/resource/slider.qss
widgets/slider/resource/slider.qss
+8
-50
未找到文件。
widgets/dialog_with_mask/mask_dialog.py
浏览文件 @
b9125406
...
...
@@ -26,7 +26,6 @@ class MaskDialog(QDialog):
def
__initWidget
(
self
):
""" 初始化小部件 """
self
.
__setShadowEffect
()
self
.
widget
.
setWindowOpacity
(
0.1
)
self
.
setWindowFlags
(
Qt
.
FramelessWindowHint
)
self
.
setAttribute
(
Qt
.
WA_TranslucentBackground
)
self
.
setGeometry
(
0
,
0
,
self
.
parent
().
width
(),
self
.
parent
().
height
())
...
...
widgets/scroll_area/scroll_area.py
浏览文件 @
b9125406
...
...
@@ -3,7 +3,7 @@ from collections import deque
from
enum
import
Enum
from
math
import
cos
,
pi
from
PyQt5.QtCore
import
QDateTime
,
Qt
,
QTimer
,
Q
T_VERSION_STR
from
PyQt5.QtCore
import
QDateTime
,
Qt
,
QTimer
,
Q
Point
from
PyQt5.QtGui
import
QWheelEvent
from
PyQt5.QtWidgets
import
QApplication
,
QScrollArea
...
...
@@ -31,10 +31,10 @@ class ScrollArea(QScrollArea):
def
wheelEvent
(
self
,
e
:
QWheelEvent
):
""" 实现平滑滚动效果 """
if
self
.
smoothMode
==
SmoothMode
.
NO_SMOOTH
or
QT_VERSION_STR
!=
'5.13.2'
:
if
self
.
smoothMode
==
SmoothMode
.
NO_SMOOTH
:
super
().
wheelEvent
(
e
)
return
# 将当前时间点插入队尾
now
=
QDateTime
.
currentDateTime
().
toMSecsSinceEpoch
()
self
.
scrollStamps
.
append
(
now
)
...
...
@@ -70,8 +70,8 @@ class ScrollArea(QScrollArea):
# 构造滚轮事件
e
=
QWheelEvent
(
self
.
lastWheelEvent
.
pos
(),
self
.
lastWheelEvent
.
globalPos
(),
self
.
lastWheelEvent
.
pos
(),
self
.
lastWheelEvent
.
globalPos
(
),
QPoint
(),
QPoint
(
0
,
totalDelta
),
round
(
totalDelta
),
Qt
.
Vertical
,
self
.
lastWheelEvent
.
buttons
(),
...
...
widgets/slider/demo.py
浏览文件 @
b9125406
...
...
@@ -12,6 +12,7 @@ class Window(QWidget):
super
().
__init__
(
parent
=
parent
)
self
.
resize
(
300
,
90
)
self
.
hSlider
=
Slider
(
Qt
.
Horizontal
,
self
)
self
.
hSlider
.
setValue
(
20
)
self
.
hSlider
.
move
(
56
,
30
)
with
open
(
'resource/slider.qss'
,
encoding
=
'utf-8'
)
as
f
:
self
.
setStyleSheet
(
f
.
read
())
...
...
widgets/slider/resource/slider.qss
浏览文件 @
b9125406
...
...
@@ -2,7 +2,6 @@ QWidget{
background-color: white;
}
/* 水平滑动条 */
QSlider:horizontal {
height: 26px;
width: 188px;
...
...
@@ -10,15 +9,16 @@ QSlider:horizontal {
}
QSlider::groove:horizontal {
width: 188px;
border: none;
background-color: transparent
;
height: 4px
;
}
QSlider::handle:horizontal {
width: 26px;
height: 26px;
border-radius: 13px;
margin-top: -11px;
margin-bottom: -11px;
background-color: rgb(0, 153, 188);
}
...
...
@@ -34,54 +34,12 @@ QSlider::handle:horizontal:pressed {
QSlider::sub-page:horizontal {
/*已划过部分的颜色*/
background: rgb(0, 153, 187);
margin-top: 11
px;
margin-bottom: 11
px;
height: 4
px;
border-radius: 2
px;
}
QSlider::add-page:horizontal {
background-color: rgb(130, 131, 134);
margin-top: 11px;
margin-bottom: 11px;
}
/* 竖直滑动条 */
QSlider:vertical {
width: 26px;
height: 188px;
background-color: transparent;
}
QSlider::groove:vertical {
width: 26px;
border: none;
background-color: transparent;
}
QSlider::handle:vertical {
width: 26px;
height: 26px;
border-radius: 13px;
background-color: rgb(0, 153, 188);
}
QSlider::handle:vertical:hover {
background-color: rgb(72, 210, 242);
}
QSlider::handle:vertical:pressed {
background-color: rgb(0, 107, 131);
}
QSlider::add-page:vertical {
background: rgb(0, 153, 187);
margin-left: 11px;
margin-right: 11px;
}
QSlider::sub-page:vertical {
background-color: rgb(130, 131, 134);
margin-left: 11px;
margin-right: 11px;
background-color: rgb(153, 153, 153);
height: 4px;
border-radius: 2px;
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录