Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
k54kdk
PyQt Fluent Widgets
提交
d2ccfcda
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看板
提交
d2ccfcda
编写于
5月 07, 2023
作者:
之一Yo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
添加列表组件
上级
751ff1a9
变更
20
展开全部
隐藏空白更改
内联
并排
Showing
20 changed file
with
264191 addition
and
263093 deletion
+264191
-263093
examples/gallery/app/common/resource.py
examples/gallery/app/common/resource.py
+209522
-209242
examples/gallery/app/resource/i18n/gallery.zh_CN.qm
examples/gallery/app/resource/i18n/gallery.zh_CN.qm
+0
-0
examples/gallery/app/resource/i18n/gallery.zh_CN.ts
examples/gallery/app/resource/i18n/gallery.zh_CN.ts
+202
-14
examples/gallery/app/resource/i18n/gallery.zh_HK.qm
examples/gallery/app/resource/i18n/gallery.zh_HK.qm
+0
-0
examples/gallery/app/resource/i18n/gallery.zh_HK.ts
examples/gallery/app/resource/i18n/gallery.zh_HK.ts
+202
-14
examples/gallery/app/view/home_interface.py
examples/gallery/app/view/home_interface.py
+10
-2
examples/gallery/app/view/scroll_interface.py
examples/gallery/app/view/scroll_interface.py
+1
-1
examples/gallery/app/view/view_interface.py
examples/gallery/app/view/view_interface.py
+44
-3
examples/list_view/demo.py
examples/list_view/demo.py
+56
-0
qfluentwidgets/_rc/qss/dark/list_view.qss
qfluentwidgets/_rc/qss/dark/list_view.qss
+74
-0
qfluentwidgets/_rc/qss/dark/table_view.qss
qfluentwidgets/_rc/qss/dark/table_view.qss
+1
-0
qfluentwidgets/_rc/qss/light/list_view.qss
qfluentwidgets/_rc/qss/light/list_view.qss
+75
-0
qfluentwidgets/_rc/qss/light/table_view.qss
qfluentwidgets/_rc/qss/light/table_view.qss
+1
-0
qfluentwidgets/_rc/resource.py
qfluentwidgets/_rc/resource.py
+53888
-53812
qfluentwidgets/_rc/resource.qrc
qfluentwidgets/_rc/resource.qrc
+2
-0
qfluentwidgets/common/style_sheet.py
qfluentwidgets/common/style_sheet.py
+1
-0
qfluentwidgets/components/widgets/__init__.py
qfluentwidgets/components/widgets/__init__.py
+1
-0
qfluentwidgets/components/widgets/list_view.py
qfluentwidgets/components/widgets/list_view.py
+100
-0
qfluentwidgets/components/widgets/scroll_bar.py
qfluentwidgets/components/widgets/scroll_bar.py
+1
-0
qfluentwidgets/components/widgets/table_view.py
qfluentwidgets/components/widgets/table_view.py
+10
-5
未找到文件。
examples/gallery/app/common/resource.py
浏览文件 @
d2ccfcda
此差异已折叠。
点击以展开。
examples/gallery/app/resource/i18n/gallery.zh_CN.qm
浏览文件 @
d2ccfcda
无法预览此类型文件
examples/gallery/app/resource/i18n/gallery.zh_CN.ts
浏览文件 @
d2ccfcda
...
...
@@ -360,6 +360,189 @@
<
translation
>
搜索图标
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
ListFrame
<
/name
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
75
"
/>
<
source
>
Star
Platinum
<
/source
>
<
translation
>
白金之星
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
75
"
/>
<
source
>
Hierophant
Green
<
/source
>
<
translation
>
法皇之绿
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
76
"
/>
<
source
>
Made
in
Haven
<
/source
>
<
translation
>
天堂制造
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
76
"
/>
<
source
>
King
Crimson
<
/source
>
<
translation
>
绯红之王
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
77
"
/>
<
source
>
Silver
Chariot
<
/source
>
<
translation
>
银色战车
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
77
"
/>
<
source
>
Crazy
diamond
<
/source
>
<
translation
>
疯狂钻石
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
78
"
/>
<
source
>
Metallica
<
/source
>
<
translation
>
金属制品
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
78
"
/>
<
source
>
Another
One
Bites
The
Dust
<
/source
>
<
translation
>
败者食尘
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
79
"
/>
<
source
>
Heaven
&
apos
;
s
Door
<
/source
>
<
translation
>
黑蚊子多
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
80
"
/>
<
source
>
The
Grateful
Dead
<
/source
>
<
translation
>
壮烈成仁
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
80
"
/>
<
source
>
Stone
Free
<
/source
>
<
translation
>
石之自由
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
81
"
/>
<
source
>
The
World
<
/source
>
<
translation
>
砸瓦鲁多
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
81
"
/>
<
source
>
Sticky
Fingers
<
/source
>
<
translation
>
钢链手指
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
82
"
/>
<
source
>
Ozone
Baby
<
/source
>
<
translation
>
臭氧宝宝
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
82
"
/>
<
source
>
Love
Love
Deluxe
<
/source
>
<
translation
>
华丽挚爱
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
83
"
/>
<
source
>
Hermit
Purple
<
/source
>
<
translation
>
隐者之紫
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
83
"
/>
<
source
>
Gold
Experience
<
/source
>
<
translation
>
黄金体验
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
84
"
/>
<
source
>
King
Nothing
<
/source
>
<
translation
>
虚无之王
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
84
"
/>
<
source
>
Paper
Moon
King
<
/source
>
<
translation
>
纸月之王
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
85
"
/>
<
source
>
Scary
Monster
<
/source
>
<
translation
>
骇人恶兽
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
85
"
/>
<
source
>
Mandom
<
/source
>
<
translation
>
男子领域
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
86
"
/>
<
source
>
20
th
Century
Boy
<
/source
>
<
translation
>
20
世纪男孩
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
86
"
/>
<
source
>
Tusk
Act
4
<
/source
>
<
translation
>
牙
Act
4
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
87
"
/>
<
source
>
Ball
Breaker
<
/source
>
<
translation
>
铁球破坏者
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
87
"
/>
<
source
>
Sex
Pistols
<
/source
>
<
translation
>
性感手枪
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
88
"
/>
<
source
>
D4C
•
Love
Train
<
/source
>
<
translation
>
D4C
•
爱之列车
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
88
"
/>
<
source
>
Born
This
Way
<
/source
>
<
translation
>
天生完美
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
89
"
/>
<
source
>
SOFT
&
amp
;
WET
<
/source
>
<
translation
>
软又湿
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
89
"
/>
<
source
>
Paisley
Park
<
/source
>
<
translation
>
佩斯利公园
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
90
"
/>
<
source
>
Wonder
of
U
<
/source
>
<
translation
>
奇迹于你
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
90
"
/>
<
source
>
Walking
Heart
<
/source
>
<
translation
>
行走的心
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
91
"
/>
<
source
>
Cream
Starter
<
/source
>
<
translation
>
护霜旅行者
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
91
"
/>
<
source
>
November
Rain
<
/source
>
<
translation
>
十一月雨
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
92
"
/>
<
source
>
Smooth
Operators
<
/source
>
<
translation
>
调情圣手
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
92
"
/>
<
source
>
The
Matte
Kudasai
<
/source
>
<
translation
>
片刻静候
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
79
"
/>
<
source
>
Killer
Queen
<
/source
>
<
translation
>
杀手皇后
💀
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
MainWindow
<
/name
>
<
message
>
...
...
@@ -921,27 +1104,27 @@
<
context
>
<
name
>
TableFrame
<
/name
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
1
07
"
/>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
1
46
"
/>
<
source
>
Title
<
/source
>
<
translation
>
标题
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
1
07
"
/>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
1
46
"
/>
<
source
>
Artist
<
/source
>
<
translation
>
歌手
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
1
07
"
/>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
1
46
"
/>
<
source
>
Album
<
/source
>
<
translation
>
专辑
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
1
07
"
/>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
1
46
"
/>
<
source
>
Year
<
/source
>
<
translation
>
年份
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
1
07
"
/>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
1
46
"
/>
<
source
>
Duration
<
/source
>
<
translation
>
时长
<
/translation
>
<
/message
>
...
...
@@ -1073,32 +1256,32 @@
<
context
>
<
name
>
TreeFrame
<
/name
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
66
"
/>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
105
"
/>
<
source
>
JoJo
1
-
Phantom
Blood
<
/source
>
<
translation
>
JoJo
1
-
幻影之血
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
67
"
/>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
106
"
/>
<
source
>
Jonathan
Joestar
<
/source
>
<
translation
>
乔纳森
·
乔斯达
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
67
"
/>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
106
"
/>
<
source
>
Dio
Brando
<
/source
>
<
translation
>
迪奥
·
布兰度
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
67
"
/>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
106
"
/>
<
source
>
Will
A
.
Zeppeli
<
/source
>
<
translation
>
威廉
·
A
·
齐贝林
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
74
"
/>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
113
"
/>
<
source
>
JoJo
3
-
Stardust
Crusaders
<
/source
>
<
translation
>
JoJo3
-
星尘斗士
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
75
"
/>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
114
"
/>
<
source
>
Jotaro
Kujo
<
/source
>
<
translation
><
/translation
>
<
/message
>
...
...
@@ -1106,19 +1289,24 @@
<
context
>
<
name
>
ViewInterface
<
/name
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
3
1
"
/>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
3
9
"
/>
<
source
>
A
simple
TreeView
<
/source
>
<
translation
>
简单的树状组件
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
38
"
/>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
46
"
/>
<
source
>
A
TreeView
with
Multi
-
selection
enabled
<
/source
>
<
translation
>
启用复选框的树状组件
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
23
"
/>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
31
"
/>
<
source
>
A
simple
TableView
<
/source
>
<
translation
>
简单的表格组件
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
24
"
/>
<
source
>
A
simple
ListView
<
/source
>
<
translation
>
简单的列表组件
<
/translation
>
<
/message
>
<
/context
>
<
/TS
>
examples/gallery/app/resource/i18n/gallery.zh_HK.qm
浏览文件 @
d2ccfcda
无法预览此类型文件
examples/gallery/app/resource/i18n/gallery.zh_HK.ts
浏览文件 @
d2ccfcda
...
...
@@ -360,6 +360,189 @@
<
translation
>
搜索圖標
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
ListFrame
<
/name
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
75
"
/>
<
source
>
Star
Platinum
<
/source
>
<
translation
>
白金之星
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
75
"
/>
<
source
>
Hierophant
Green
<
/source
>
<
translation
>
法皇之綠
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
76
"
/>
<
source
>
Made
in
Haven
<
/source
>
<
translation
>
天堂製造
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
76
"
/>
<
source
>
King
Crimson
<
/source
>
<
translation
>
緋紅之王
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
77
"
/>
<
source
>
Silver
Chariot
<
/source
>
<
translation
>
銀色戰車
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
77
"
/>
<
source
>
Crazy
diamond
<
/source
>
<
translation
>
瘋狂鑽石
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
78
"
/>
<
source
>
Metallica
<
/source
>
<
translation
>
金屬製品
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
78
"
/>
<
source
>
Another
One
Bites
The
Dust
<
/source
>
<
translation
>
敗者食塵
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
79
"
/>
<
source
>
Heaven
&
apos
;
s
Door
<
/source
>
<
translation
>
黑蚊子多
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
80
"
/>
<
source
>
The
Grateful
Dead
<
/source
>
<
translation
>
壯烈成仁
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
80
"
/>
<
source
>
Stone
Free
<
/source
>
<
translation
>
石之自由
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
81
"
/>
<
source
>
The
World
<
/source
>
<
translation
>
砸瓦魯多
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
81
"
/>
<
source
>
Sticky
Fingers
<
/source
>
<
translation
>
鋼鏈手指
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
82
"
/>
<
source
>
Ozone
Baby
<
/source
>
<
translation
>
臭氧寶寶
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
82
"
/>
<
source
>
Love
Love
Deluxe
<
/source
>
<
translation
>
華麗摯愛
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
83
"
/>
<
source
>
Hermit
Purple
<
/source
>
<
translation
>
隱者之紫
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
83
"
/>
<
source
>
Gold
Experience
<
/source
>
<
translation
>
黃金體驗
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
84
"
/>
<
source
>
King
Nothing
<
/source
>
<
translation
>
虛無之王
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
84
"
/>
<
source
>
Paper
Moon
King
<
/source
>
<
translation
>
紙月之王
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
85
"
/>
<
source
>
Scary
Monster
<
/source
>
<
translation
>
駭人惡獸
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
85
"
/>
<
source
>
Mandom
<
/source
>
<
translation
>
男子領域
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
86
"
/>
<
source
>
20
th
Century
Boy
<
/source
>
<
translation
>
20
世紀男孩
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
86
"
/>
<
source
>
Tusk
Act
4
<
/source
>
<
translation
>
牙
Act
4
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
87
"
/>
<
source
>
Ball
Breaker
<
/source
>
<
translation
>
鐵球破壞者
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
87
"
/>
<
source
>
Sex
Pistols
<
/source
>
<
translation
>
性感手槍
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
88
"
/>
<
source
>
D4C
•
Love
Train
<
/source
>
<
translation
>
D4C
•
愛之列車
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
88
"
/>
<
source
>
Born
This
Way
<
/source
>
<
translation
>
天生完美
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
89
"
/>
<
source
>
SOFT
&
amp
;
WET
<
/source
>
<
translation
>
軟又濕
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
89
"
/>
<
source
>
Paisley
Park
<
/source
>
<
translation
>
佩斯利公園
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
90
"
/>
<
source
>
Wonder
of
U
<
/source
>
<
translation
>
奇蹟於你
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
90
"
/>
<
source
>
Walking
Heart
<
/source
>
<
translation
>
行走的心
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
91
"
/>
<
source
>
Cream
Starter
<
/source
>
<
translation
>
護霜旅行者
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
91
"
/>
<
source
>
November
Rain
<
/source
>
<
translation
>
十一月雨
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
92
"
/>
<
source
>
Smooth
Operators
<
/source
>
<
translation
>
調情聖手
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
92
"
/>
<
source
>
The
Matte
Kudasai
<
/source
>
<
translation
>
片刻靜候
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
79
"
/>
<
source
>
Killer
Queen
<
/source
>
<
translation
>
殺手皇后
💀
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
MainWindow
<
/name
>
<
message
>
...
...
@@ -921,27 +1104,27 @@
<
context
>
<
name
>
TableFrame
<
/name
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
1
07
"
/>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
1
46
"
/>
<
source
>
Title
<
/source
>
<
translation
>
標題
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
1
07
"
/>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
1
46
"
/>
<
source
>
Artist
<
/source
>
<
translation
>
歌手
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
1
07
"
/>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
1
46
"
/>
<
source
>
Album
<
/source
>
<
translation
>
專輯
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
1
07
"
/>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
1
46
"
/>
<
source
>
Year
<
/source
>
<
translation
>
年份
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
1
07
"
/>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
1
46
"
/>
<
source
>
Duration
<
/source
>
<
translation
>
時長
<
/translation
>
<
/message
>
...
...
@@ -1073,32 +1256,32 @@
<
context
>
<
name
>
TreeFrame
<
/name
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
66
"
/>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
105
"
/>
<
source
>
JoJo
1
-
Phantom
Blood
<
/source
>
<
translation
>
JoJo
1
-
幻影之血
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
67
"
/>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
106
"
/>
<
source
>
Jonathan
Joestar
<
/source
>
<
translation
>
喬納森
·
喬斯達
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
67
"
/>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
106
"
/>
<
source
>
Dio
Brando
<
/source
>
<
translation
>
迪奧
·
布蘭度
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
67
"
/>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
106
"
/>
<
source
>
Will
A
.
Zeppeli
<
/source
>
<
translation
>
威廉
·
A
·
齊貝林
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
74
"
/>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
113
"
/>
<
source
>
JoJo
3
-
Stardust
Crusaders
<
/source
>
<
translation
>
JoJo3
-
星塵鬥士
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
75
"
/>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
114
"
/>
<
source
>
Jotaro
Kujo
<
/source
>
<
translation
><
/translation
>
<
/message
>
...
...
@@ -1106,19 +1289,24 @@
<
context
>
<
name
>
ViewInterface
<
/name
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
3
1
"
/>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
3
9
"
/>
<
source
>
A
simple
TreeView
<
/source
>
<
translation
>
簡單的樹狀組件
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
38
"
/>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
46
"
/>
<
source
>
A
TreeView
with
Multi
-
selection
enabled
<
/source
>
<
translation
>
啓用複選框的樹狀組件
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
23
"
/>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
31
"
/>
<
source
>
A
simple
TableView
<
/source
>
<
translation
>
簡單的表格組件
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
24
"
/>
<
source
>
A
simple
ListView
<
/source
>
<
translation
>
簡單的列表組件
<
/translation
>
<
/message
>
<
/context
>
<
/TS
>
examples/gallery/app/view/home_interface.py
浏览文件 @
d2ccfcda
...
...
@@ -341,13 +341,21 @@ class HomeInterface(ScrollArea):
# view samples
collectionView
=
SampleCardView
(
self
.
tr
(
'View samples'
),
self
.
view
)
collectionView
.
addSampleCard
(
icon
=
":/gallery/images/controls/ListView.png"
,
title
=
"ListView"
,
content
=
self
.
tr
(
"A control that presents a collection of items in a vertical list."
),
routeKey
=
"viewInterface"
,
index
=
0
)
collectionView
.
addSampleCard
(
icon
=
":/gallery/images/controls/DataGrid.png"
,
title
=
"TableView"
,
content
=
self
.
tr
(
"The DataGrid control provides a flexible way to display a collection of data in rows and columns."
),
routeKey
=
"viewInterface"
,
index
=
0
index
=
1
)
collectionView
.
addSampleCard
(
icon
=
":/gallery/images/controls/TreeView.png"
,
...
...
@@ -355,6 +363,6 @@ class HomeInterface(ScrollArea):
content
=
self
.
tr
(
"The TreeView control is a hierarchical list pattern with expanding and collapsing nodes that contain nested items."
),
routeKey
=
"viewInterface"
,
index
=
1
index
=
2
)
self
.
vBoxLayout
.
addWidget
(
collectionView
)
examples/gallery/app/view/scroll_interface.py
浏览文件 @
d2ccfcda
...
...
@@ -44,7 +44,7 @@ class ScrollInterface(GalleryInterface):
label
.
setPixmap
(
QPixmap
(
":/gallery/images/chidanta3.jpg"
))
w
.
setWidget
(
label
)
w
.
setFixedSize
(
6
54
,
540
)
w
.
setFixedSize
(
6
60
,
540
)
w
.
setObjectName
(
'imageViewer'
)
card
=
self
.
addExampleCard
(
...
...
examples/gallery/app/view/view_interface.py
浏览文件 @
d2ccfcda
# coding:utf-8
from
PyQt5.QtCore
import
Qt
from
PyQt5.QtWidgets
import
QWidget
,
QFrame
,
QTreeWidgetItem
,
QHBoxLayout
,
QTreeWidgetItemIterator
,
QTableWidgetItem
from
qfluentwidgets
import
TreeWidget
,
TableWidget
from
PyQt5.QtWidgets
import
(
QListWidgetItem
,
QFrame
,
QTreeWidgetItem
,
QHBoxLayout
,
QTreeWidgetItemIterator
,
QTableWidgetItem
)
from
qfluentwidgets
import
TreeWidget
,
TableWidget
,
ListWidget
from
.gallery_interface
import
GalleryInterface
from
..common.translator
import
Translator
...
...
@@ -19,6 +20,13 @@ class ViewInterface(GalleryInterface):
parent
=
parent
)
# list view
self
.
addExampleCard
(
title
=
self
.
tr
(
'A simple ListView'
),
widget
=
ListFrame
(
self
),
sourcePath
=
'https://github.com/zhiyiYo/PyQt-Fluent-Widgets/blob/master/examples/list_view/demo.py'
)
# table view
self
.
addExampleCard
(
title
=
self
.
tr
(
'A simple TableView'
),
...
...
@@ -56,6 +64,39 @@ class Frame(QFrame):
self
.
hBoxLayout
.
addWidget
(
widget
)
class
ListFrame
(
Frame
):
def
__init__
(
self
,
parent
=
None
):
super
().
__init__
(
parent
)
self
.
listWidget
=
ListWidget
(
self
)
self
.
addWidget
(
self
.
listWidget
)
stands
=
[
self
.
tr
(
"Star Platinum"
),
self
.
tr
(
"Hierophant Green"
),
self
.
tr
(
"Made in Haven"
),
self
.
tr
(
"King Crimson"
),
self
.
tr
(
"Silver Chariot"
),
self
.
tr
(
"Crazy diamond"
),
self
.
tr
(
"Metallica"
),
self
.
tr
(
"Another One Bites The Dust"
),
self
.
tr
(
"Heaven's Door"
),
self
.
tr
(
"Killer Queen"
),
self
.
tr
(
"The Grateful Dead"
),
self
.
tr
(
"Stone Free"
),
self
.
tr
(
"The World"
),
self
.
tr
(
"Sticky Fingers"
),
self
.
tr
(
"Ozone Baby"
),
self
.
tr
(
"Love Love Deluxe"
),
self
.
tr
(
"Hermit Purple"
),
self
.
tr
(
"Gold Experience"
),
self
.
tr
(
"King Nothing"
),
self
.
tr
(
"Paper Moon King"
),
self
.
tr
(
"Scary Monster"
),
self
.
tr
(
"Mandom"
),
self
.
tr
(
"20th Century Boy"
),
self
.
tr
(
"Tusk Act 4"
),
self
.
tr
(
"Ball Breaker"
),
self
.
tr
(
"Sex Pistols"
),
self
.
tr
(
"D4C • Love Train"
),
self
.
tr
(
"Born This Way"
),
self
.
tr
(
"SOFT & WET"
),
self
.
tr
(
"Paisley Park"
),
self
.
tr
(
"Wonder of U"
),
self
.
tr
(
"Walking Heart"
),
self
.
tr
(
"Cream Starter"
),
self
.
tr
(
"November Rain"
),
self
.
tr
(
"Smooth Operators"
),
self
.
tr
(
"The Matte Kudasai"
)
]
for
stand
in
stands
:
self
.
listWidget
.
addItem
(
QListWidgetItem
(
stand
))
self
.
setFixedSize
(
300
,
380
)
class
TreeFrame
(
Frame
):
def
__init__
(
self
,
parent
=
None
,
enableCheck
=
False
):
...
...
@@ -147,4 +188,4 @@ class TableFrame(Frame):
self
.
table
.
setItem
(
i
,
j
,
QTableWidgetItem
(
songInfo
[
j
]))
self
.
setFixedSize
(
650
,
440
)
self
.
table
.
resizeColumnsToContents
()
\ No newline at end of file
self
.
table
.
resizeColumnsToContents
()
examples/list_view/demo.py
0 → 100644
浏览文件 @
d2ccfcda
# coding: utf-8
import
sys
from
PyQt5.QtCore
import
Qt
from
PyQt5.QtGui
import
QIcon
from
PyQt5.QtWidgets
import
QApplication
,
QListWidgetItem
,
QListWidget
,
QWidget
,
QHBoxLayout
from
qfluentwidgets
import
ListView
,
setTheme
,
Theme
,
ListWidget
class
Demo
(
QWidget
):
def
__init__
(
self
):
super
().
__init__
()
# setTheme(Theme.DARK)
self
.
hBoxLayout
=
QHBoxLayout
(
self
)
self
.
listWidget
=
ListWidget
(
self
)
# self.listWidget.setAlternatingRowColors(True)
stands
=
[
'白金之星'
,
'绿色法皇'
,
"天堂制造"
,
"绯红之王"
,
'银色战车'
,
'疯狂钻石'
,
"壮烈成仁"
,
"败者食尘"
,
"黑蚊子多"
,
'杀手皇后'
,
"金属制品"
,
"石之自由"
,
"砸瓦鲁多"
,
'钢链手指'
,
"臭氧宝宝"
,
"华丽挚爱"
,
"隐者之紫"
,
"黄金体验"
,
"虚无之王"
,
"纸月之王"
,
"骇人恶兽"
,
"男子领域"
,
"20世纪男孩"
,
"牙 Act 4"
,
"铁球破坏者"
,
"性感手枪"
,
'D4C • 爱之列车'
,
"天生完美"
,
"软又湿"
,
"佩斯利公园"
,
"奇迹于你"
,
"行走的心"
,
"护霜旅行者"
,
"十一月雨"
,
"调情圣手"
,
"片刻静候"
]
for
stand
in
stands
:
item
=
QListWidgetItem
(
stand
)
# item.setIcon(QIcon('docs/source/_static/logo.png'))
# item.setCheckState(Qt.Unchecked)
self
.
listWidget
.
addItem
(
item
)
self
.
setStyleSheet
(
"Demo{background: rgb(249, 249, 249)} "
)
self
.
hBoxLayout
.
setContentsMargins
(
0
,
0
,
0
,
0
)
self
.
hBoxLayout
.
addWidget
(
self
.
listWidget
)
self
.
resize
(
300
,
400
)
if
__name__
==
"__main__"
:
# enable dpi scale
QApplication
.
setHighDpiScaleFactorRoundingPolicy
(
Qt
.
HighDpiScaleFactorRoundingPolicy
.
PassThrough
)
QApplication
.
setAttribute
(
Qt
.
AA_EnableHighDpiScaling
)
QApplication
.
setAttribute
(
Qt
.
AA_UseHighDpiPixmaps
)
app
=
QApplication
(
sys
.
argv
)
w
=
Demo
()
w
.
show
()
app
.
exec
()
qfluentwidgets/_rc/qss/dark/list_view.qss
0 → 100644
浏览文件 @
d2ccfcda
QListView {
background: transparent;
outline: none;
border: none;
font: 13px 'Segoe UI', 'Microsoft YaHei';
selection-background-color: transparent;
alternate-background-color: transparent;
padding-left: 4px;
padding-right: 4px;
}
QListView::item {
background: transparent;
border: 0px;
padding-left: 11px;
padding-right: 11px;
height: 35px;
}
QListView::indicator {
width: 18px;
height: 18px;
border-radius: 5px;
border: 1px solid rgba(255, 255, 255, 0.5547);
background-color: rgba(0, 0, 0, 0.1);
margin-right: 4px;
}
QListView::indicator:hover {
border: 1px solid rgba(255, 255, 255, 0.5547);
background-color: rgba(255, 255, 255, 0.0419);
}
QListView::indicator:pressed {
border: 1px solid rgba(255, 255, 255, 0.1581);
background-color: rgba(255, 255, 255, 0.0698);
}
QListView::indicator:checked,
QListView::indicator:indeterminate {
border: 1px solid --ThemeColorPrimary;
background-color: --ThemeColorPrimary;
}
QListView::indicator:checked {
image: url(:/qfluentwidgets/images/check_box/Accept_black.svg);
}
QListView::indicator:indeterminate {
image: url(:/qfluentwidgets/images/check_box/PartialAccept_black.svg);
}
QListView::indicator:checked:hover,
QListView::indicator:indeterminate:hover {
border: 1px solid --ThemeColorLight1;
background-color: --ThemeColorLight1;
}
QListView::indicator:checked:pressed,
QListView::indicator:indeterminate:pressed {
border: 1px solid --ThemeColorLight3;
background-color: --ThemeColorLight3;
}
QListView::indicator:disabled {
border: 1px solid rgba(255, 255, 255, 0.1581);
background-color: transparent
}
QListView::indicator:checked:disabled,
QListView::indicator:indeterminate:disabled {
border: 1px solid rgb(82, 82, 82);
background-color: rgb(82, 82, 82);
}
\ No newline at end of file
qfluentwidgets/_rc/qss/dark/table_view.qss
浏览文件 @
d2ccfcda
...
...
@@ -4,6 +4,7 @@ QTableView {
border: none;
font: 13px 'Segoe UI', 'Microsoft YaHei';
selection-background-color: transparent;
alternate-background-color: transparent;
}
QTableView::item {
...
...
qfluentwidgets/_rc/qss/light/list_view.qss
0 → 100644
浏览文件 @
d2ccfcda
QListView {
background: transparent;
outline: none;
border: none;
font: 13px 'Segoe UI', 'Microsoft YaHei';
selection-background-color: transparent;
alternate-background-color: transparent;
padding-left: 4px;
padding-right: 4px;
}
QListView::item {
background: transparent;
border: 0px;
padding-left: 11px;
padding-right: 11px;
height: 35px;
}
QListView::indicator {
width: 18px;
height: 18px;
border-radius: 5px;
border: 1px solid rgba(0, 0, 0, 0.48);
background-color: rgba(0, 0, 0, 0.022);
margin-right: 4px;
}
QListView::indicator:hover {
border: 1px solid rgba(0, 0, 0, 0.56);
background-color: rgba(0, 0, 0, 0.05);
}
QListView::indicator:pressed {
border: 1px solid rgba(0, 0, 0, 0.27);
background-color: rgba(0, 0, 0, 0.12);
}
QListView::indicator:checked,
QListView::indicator:indeterminate {
border: 1px solid --ThemeColorPrimary;
background-color: --ThemeColorPrimary;
}
QListView::indicator:checked {
image: url(:/qfluentwidgets/images/check_box/Accept_white.svg);
}
QListView::indicator:indeterminate {
image: url(:/qfluentwidgets/images/check_box/PartialAccept_white.svg);
}
QListView::indicator:checked:hover,
QListView::indicator:indeterminate:hover {
border: 1px solid --ThemeColorLight1;
background-color: --ThemeColorLight1;
}
QListView::indicator:checked:pressed,
QListView::indicator:indeterminate:pressed {
border: 1px solid --ThemeColorLight3;
background-color: --ThemeColorLight3;
}
QListView::indicator:disabled {
border: 1px solid rgba(0, 0, 0, 0.27);
background-color: transparent;
}
QListView::indicator:checked:disabled,
QListView::indicator:indeterminate:disabled {
border: 1px solid rgb(199, 199, 199);
background-color: rgb(199, 199, 199);
}
qfluentwidgets/_rc/qss/light/table_view.qss
浏览文件 @
d2ccfcda
...
...
@@ -4,6 +4,7 @@ QTableView {
border: none;
font: 13px 'Segoe UI', 'Microsoft YaHei';
selection-background-color: transparent;
alternate-background-color: transparent;
}
QTableView::item {
...
...
qfluentwidgets/_rc/resource.py
浏览文件 @
d2ccfcda
此差异已折叠。
点击以展开。
qfluentwidgets/_rc/resource.qrc
浏览文件 @
d2ccfcda
...
...
@@ -222,6 +222,7 @@
<file>qss/dark/check_box.qss</file>
<file>qss/dark/info_bar.qss</file>
<file>qss/dark/spin_box.qss</file>
<file>qss/dark/list_view.qss</file>
<file>qss/dark/tree_view.qss</file>
<file>qss/dark/table_view.qss</file>
<file>qss/dark/time_picker.qss</file>
...
...
@@ -245,6 +246,7 @@
<file>qss/light/check_box.qss</file>
<file>qss/light/info_bar.qss</file>
<file>qss/light/spin_box.qss</file>
<file>qss/light/list_view.qss</file>
<file>qss/light/table_view.qss</file>
<file>qss/light/tree_view.qss</file>
<file>qss/light/time_picker.qss</file>
...
...
qfluentwidgets/common/style_sheet.py
浏览文件 @
d2ccfcda
...
...
@@ -96,6 +96,7 @@ class FluentStyleSheet(StyleSheetBase, Enum):
CHECK_BOX
=
"check_box"
COMBO_BOX
=
"combo_box"
LINE_EDIT
=
"line_edit"
LIST_VIEW
=
"list_view"
TREE_VIEW
=
"tree_view"
TABLE_VIEW
=
"table_view"
TIME_PICKER
=
"time_picker"
...
...
qfluentwidgets/components/widgets/__init__.py
浏览文件 @
d2ccfcda
...
...
@@ -6,6 +6,7 @@ from .combo_box import ComboBox, EditableComboBox
from
.line_edit
import
LineEdit
,
TextEdit
,
PlainTextEdit
,
LineEditButton
,
SearchLineEdit
from
.icon_widget
import
IconWidget
from
.label
import
PixmapLabel
from
.list_view
import
ListWidget
,
ListView
,
ListItemDelegate
from
.menu
import
DWMMenu
,
LineEditMenu
,
RoundMenu
from
.info_bar
import
InfoBar
,
InfoBarIcon
,
InfoBarPosition
from
.scroll_area
import
SingleDirectionScrollArea
,
SmoothMode
,
SmoothScrollArea
,
ScrollArea
...
...
qfluentwidgets/components/widgets/list_view.py
0 → 100644
浏览文件 @
d2ccfcda
# coding:utf-8
from
typing
import
List
from
PyQt5.QtCore
import
Qt
,
pyqtSignal
,
QModelIndex
from
PyQt5.QtGui
import
QPainter
from
PyQt5.QtWidgets
import
QStyleOptionViewItem
,
QListView
,
QWidget
,
QListView
,
QListWidget
from
.scroll_bar
import
SmoothScrollDelegate
from
.table_view
import
TableItemDelegate
from
...common.style_sheet
import
FluentStyleSheet
,
themeColor
class
ListItemDelegate
(
TableItemDelegate
):
""" List item delegate """
def
__init__
(
self
,
parent
:
QListView
):
super
().
__init__
(
parent
)
def
_drawBackground
(
self
,
painter
:
QPainter
,
option
:
QStyleOptionViewItem
,
index
:
QModelIndex
):
painter
.
drawRoundedRect
(
option
.
rect
,
5
,
5
)
def
_drawIndicator
(
self
,
painter
:
QPainter
,
option
:
QStyleOptionViewItem
,
index
:
QModelIndex
):
y
,
h
=
option
.
rect
.
y
(),
option
.
rect
.
height
()
ph
=
round
(
0.35
*
h
if
self
.
pressedRow
==
index
.
row
()
else
0.257
*
h
)
painter
.
setBrush
(
themeColor
())
painter
.
drawRoundedRect
(
0
,
ph
+
y
,
3
,
h
-
2
*
ph
,
1.5
,
1.5
)
class
ListBase
:
def
__init__
(
self
,
*
args
,
**
kwargs
):
super
().
__init__
(
*
args
,
**
kwargs
)
self
.
delegate
=
ListItemDelegate
(
self
)
self
.
scrollDelegate
=
SmoothScrollDelegate
(
self
)
FluentStyleSheet
.
LIST_VIEW
.
apply
(
self
)
self
.
setItemDelegate
(
self
.
delegate
)
self
.
setMouseTracking
(
True
)
self
.
entered
.
connect
(
lambda
i
:
self
.
setHoverRow
(
i
.
row
()))
self
.
pressed
.
connect
(
lambda
i
:
self
.
setPressedRow
(
i
.
row
()))
def
setHoverRow
(
self
,
row
:
int
):
""" set hovered row """
self
.
delegate
.
setHoverRow
(
row
)
self
.
viewport
().
update
()
def
setPressedRow
(
self
,
row
:
int
):
""" set pressed row """
self
.
delegate
.
setPressedRow
(
row
)
self
.
viewport
().
update
()
def
setSelectedRows
(
self
,
indexes
:
List
[
QModelIndex
]):
self
.
delegate
.
setSelectedRows
(
indexes
)
self
.
viewport
().
update
()
def
leaveEvent
(
self
,
e
):
QListView
.
leaveEvent
(
self
,
e
)
self
.
setHoverRow
(
-
1
)
def
resizeEvent
(
self
,
e
):
QListView
.
resizeEvent
(
self
,
e
)
self
.
viewport
().
update
()
def
keyPressEvent
(
self
,
e
):
QListView
.
keyPressEvent
(
self
,
e
)
self
.
setSelectedRows
(
self
.
selectedIndexes
())
def
mousePressEvent
(
self
,
e
):
if
e
.
button
()
==
Qt
.
LeftButton
:
QListView
.
mousePressEvent
(
self
,
e
)
else
:
self
.
setPressedRow
(
self
.
indexAt
(
e
.
pos
()).
row
())
def
mouseReleaseEvent
(
self
,
e
):
QListView
.
mouseReleaseEvent
(
self
,
e
)
row
=
self
.
indexAt
(
e
.
pos
()).
row
()
if
row
>=
0
and
e
.
button
()
!=
Qt
.
RightButton
:
self
.
setSelectedRows
(
self
.
selectedIndexes
())
else
:
self
.
setPressedRow
(
-
1
)
def
setItemDelegate
(
self
,
delegate
:
ListItemDelegate
):
self
.
delegate
=
delegate
super
().
setItemDelegate
(
delegate
)
class
ListWidget
(
ListBase
,
QListWidget
):
""" List widget """
def
__init__
(
self
,
parent
=
None
):
super
().
__init__
(
parent
)
class
ListView
(
ListBase
,
QListView
):
""" List view """
def
__init__
(
self
,
parent
=
None
):
super
().
__init__
(
parent
)
\ No newline at end of file
qfluentwidgets/components/widgets/scroll_bar.py
浏览文件 @
d2ccfcda
...
...
@@ -152,6 +152,7 @@ class ScrollBar(QWidget):
self
.
setRange
(
self
.
partnerBar
.
minimum
(),
self
.
partnerBar
.
maximum
())
self
.
setVisible
(
self
.
maximum
()
>
0
and
not
self
.
_isForceHidden
)
self
.
_adjustPos
(
self
.
parent
().
size
())
def
_onPageUp
(
self
):
self
.
setValue
(
self
.
value
()
-
self
.
pageStep
())
...
...
qfluentwidgets/components/widgets/table_view.py
浏览文件 @
d2ccfcda
...
...
@@ -70,6 +70,13 @@ class TableItemDelegate(QStyledItemDelegate):
rect
=
option
.
rect
.
adjusted
(
-
1
,
0
,
1
,
0
)
painter
.
drawRect
(
rect
)
def
_drawIndicator
(
self
,
painter
:
QPainter
,
option
:
QStyleOptionViewItem
,
index
:
QModelIndex
):
""" draw indicator """
y
,
h
=
option
.
rect
.
y
(),
option
.
rect
.
height
()
ph
=
round
(
0.35
*
h
if
self
.
pressedRow
==
index
.
row
()
else
0.257
*
h
)
painter
.
setBrush
(
themeColor
())
painter
.
drawRoundedRect
(
4
,
ph
+
y
,
3
,
h
-
2
*
ph
,
1.5
,
1.5
)
def
initStyleOption
(
self
,
option
:
QStyleOptionViewItem
,
index
:
QModelIndex
):
super
().
initStyleOption
(
option
,
index
)
if
isDarkTheme
():
...
...
@@ -94,7 +101,7 @@ class TableItemDelegate(QStyledItemDelegate):
# draw highlight background
isHover
=
self
.
hoverRow
==
index
.
row
()
isPressed
=
self
.
pressedRow
==
index
.
row
()
isAlternate
=
index
.
row
()
%
2
==
0
isAlternate
=
index
.
row
()
%
2
==
0
and
self
.
parent
().
alternatingRowColors
()
isDark
=
isDarkTheme
()
c
=
255
if
isDark
else
0
...
...
@@ -117,10 +124,7 @@ class TableItemDelegate(QStyledItemDelegate):
# draw indicator
if
index
.
column
()
==
0
and
self
.
parent
().
horizontalScrollBar
().
value
()
==
0
:
y
,
h
=
option
.
rect
.
y
()
,
option
.
rect
.
height
()
ph
=
round
(
0.35
*
h
if
isPressed
else
0.257
*
h
)
painter
.
setBrush
(
themeColor
())
painter
.
drawRoundedRect
(
4
,
ph
+
y
,
3
,
h
-
2
*
ph
,
1.5
,
1.5
)
self
.
_drawIndicator
(
painter
,
option
,
index
)
painter
.
setBrush
(
QColor
(
c
,
c
,
c
,
alpha
))
self
.
_drawBackground
(
painter
,
option
,
index
)
...
...
@@ -143,6 +147,7 @@ class TableBase:
self
.
setShowGrid
(
False
)
self
.
setMouseTracking
(
True
)
self
.
setAlternatingRowColors
(
True
)
self
.
setItemDelegate
(
self
.
delegate
)
self
.
setSelectionBehavior
(
TableWidget
.
SelectRows
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录