Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
k54kdk
PyQt Fluent Widgets
提交
92b0ca45
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看板
提交
92b0ca45
编写于
5月 23, 2023
作者:
之一Yo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixes #203, #221
上级
948dbde4
变更
35
展开全部
隐藏空白更改
内联
并排
Showing
35 changed file
with
291644 addition
and
291647 deletion
+291644
-291647
.github/ISSUE_TEMPLATE/bug_report.md
.github/ISSUE_TEMPLATE/bug_report.md
+1
-1
examples/gallery/app/common/resource.py
examples/gallery/app/common/resource.py
+214636
-214628
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
+11
-3
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
+36
-28
examples/gallery/app/view/navigation_view_interface.py
examples/gallery/app/view/navigation_view_interface.py
+2
-2
examples/navigation/demo.py
examples/navigation/demo.py
+8
-20
examples/navigation3/demo.py
examples/navigation3/demo.py
+17
-34
qfluentwidgets/__init__.py
qfluentwidgets/__init__.py
+1
-1
qfluentwidgets/_rc/qss/dark/button.qss
qfluentwidgets/_rc/qss/dark/button.qss
+2
-2
qfluentwidgets/_rc/qss/dark/line_edit.qss
qfluentwidgets/_rc/qss/dark/line_edit.qss
+1
-1
qfluentwidgets/_rc/qss/dark/list_view.qss
qfluentwidgets/_rc/qss/dark/list_view.qss
+1
-1
qfluentwidgets/_rc/qss/dark/spin_box.qss
qfluentwidgets/_rc/qss/dark/spin_box.qss
+1
-1
qfluentwidgets/_rc/qss/dark/table_view.qss
qfluentwidgets/_rc/qss/dark/table_view.qss
+1
-1
qfluentwidgets/_rc/qss/dark/tree_view.qss
qfluentwidgets/_rc/qss/dark/tree_view.qss
+1
-1
qfluentwidgets/_rc/qss/light/button.qss
qfluentwidgets/_rc/qss/light/button.qss
+2
-2
qfluentwidgets/_rc/qss/light/line_edit.qss
qfluentwidgets/_rc/qss/light/line_edit.qss
+1
-1
qfluentwidgets/_rc/qss/light/list_view.qss
qfluentwidgets/_rc/qss/light/list_view.qss
+1
-1
qfluentwidgets/_rc/qss/light/spin_box.qss
qfluentwidgets/_rc/qss/light/spin_box.qss
+1
-1
qfluentwidgets/_rc/qss/light/table_view.qss
qfluentwidgets/_rc/qss/light/table_view.qss
+1
-1
qfluentwidgets/_rc/qss/light/tree_view.qss
qfluentwidgets/_rc/qss/light/tree_view.qss
+1
-1
qfluentwidgets/_rc/resource.py
qfluentwidgets/_rc/resource.py
+76714
-76708
qfluentwidgets/common/__init__.py
qfluentwidgets/common/__init__.py
+1
-0
qfluentwidgets/common/font.py
qfluentwidgets/common/font.py
+31
-0
qfluentwidgets/components/navigation/__init__.py
qfluentwidgets/components/navigation/__init__.py
+2
-1
qfluentwidgets/components/navigation/navigation_interface.py
qfluentwidgets/components/navigation/navigation_interface.py
+28
-81
qfluentwidgets/components/navigation/navigation_panel.py
qfluentwidgets/components/navigation/navigation_panel.py
+48
-97
qfluentwidgets/components/navigation/navigation_widget.py
qfluentwidgets/components/navigation/navigation_widget.py
+67
-24
qfluentwidgets/components/widgets/button.py
qfluentwidgets/components/widgets/button.py
+5
-1
qfluentwidgets/components/widgets/line_edit.py
qfluentwidgets/components/widgets/line_edit.py
+4
-0
qfluentwidgets/components/widgets/spin_box.py
qfluentwidgets/components/widgets/spin_box.py
+2
-0
qfluentwidgets/components/widgets/table_view.py
qfluentwidgets/components/widgets/table_view.py
+2
-0
qfluentwidgets/components/widgets/tree_view.py
qfluentwidgets/components/widgets/tree_view.py
+13
-3
setup.py
setup.py
+1
-1
未找到文件。
.github/ISSUE_TEMPLATE/bug_report.md
浏览文件 @
92b0ca45
...
...
@@ -9,7 +9,7 @@ assignees: ''
<!-- 作者还是一名学生党,有更加重要的事情等着自己完成。一个复杂的组件往往要花一到两天来完成,不仅费时费力且无任何经济收入,所以只会抽出一些周末时间来维护这个项目,响应 issue 的速度可能很慢。新组件将按照爱发电上的目标达成情况进行添加,请不要提关于新组件需求的 issue。考虑到代码风格和日后维护,不接受新组件的 PR。如果真的很想要这个组件,可以在爱发电上支持作者的开发。
提 Issue 前请先搜索历史 Issue,可能有相似的,如果没有,需要补充完整模板要求的环境信息和最小复现代码,这很重要,不符合规范的 Issue 会被直接关闭哦。同时请注意礼貌用词,语句之间夹杂的阴阳怪气的省略号或者流汗黄豆绝对达咩 -->
提 Issue 前请先搜索历史 Issue,可能有相似的,如果没有,需要补充完整模板要求的环境信息和最小复现代码,
并确保自己安装的包是最新版本的,
这很重要,不符合规范的 Issue 会被直接关闭哦。同时请注意礼貌用词,语句之间夹杂的阴阳怪气的省略号或者流汗黄豆绝对达咩 -->
**Describe the bug**
A clear and concise description of what the bug is.
...
...
examples/gallery/app/common/resource.py
浏览文件 @
92b0ca45
此差异已折叠。
点击以展开。
examples/gallery/app/resource/i18n/gallery.zh_CN.qm
浏览文件 @
92b0ca45
无法预览此类型文件
examples/gallery/app/resource/i18n/gallery.zh_CN.ts
浏览文件 @
92b0ca45
...
...
@@ -717,20 +717,28 @@
<
translation
>
添加到
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
NavigationViewInterface
<
/name
>
<
message
>
<
location
filename
=
"
../../view/navigation_view_interface.py
"
line
=
"
22
"
/>
<
source
>
A
basic
pivot
<
/source
>
<
translation
>
顶部导航栏
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
PivotInterface
<
/name
>
<
message
>
<
location
filename
=
"
../../view/navigation_view_interface.py
"
line
=
"
4
4
"
/>
<
location
filename
=
"
../../view/navigation_view_interface.py
"
line
=
"
4
5
"
/>
<
source
>
Song
<
/source
>
<
translation
>
歌曲
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/navigation_view_interface.py
"
line
=
"
4
5
"
/>
<
location
filename
=
"
../../view/navigation_view_interface.py
"
line
=
"
4
6
"
/>
<
source
>
Album
<
/source
>
<
translation
>
专辑
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/navigation_view_interface.py
"
line
=
"
4
6
"
/>
<
location
filename
=
"
../../view/navigation_view_interface.py
"
line
=
"
4
7
"
/>
<
source
>
Artist
<
/source
>
<
translation
>
歌手
<
/translation
>
<
/message
>
...
...
examples/gallery/app/resource/i18n/gallery.zh_HK.qm
浏览文件 @
92b0ca45
无法预览此类型文件
examples/gallery/app/resource/i18n/gallery.zh_HK.ts
浏览文件 @
92b0ca45
...
...
@@ -96,7 +96,7 @@
<
message
>
<
location
filename
=
"
../../view/basic_input_interface.py
"
line
=
"
149
"
/>
<
source
>
Soft
and
Wet
<
/source
>
<
translation
>
軟又
濕
<
/translation
>
<
translation
>
軟又
溼
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/basic_input_interface.py
"
line
=
"
241
"
/>
...
...
@@ -121,7 +121,7 @@
<
message
>
<
location
filename
=
"
../../view/basic_input_interface.py
"
line
=
"
107
"
/>
<
source
>
Send
<
/source
>
<
translation
>
發
送
<
/translation
>
<
translation
>
髮
送
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/basic_input_interface.py
"
line
=
"
108
"
/>
...
...
@@ -234,7 +234,7 @@
<
message
>
<
location
filename
=
"
../../view/date_time_interface.py
"
line
=
"
41
"
/>
<
source
>
A
TimePicker
using
a
24
-
hour
clock
<
/source
>
<
translation
>
24
小時
制
的時間選擇器
<
/translation
>
<
translation
>
24
小時
製
的時間選擇器
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/date_time_interface.py
"
line
=
"
48
"
/>
...
...
@@ -354,7 +354,7 @@
<
message
>
<
location
filename
=
"
../../view/layout_interface.py
"
line
=
"
38
"
/>
<
source
>
Killer
Queen
<
/source
>
<
translation
>
殺手皇
后
💀
<
/translation
>
<
translation
>
殺手皇
後
💀
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/layout_interface.py
"
line
=
"
39
"
/>
...
...
@@ -382,7 +382,7 @@
<
message
>
<
location
filename
=
"
../../view/icon_interface.py
"
line
=
"
21
"
/>
<
source
>
Search
icons
<
/source
>
<
translation
>
搜
索圖標
<
/translation
>
<
translation
>
蒐
索圖標
<
/translation
>
<
/message
>
<
/context
>
<
context
>
...
...
@@ -485,7 +485,7 @@
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
85
"
/>
<
source
>
Scary
Monster
<
/source
>
<
translation
>
駭人
惡
獸
<
/translation
>
<
translation
>
駭人
噁
獸
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
85
"
/>
...
...
@@ -525,7 +525,7 @@
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
89
"
/>
<
source
>
SOFT
&
amp
;
WET
<
/source
>
<
translation
>
軟又
濕
<
/translation
>
<
translation
>
軟又
溼
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
89
"
/>
...
...
@@ -535,7 +535,7 @@
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
90
"
/>
<
source
>
Wonder
of
U
<
/source
>
<
translation
>
奇
蹟
於你
<
/translation
>
<
translation
>
奇
跡
於你
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
90
"
/>
...
...
@@ -565,7 +565,7 @@
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
79
"
/>
<
source
>
Killer
Queen
<
/source
>
<
translation
>
殺手皇
后
💀
<
/translation
>
<
translation
>
殺手皇
後
💀
<
/translation
>
<
/message
>
<
/context
>
<
context
>
...
...
@@ -717,20 +717,28 @@
<
translation
>
添加到
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
NavigationViewInterface
<
/name
>
<
message
>
<
location
filename
=
"
../../view/navigation_view_interface.py
"
line
=
"
22
"
/>
<
source
>
A
basic
pivot
<
/source
>
<
translation
>
頂部導航欄
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
PivotInterface
<
/name
>
<
message
>
<
location
filename
=
"
../../view/navigation_view_interface.py
"
line
=
"
4
4
"
/>
<
location
filename
=
"
../../view/navigation_view_interface.py
"
line
=
"
4
5
"
/>
<
source
>
Song
<
/source
>
<
translation
>
歌曲
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/navigation_view_interface.py
"
line
=
"
4
5
"
/>
<
location
filename
=
"
../../view/navigation_view_interface.py
"
line
=
"
4
6
"
/>
<
source
>
Album
<
/source
>
<
translation
>
專輯
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/navigation_view_interface.py
"
line
=
"
4
6
"
/>
<
location
filename
=
"
../../view/navigation_view_interface.py
"
line
=
"
4
7
"
/>
<
source
>
Artist
<
/source
>
<
translation
>
歌手
<
/translation
>
<
/message
>
...
...
@@ -763,7 +771,7 @@
<
message
>
<
location
filename
=
"
../../view/scroll_interface.py
"
line
=
"
56
"
/>
<
source
>
Chitanda
Eru
is
so
hot
🥵🥵
<
/source
>
<
translation
>
春寒賜浴華清池
,
温
泉水滑洗凝脂
🥵🥵
<
/translation
>
<
translation
>
春寒賜浴華清池
,
溫
泉水滑洗凝脂
🥵🥵
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/scroll_interface.py
"
line
=
"
67
"
/>
...
...
@@ -831,7 +839,7 @@
<
message
>
<
location
filename
=
"
../../view/setting_interface.py
"
line
=
"
85
"
/>
<
source
>
Use
system
setting
<
/source
>
<
translation
>
跟隨
系
統設置
<
/translation
>
<
translation
>
跟隨
繫
統設置
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/setting_interface.py
"
line
=
"
67
"
/>
...
...
@@ -846,7 +854,7 @@
<
message
>
<
location
filename
=
"
../../view/setting_interface.py
"
line
=
"
74
"
/>
<
source
>
Interface
zoom
<
/source
>
<
translation
>
界
面
縮放
<
/translation
>
<
translation
>
界
麵
縮放
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/setting_interface.py
"
line
=
"
74
"
/>
...
...
@@ -861,7 +869,7 @@
<
message
>
<
location
filename
=
"
../../view/setting_interface.py
"
line
=
"
85
"
/>
<
source
>
Set
your
preferred
language
for
UI
<
/source
>
<
translation
>
選擇界
面
所使用的語言
<
/translation
>
<
translation
>
選擇界
麵
所使用的語言
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/setting_interface.py
"
line
=
"
95
"
/>
...
...
@@ -886,12 +894,12 @@
<
message
>
<
location
filename
=
"
../../view/setting_interface.py
"
line
=
"
108
"
/>
<
source
>
Check
for
updates
when
the
application
starts
<
/source
>
<
translation
>
在應用程序
啓
動時檢查更新
<
/translation
>
<
translation
>
在應用程序
啟
動時檢查更新
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/setting_interface.py
"
line
=
"
108
"
/>
<
source
>
The
new
version
will
be
more
stable
and
have
more
features
<
/source
>
<
translation
>
新版本將更加穩定並擁有更多功能
(
建議
啓
用此選項
)
<
/translation
>
<
translation
>
新版本將更加穩定並擁有更多功能
(
建議
啟
用此選項
)
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/setting_interface.py
"
line
=
"
134
"
/>
...
...
@@ -901,7 +909,7 @@
<
message
>
<
location
filename
=
"
../../view/setting_interface.py
"
line
=
"
118
"
/>
<
source
>
Open
help
page
<
/source
>
<
translation
>
打開幫助頁
面
<
/translation
>
<
translation
>
打開幫助頁
麵
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/setting_interface.py
"
line
=
"
118
"
/>
...
...
@@ -911,7 +919,7 @@
<
message
>
<
location
filename
=
"
../../view/setting_interface.py
"
line
=
"
118
"
/>
<
source
>
Discover
new
features
and
learn
useful
tips
about
PyQt
-
Fluent
-
Widgets
<
/source
>
<
translation
>
發現新功能並瞭
解有關
PyQt
-
Fluent
-
Widgets
的使用技巧
<
/translation
>
<
translation
>
髮現新功能並了
解有關
PyQt
-
Fluent
-
Widgets
的使用技巧
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/setting_interface.py
"
line
=
"
127
"
/>
...
...
@@ -941,7 +949,7 @@
<
message
>
<
location
filename
=
"
../../view/setting_interface.py
"
line
=
"
192
"
/>
<
source
>
Configuration
takes
effect
after
restart
<
/source
>
<
translation
>
配置在重
啓
軟件後生效
<
/translation
>
<
translation
>
配置在重
啟
軟件後生效
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/setting_interface.py
"
line
=
"
192
"
/>
...
...
@@ -994,7 +1002,7 @@
<
message
>
<
location
filename
=
"
../../view/status_info_interface.py
"
line
=
"
179
"
/>
<
source
>
Please
wait
patiently
<
/source
>
<
translation
>
心急吃不了熱
豆
腐
,
請耐心等待哦
~<
/translation
>
<
translation
>
心急吃不了熱
荳
腐
,
請耐心等待哦
~<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/status_info_interface.py
"
line
=
"
181
"
/>
...
...
@@ -1059,7 +1067,7 @@
<
message
>
<
location
filename
=
"
../../view/status_info_interface.py
"
line
=
"
75
"
/>
<
source
>
My
name
is
kira
yoshikake
,
33
years
old
.
Living
in
the
villa
area
northeast
of
duwangting
,
unmarried
.
I
work
in
Guiyou
chain
store
.
Every
day
I
have
to
work
overtime
until
8
p
.
m
.
to
go
home
.
I
don
&
apos
;
t
smoke
.
The
wine
is
only
for
a
taste
.
Sleep
at
11
p
.
m
.
for
8
hours
a
day
.
Before
I
go
to
bed
,
I
must
drink
a
cup
of
warm
milk
,
then
do
20
minutes
of
soft
exercise
,
get
on
the
bed
,
and
immediately
fall
asleep
.
Never
leave
fatigue
and
stress
until
the
next
day
.
Doctors
say
I
&
apos
;
m
normal
.
<
/source
>
<
translation
>
我的名字是吉良吉影
,
年齡33歲
,
家住杜王町東北部別墅區
,
未婚
。
我在
“
龜友百貨連鎖公司
”
上班
,
每天最晚也是八點前回家
,
不吸
煙
,
酒也是淺嘗輒止
,
晚上十一點上牀
,
保證八個小時的充足睡眠
,
睡前喝一杯
熱牛奶
,
再做二十分鐘伸展運動暖身
,
然後再睡覺
,
基本可以熟睡到天亮
。
像嬰兒一樣不留下疲勞與壓力
,
迎來第二天的早晨
,
健康檢查結果也顯示我很健康
。
我的意思是我是一個隨時都想追求平靜生活的人
,
不拘泥於勝負與煩惱
,
不樹立令我夜不能寐的敵人
,
這就是我對於這個社會的生活態度
,
我也清楚這就是我的幸福
。
<
/translation
>
<
translation
>
我的名字是吉良吉影
,
年齡33歲
,
家住杜王町東北部別墅區
,
未婚
。
我在
“
龜友百貨連鎖公司
”
上班
,
每天最晚也是八點前回家
,
不吸
菸
,
酒也是淺嚐輒止
,
晚上十一點上床
,
保証八個小時的充足睡眠
,
睡前喝一盃
熱牛奶
,
再做二十分鐘伸展運動暖身
,
然後再睡覺
,
基本可以熟睡到天亮
。
像嬰兒一樣不留下疲勞與壓力
,
迎來第二天的早晨
,
健康檢查結果也顯示我很健康
。
我的意思是我是一個隨時都想追求平靜生活的人
,
不拘泥於勝負與煩惱
,
不樹立令我夜不能寐的敵人
,
這就是我對於這個社會的生活態度
,
我也清楚這就是我的幸福
。
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/status_info_interface.py
"
line
=
"
186
"
/>
...
...
@@ -1069,16 +1077,16 @@
<
message
>
<
location
filename
=
"
../../view/status_info_interface.py
"
line
=
"
186
"
/>
<
source
>
Believe
in
the
spin
,
just
keep
believing
!<
/source
>
<
translation
>
相信
迴旋吧
,
只
管相信就是了
!
<
/translation
>
<
translation
>
相信
回旋吧
,
隻
管相信就是了
!
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/status_info_interface.py
"
line
=
"
198
"
/>
<
source
>
With
respect
,
let
&
apos
;
s
advance
towards
a
new
stage
of
the
spin
.
<
/source
>
<
translation
>
表達敬意吧
,
表達出敬意
,
然後邁向
迴
旋的另一個全新階段
!
<
/translation
>
<
translation
>
表達敬意吧
,
表達出敬意
,
然後邁向
回
旋的另一個全新階段
!
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/status_info_interface.py
"
line
=
"
209
"
/>
<
source
>
迂
迴
路を行けば最短ルート
。
<
/source
>
<
source
>
迂
回
路を行けば最短ルート
。
<
/source
>
<
translation
>
最短的捷徑就是繞遠路
,
繞遠路才是我的最短捷徑
。
<
/translation
>
<
/message
>
<
message
>
...
...
@@ -1339,7 +1347,7 @@
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
108
"
/>
<
source
>
Dio
Brando
<
/source
>
<
translation
>
迪奧
·
布
蘭度
<
/translation
>
<
translation
>
迪奧
·
佈
蘭度
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
108
"
/>
...
...
@@ -1367,7 +1375,7 @@
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
46
"
/>
<
source
>
A
TreeView
with
Multi
-
selection
enabled
<
/source
>
<
translation
>
啓
用複選框的樹狀組件
<
/translation
>
<
translation
>
啟
用複選框的樹狀組件
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../view/view_interface.py
"
line
=
"
31
"
/>
...
...
examples/gallery/app/view/navigation_view_interface.py
浏览文件 @
92b0ca45
...
...
@@ -15,12 +15,12 @@ class NavigationViewInterface(GalleryInterface):
t
=
Translator
()
super
().
__init__
(
title
=
t
.
navigation
,
subtitle
=
"qfluentwidgets.components.
widgets
"
,
subtitle
=
"qfluentwidgets.components.
navigation
"
,
parent
=
parent
)
self
.
addExampleCard
(
title
=
'A basic pivot'
,
title
=
self
.
tr
(
'A basic pivot'
)
,
widget
=
PivotInterface
(
self
),
sourcePath
=
'https://github.com/zhiyiYo/PyQt-Fluent-Widgets/blob/master/examples/pivot/demo.py'
)
...
...
examples/navigation/demo.py
浏览文件 @
92b0ca45
...
...
@@ -108,10 +108,10 @@ class Window(FramelessWindow):
self
.
navigationInterface
.
addSeparator
()
self
.
add
TreeSubInterface
(
self
.
albumInterface
,
FIF
.
ALBUM
,
'Albums'
)
self
.
add
TreeSubInterface
(
self
.
albumInterface1
,
FIF
.
ALBUM
,
'Album 1'
,
self
.
albumInterface
)
self
.
add
TreeSubInterface
(
self
.
albumInterface1_1
,
FIF
.
ALBUM
,
'Album 1.1'
,
self
.
albumInterface1
)
self
.
add
TreeSubInterface
(
self
.
albumInterface2
,
FIF
.
ALBUM
,
'Album 2'
,
self
.
albumInterface
)
self
.
add
SubInterface
(
self
.
albumInterface
,
FIF
.
ALBUM
,
'Albums'
,
NavigationItemPosition
.
SCROLL
)
self
.
add
SubInterface
(
self
.
albumInterface1
,
FIF
.
ALBUM
,
'Album 1'
,
parent
=
self
.
albumInterface
)
self
.
add
SubInterface
(
self
.
albumInterface1_1
,
FIF
.
ALBUM
,
'Album 1.1'
,
parent
=
self
.
albumInterface1
)
self
.
add
SubInterface
(
self
.
albumInterface2
,
FIF
.
ALBUM
,
'Album 2'
,
parent
=
self
.
albumInterface
)
# add navigation items to scroll area
self
.
addSubInterface
(
self
.
folderInterface
,
FIF
.
FOLDER
,
'Folder library'
,
NavigationItemPosition
.
SCROLL
)
...
...
@@ -129,7 +129,7 @@ class Window(FramelessWindow):
routeKey
=
'avatar'
,
widget
=
AvatarWidget
(),
onClick
=
self
.
showMessageBox
,
position
=
NavigationItemPosition
.
BOTTOM
position
=
NavigationItemPosition
.
BOTTOM
,
)
self
.
addSubInterface
(
self
.
settingInterface
,
FIF
.
SETTING
,
'Settings'
,
NavigationItemPosition
.
BOTTOM
)
...
...
@@ -155,7 +155,7 @@ class Window(FramelessWindow):
self
.
setQss
()
def
addSubInterface
(
self
,
interface
,
icon
,
text
:
str
,
position
=
NavigationItemPosition
.
TOP
):
def
addSubInterface
(
self
,
interface
,
icon
,
text
:
str
,
position
=
NavigationItemPosition
.
TOP
,
parent
=
None
):
""" add sub interface """
self
.
stackWidget
.
addWidget
(
interface
)
self
.
navigationInterface
.
addItem
(
...
...
@@ -164,20 +164,8 @@ class Window(FramelessWindow):
text
=
text
,
onClick
=
lambda
:
self
.
switchTo
(
interface
),
position
=
position
,
tooltip
=
text
)
def
addTreeSubInterface
(
self
,
interface
,
icon
,
text
:
str
,
parent
=
None
):
""" add tree sub interface """
self
.
stackWidget
.
addWidget
(
interface
)
self
.
navigationInterface
.
addTreeItem
(
routeKey
=
interface
.
objectName
(),
icon
=
icon
,
text
=
text
,
onClick
=
lambda
:
self
.
switchTo
(
interface
),
position
=
NavigationItemPosition
.
SCROLL
,
tooltip
=
text
,
parentRouteKey
=
(
parent
.
objectName
()
if
parent
else
None
)
parentRouteKey
=
parent
.
objectName
()
if
parent
else
None
)
def
setQss
(
self
):
...
...
@@ -191,7 +179,7 @@ class Window(FramelessWindow):
def
onCurrentInterfaceChanged
(
self
,
index
):
widget
=
self
.
stackWidget
.
widget
(
index
)
self
.
navigationInterface
.
setCurrentItem
(
widget
.
objectName
())
#!IMPORTANT: This line of code needs to be uncommented if the return button is enabled
# qrouter.push(self.stackWidget, widget.objectName())
...
...
examples/navigation3/demo.py
浏览文件 @
92b0ca45
...
...
@@ -67,7 +67,7 @@ class NavigationBar(QWidget):
def
setCurrentItem
(
self
,
routeKey
:
str
):
self
.
navigationPanel
.
setCurrentItem
(
routeKey
)
self
.
setTitle
(
self
.
navigationPanel
.
items
[
routeKey
].
_text
)
self
.
setTitle
(
self
.
navigationPanel
.
widget
(
routeKey
).
text
()
)
def
eventFilter
(
self
,
obj
,
e
:
QEvent
):
if
obj
is
self
.
window
():
...
...
@@ -122,48 +122,31 @@ class Window(FramelessWindow):
self
.
vBoxLayout
.
setStretchFactor
(
self
.
stackWidget
,
1
)
def
initNavigation
(
self
):
self
.
navigationInterface
.
addItem
(
routeKey
=
self
.
searchInterface
.
objectName
(),
icon
=
FIF
.
SEARCH
,
text
=
'Search'
,
onClick
=
lambda
:
self
.
switchTo
(
self
.
searchInterface
)
)
self
.
navigationInterface
.
addItem
(
routeKey
=
self
.
musicInterface
.
objectName
(),
icon
=
FIF
.
MUSIC
,
text
=
'Music library'
,
onClick
=
lambda
:
self
.
switchTo
(
self
.
musicInterface
)
)
self
.
navigationInterface
.
addItem
(
routeKey
=
self
.
videoInterface
.
objectName
(),
icon
=
FIF
.
VIDEO
,
text
=
'Video library'
,
onClick
=
lambda
:
self
.
switchTo
(
self
.
videoInterface
)
)
self
.
addSubInterface
(
self
.
searchInterface
,
FIF
.
SEARCH
,
'Search'
)
self
.
addSubInterface
(
self
.
musicInterface
,
FIF
.
MUSIC
,
'Music library'
)
self
.
addSubInterface
(
self
.
videoInterface
,
FIF
.
VIDEO
,
'Video library'
)
self
.
navigationInterface
.
addSeparator
()
# add navigation items to scroll area
self
.
navigationInterface
.
addItem
(
routeKey
=
self
.
folderInterface
.
objectName
(),
icon
=
FIF
.
FOLDER
,
text
=
'Folder library'
,
onClick
=
lambda
:
self
.
switchTo
(
self
.
folderInterface
),
position
=
NavigationItemPosition
.
SCROLL
)
self
.
addSubInterface
(
self
.
folderInterface
,
FIF
.
FOLDER
,
'Folder library'
,
NavigationItemPosition
.
SCROLL
)
# add custom widget to bottom
self
.
navigationInterface
.
addItem
(
routeKey
=
self
.
settingInterface
.
objectName
(),
icon
=
FIF
.
SETTING
,
text
=
'Settings'
,
onClick
=
lambda
:
self
.
switchTo
(
self
.
settingInterface
),
position
=
NavigationItemPosition
.
BOTTOM
)
# add item to bottom
self
.
addSubInterface
(
self
.
settingInterface
,
FIF
.
SETTING
,
'Settings'
,
NavigationItemPosition
.
BOTTOM
)
self
.
stackWidget
.
currentChanged
.
connect
(
self
.
onCurrentInterfaceChanged
)
self
.
stackWidget
.
setCurrentIndex
(
1
)
def
addSubInterface
(
self
,
w
:
QWidget
,
icon
,
text
,
position
=
NavigationItemPosition
.
TOP
):
self
.
stackWidget
.
addWidget
(
w
)
self
.
navigationInterface
.
addItem
(
routeKey
=
w
.
objectName
(),
icon
=
icon
,
text
=
text
,
onClick
=
lambda
:
self
.
switchTo
(
w
),
position
=
position
)
def
initWindow
(
self
):
self
.
resize
(
500
,
600
)
self
.
setWindowIcon
(
QIcon
(
'resource/logo.png'
))
...
...
qfluentwidgets/__init__.py
浏览文件 @
92b0ca45
...
...
@@ -12,7 +12,7 @@ Examples are available at https://github.com/zhiyiYo/PyQt-Fluent-Widgets/tree/ma
:license: GPLv3, see LICENSE for more details.
"""
__version__
=
"0.9.
0
"
__version__
=
"0.9.
1
"
from
.components
import
*
from
.common
import
*
...
...
qfluentwidgets/_rc/qss/dark/button.qss
浏览文件 @
92b0ca45
...
...
@@ -4,7 +4,7 @@ PushButton, ToolButton, ToggleButton {
border-top: 1px solid rgba(255, 255, 255, 0.08);
border-radius: 5px;
color: white;
font: 14px 'Segoe UI', 'Microsoft YaHei';
/* font: 14px 'Segoe UI', 'Microsoft YaHei'; */
padding: 5px 12px 6px 12px;
outline: none;
}
...
...
@@ -120,7 +120,7 @@ PrimarySplitDropButton {
}
HyperlinkButton {
font: 14px 'Segoe UI', 'Microsoft YaHei';
/* font: 14px 'Segoe UI', 'Microsoft YaHei'; */
padding: 5px 12px 6px 12px;
color: --ThemeColorPrimary;
border: none;
...
...
qfluentwidgets/_rc/qss/dark/line_edit.qss
浏览文件 @
92b0ca45
...
...
@@ -3,7 +3,7 @@ LineEdit, TextEdit, PlainTextEdit {
border: 1px solid rgba(255, 255, 255, 0.08);
border-bottom: 1px solid rgba(255, 255, 255, 0.5442);
border-radius: 5px;
font: 14px "Segoe UI", "Microsoft YaHei";
/* font: 14px "Segoe UI", "Microsoft YaHei"; */
padding: 0px 10px;
color: white;
selection-background-color: --ThemeColorPrimary;
...
...
qfluentwidgets/_rc/qss/dark/list_view.qss
浏览文件 @
92b0ca45
...
...
@@ -3,7 +3,7 @@ ListWidget {
background: transparent;
outline: none;
border: none;
font: 13px 'Segoe UI', 'Microsoft YaHei';
/* font: 13px 'Segoe UI', 'Microsoft YaHei'; */
selection-background-color: transparent;
alternate-background-color: transparent;
padding-left: 4px;
...
...
qfluentwidgets/_rc/qss/dark/spin_box.qss
浏览文件 @
92b0ca45
...
...
@@ -7,7 +7,7 @@ TimeEdit {
border: 1px solid rgba(255, 255, 255, 0.08);
border-bottom: 1px solid rgba(255, 255, 255, 0.5442);
border-radius: 5px;
font: 14px "Segoe UI", "Microsoft YaHei";
/* font: 14px "Segoe UI", "Microsoft YaHei"; */
padding: 0px 80px 0 10px;
color: white;
selection-background-color: --ThemeColorPrimary;
...
...
qfluentwidgets/_rc/qss/dark/table_view.qss
浏览文件 @
92b0ca45
...
...
@@ -2,7 +2,7 @@ QTableView {
background: transparent;
outline: none;
border: none;
font: 13px 'Segoe UI', 'Microsoft YaHei';
/* font: 13px 'Segoe UI', 'Microsoft YaHei'; */
selection-background-color: transparent;
alternate-background-color: transparent;
}
...
...
qfluentwidgets/_rc/qss/dark/tree_view.qss
浏览文件 @
92b0ca45
...
...
@@ -4,7 +4,7 @@ QTreeView {
border-radius: 5px;
outline: 0;
padding-right: 5px;
font: 13px 'Segoe UI', 'Microsoft YaHei';
/* font: 13px 'Segoe UI', 'Microsoft YaHei'; */
selection-background-color: transparent;
}
...
...
qfluentwidgets/_rc/qss/light/button.qss
浏览文件 @
92b0ca45
...
...
@@ -4,7 +4,7 @@ PushButton, ToolButton, ToggleButton {
border: 1px solid rgba(0, 0, 0, 0.073);
border-bottom: 1px solid rgba(0, 0, 0, 0.183);
border-radius: 5px;
font: 14px 'Segoe UI', 'Microsoft YaHei';
/* font: 14px 'Segoe UI', 'Microsoft YaHei'; */
padding: 5px 12px 6px 12px;
outline: none;
}
...
...
@@ -120,7 +120,7 @@ PrimarySplitDropButton:pressed {
}
HyperlinkButton {
font: 14px 'Segoe UI', 'Microsoft YaHei';
/* font: 14px 'Segoe UI', 'Microsoft YaHei'; */
padding: 6px 12px 6px 12px;
color: --ThemeColorPrimary;
border: none;
...
...
qfluentwidgets/_rc/qss/light/line_edit.qss
浏览文件 @
92b0ca45
...
...
@@ -4,7 +4,7 @@ LineEdit, TextEdit, PlainTextEdit {
border: 1px solid rgba(0, 0, 0, 13);
border-bottom: 1px solid rgba(0, 0, 0, 100);
border-radius: 5px;
font: 14px "Segoe UI", "Microsoft YaHei";
/* font: 14px "Segoe UI", "Microsoft YaHei"; */
padding: 0px 10px;
selection-background-color: --ThemeColorLight1;
}
...
...
qfluentwidgets/_rc/qss/light/list_view.qss
浏览文件 @
92b0ca45
...
...
@@ -3,7 +3,7 @@ ListWidget {
background: transparent;
outline: none;
border: none;
font: 13px 'Segoe UI', 'Microsoft YaHei';
/* font: 13px 'Segoe UI', 'Microsoft YaHei'; */
selection-background-color: transparent;
alternate-background-color: transparent;
padding-left: 4px;
...
...
qfluentwidgets/_rc/qss/light/spin_box.qss
浏览文件 @
92b0ca45
...
...
@@ -4,7 +4,7 @@ SpinBox, DoubleSpinBox, DateEdit, DateTimeEdit, TimeEdit {
border: 1px solid rgba(0, 0, 0, 13);
border-bottom: 1px solid rgba(0, 0, 0, 100);
border-radius: 5px;
font: 14px "Segoe UI", "Microsoft YaHei";
/* font: 14px "Segoe UI", "Microsoft YaHei"; */
padding: 0px 80px 0 10px;
selection-background-color: --ThemeColorLight1;
}
...
...
qfluentwidgets/_rc/qss/light/table_view.qss
浏览文件 @
92b0ca45
...
...
@@ -2,7 +2,7 @@ QTableView {
background: transparent;
outline: none;
border: none;
font: 13px 'Segoe UI', 'Microsoft YaHei';
/* font: 13px 'Segoe UI', 'Microsoft YaHei'; */
selection-background-color: transparent;
alternate-background-color: transparent;
}
...
...
qfluentwidgets/_rc/qss/light/tree_view.qss
浏览文件 @
92b0ca45
...
...
@@ -4,7 +4,7 @@ QTreeView {
border-radius: 5px;
outline: 0;
padding-right: 5px;
font: 13px 'Segoe UI', 'Microsoft YaHei';
/* font: 13px 'Segoe UI', 'Microsoft YaHei'; */
selection-background-color: transparent;
}
...
...
qfluentwidgets/_rc/resource.py
浏览文件 @
92b0ca45
此差异已折叠。
点击以展开。
qfluentwidgets/common/__init__.py
浏览文件 @
92b0ca45
from
.config
import
*
from
.font
import
setFont
,
getFont
from
.auto_wrap
import
TextWrap
from
.icon
import
Action
,
Icon
,
getIconColor
,
drawSvgIcon
,
FluentIcon
,
drawIcon
,
FluentIconBase
,
writeSvg
from
.style_sheet
import
(
setStyleSheet
,
getStyleSheet
,
setTheme
,
ThemeColor
,
themeColor
,
...
...
qfluentwidgets/common/font.py
0 → 100644
浏览文件 @
92b0ca45
# coding: utf-8
from
PyQt5.QtGui
import
QFont
from
PyQt5.QtWidgets
import
QWidget
def
setFont
(
widget
:
QWidget
,
fontSize
=
14
):
""" set the font of widget
Parameters
----------
widget: QWidget
the widget to set font
fontSize: int
font pixel size
"""
widget
.
setFont
(
getFont
(
fontSize
))
def
getFont
(
fontSize
=
14
):
""" create font
Parameters
----------
fontSize: int
font pixel size
"""
font
=
QFont
()
font
.
setFamilies
([
'Segoe UI'
,
'Microsoft YaHei'
])
font
.
setPixelSize
(
fontSize
)
return
font
\ No newline at end of file
qfluentwidgets/components/navigation/__init__.py
浏览文件 @
92b0ca45
from
.navigation_widget
import
NavigationWidget
,
NavigationPushButton
,
NavigationSeparator
,
NavigationToolButton
from
.navigation_widget
import
(
NavigationWidget
,
NavigationPushButton
,
NavigationSeparator
,
NavigationToolButton
,
NavigationTreeWidget
,
NavigationTreeWidgetBase
)
from
.navigation_panel
import
NavigationPanel
,
NavigationItemPosition
,
NavigationDisplayMode
from
.navigation_interface
import
NavigationInterface
from
.pivot
import
Pivot
,
PivotItem
\ No newline at end of file
qfluentwidgets/components/navigation/navigation_interface.py
浏览文件 @
92b0ca45
...
...
@@ -6,7 +6,7 @@ from PyQt5.QtGui import QResizeEvent, QIcon
from
PyQt5.QtWidgets
import
QWidget
from
.navigation_panel
import
NavigationPanel
,
NavigationItemPosition
,
NavigationWidget
,
NavigationDisplayMode
from
.navigation_widget
import
Navigation
PushButton
from
.navigation_widget
import
Navigation
TreeWidget
from
...common.style_sheet
import
FluentStyleSheet
from
...common.icon
import
FluentIconBase
...
...
@@ -41,8 +41,9 @@ class NavigationInterface(QWidget):
self
.
setAttribute
(
Qt
.
WA_StyledBackground
)
FluentStyleSheet
.
NAVIGATION_INTERFACE
.
apply
(
self
)
def
addItem
(
self
,
routeKey
:
str
,
icon
:
Union
[
str
,
QIcon
,
FluentIconBase
],
text
:
str
,
onClick
=
None
,
selectable
=
True
,
position
=
NavigationItemPosition
.
TOP
,
tooltip
:
str
=
None
)
->
NavigationPushButton
:
def
addItem
(
self
,
routeKey
:
str
,
icon
:
Union
[
str
,
QIcon
,
FluentIconBase
],
text
:
str
,
onClick
=
None
,
selectable
=
True
,
position
=
NavigationItemPosition
.
TOP
,
tooltip
:
str
=
None
,
parentRouteKey
:
str
=
None
)
->
NavigationTreeWidget
:
""" add navigation item
Parameters
...
...
@@ -65,45 +66,16 @@ class NavigationInterface(QWidget):
position: NavigationItemPosition
where the button is added
tooltip: str
the tooltip of item
"""
return
self
.
insertItem
(
-
1
,
routeKey
,
icon
,
text
,
onClick
,
selectable
,
position
,
tooltip
)
def
addTreeItem
(
self
,
routeKey
:
str
,
icon
:
Union
[
str
,
QIcon
,
FluentIconBase
],
text
:
str
,
onClick
=
None
,
selectable
=
True
,
position
=
NavigationItemPosition
.
SCROLL
,
tooltip
:
str
=
None
,
parentRouteKey
=
None
):
""" add navigation tree item
Parameters
----------
routeKey: str
the unique name of item
icon: str | QIcon | FluentIconBase
the icon of navigation item
text: str
the text of navigation item
onClick: callable
the slot connected to item clicked signal
position: NavigationItemPosition
where the button is added
selectable: bool
whether the item is selectable
tooltip: str
the tooltip of item
parentRouteKey: str
the route key of parent item
the route key of parent item
, the parent item should be `NavigationTreeWidgetBase`
"""
return
self
.
insert
Tree
Item
(
-
1
,
routeKey
,
icon
,
text
,
onClick
,
selectable
,
position
,
tooltip
,
parentRouteKey
)
return
self
.
insertItem
(
-
1
,
routeKey
,
icon
,
text
,
onClick
,
selectable
,
position
,
tooltip
,
parentRouteKey
)
def
addWidget
(
self
,
routeKey
:
str
,
widget
:
NavigationWidget
,
onClick
=
None
,
position
=
NavigationItemPosition
.
TOP
,
tooltip
:
str
=
None
):
tooltip
:
str
=
None
,
parentRouteKey
:
str
=
None
):
""" add custom widget
Parameters
...
...
@@ -118,15 +90,19 @@ class NavigationInterface(QWidget):
the slot connected to item clicked signal
position: NavigationItemPosition
where the
button
is added
where the
widget
is added
tooltip: str
the tooltip of widget
parentRouteKey: str
the route key of parent item, the parent item should be `NavigationTreeWidgetBase`
"""
self
.
insertWidget
(
-
1
,
routeKey
,
widget
,
onClick
,
position
,
tooltip
)
self
.
insertWidget
(
-
1
,
routeKey
,
widget
,
onClick
,
position
,
tooltip
,
parentRouteKey
)
def
insertItem
(
self
,
index
:
int
,
routeKey
:
str
,
icon
:
Union
[
str
,
QIcon
,
FluentIconBase
],
text
:
str
,
onClick
=
None
,
selectable
=
True
,
position
=
NavigationItemPosition
.
TOP
,
tooltip
:
str
=
None
)
->
NavigationPushButton
:
def
insertItem
(
self
,
index
:
int
,
routeKey
:
str
,
icon
:
Union
[
str
,
QIcon
,
FluentIconBase
],
text
:
str
,
onClick
=
None
,
selectable
=
True
,
position
=
NavigationItemPosition
.
TOP
,
tooltip
:
str
=
None
,
parentRouteKey
:
str
=
None
)
->
NavigationTreeWidget
:
""" insert navigation item
Parameters
...
...
@@ -150,55 +126,20 @@ class NavigationInterface(QWidget):
whether the item is selectable
position: NavigationItemPosition
where the button is added
tooltip: str
the tooltip of item
"""
button
=
self
.
panel
.
insertItem
(
index
,
routeKey
,
icon
,
text
,
onClick
,
selectable
,
position
,
tooltip
)
self
.
setMinimumHeight
(
self
.
panel
.
layoutMinHeight
())
return
button
def
insertTreeItem
(
self
,
index
:
int
,
routeKey
:
str
,
icon
:
Union
[
str
,
QIcon
,
FluentIconBase
],
text
:
str
,
onClick
=
None
,
selectable
=
True
,
position
=
NavigationItemPosition
.
SCROLL
,
tooltip
:
str
=
None
,
parentRouteKey
=
None
):
""" insert navigation tree item
Parameters
----------
index: int
the insert position of parent widget
routeKey: str
the unique name of item
icon: str | QIcon | FluentIconBase
the icon of navigation item
text: str
the text of navigation item
onClick: callable
the slot connected to item clicked signal
position: NavigationItemPosition
where the button is added
selectable: bool
whether the item is selectable
where the item is added
tooltip: str
the tooltip of item
parentRouteKey: str
the route key of parent item
the route key of parent item
, the parent item should be `NavigationTreeWidgetBase`
"""
button
=
self
.
panel
.
insertTreeItem
(
index
,
routeKey
,
icon
,
text
,
onClick
,
selectable
,
position
,
tooltip
,
parentRouteKey
)
w
=
self
.
panel
.
insertItem
(
index
,
routeKey
,
icon
,
text
,
onClick
,
selectable
,
position
,
tooltip
,
parentRouteKey
)
self
.
setMinimumHeight
(
self
.
panel
.
layoutMinHeight
())
return
button
return
w
def
insertWidget
(
self
,
index
:
int
,
routeKey
:
str
,
widget
:
NavigationWidget
,
onClick
=
None
,
position
=
NavigationItemPosition
.
TOP
,
tooltip
:
str
=
None
):
position
=
NavigationItemPosition
.
TOP
,
tooltip
:
str
=
None
,
parentRouteKey
:
str
=
None
):
""" insert custom widget
Parameters
...
...
@@ -216,12 +157,15 @@ class NavigationInterface(QWidget):
the slot connected to item clicked signal
position: NavigationItemPosition
where the
button
is added
where the
widget
is added
tooltip: str
the tooltip of widget
parentRouteKey: str
the route key of parent item, the parent item should be `NavigationTreeWidgetBase`
"""
self
.
panel
.
insertWidget
(
index
,
routeKey
,
widget
,
onClick
,
position
,
tooltip
)
self
.
panel
.
insertWidget
(
index
,
routeKey
,
widget
,
onClick
,
position
,
tooltip
,
parentRouteKey
)
self
.
setMinimumHeight
(
self
.
panel
.
layoutMinHeight
())
def
addSeparator
(
self
,
position
=
NavigationItemPosition
.
TOP
):
...
...
@@ -276,6 +220,9 @@ class NavigationInterface(QWidget):
""" set the maximum width """
self
.
panel
.
setExpandWidth
(
width
)
def
widget
(
self
,
routeKey
:
str
):
return
self
.
panel
.
widget
(
routeKey
)
def
eventFilter
(
self
,
obj
,
e
:
QEvent
):
if
obj
is
not
self
.
panel
or
e
.
type
()
!=
QEvent
.
Resize
:
return
super
().
eventFilter
(
obj
,
e
)
...
...
qfluentwidgets/components/navigation/navigation_panel.py
浏览文件 @
92b0ca45
...
...
@@ -6,7 +6,7 @@ from PyQt5.QtCore import Qt, QPropertyAnimation, QRect, QSize, QEvent, QEasingCu
from
PyQt5.QtGui
import
QResizeEvent
,
QIcon
from
PyQt5.QtWidgets
import
QWidget
,
QVBoxLayout
,
QFrame
,
QApplication
from
.navigation_widget
import
(
Navigation
PushButton
,
NavigationToolButton
,
NavigationWidget
,
NavigationSeparator
,
from
.navigation_widget
import
(
Navigation
TreeWidgetBase
,
NavigationToolButton
,
NavigationWidget
,
NavigationSeparator
,
NavigationTreeWidget
)
from
..widgets.scroll_area
import
SingleDirectionScrollArea
from
..widgets.tool_tip
import
ToolTipFilter
...
...
@@ -45,6 +45,14 @@ class RouteKeyError(Exception):
""" Route key error """
class
NavigationItem
:
""" Navigation item """
def
__init__
(
self
,
routeKey
:
str
,
parentRouteKey
:
str
,
widget
:
NavigationWidget
):
self
.
routeKey
=
routeKey
self
.
parentRouteKey
=
parentRouteKey
self
.
widget
=
widget
class
NavigationPanel
(
QFrame
):
""" Navigation panel """
...
...
@@ -68,7 +76,7 @@ class NavigationPanel(QFrame):
self
.
bottomLayout
=
NavigationItemLayout
()
self
.
scrollLayout
=
NavigationItemLayout
(
self
.
scrollWidget
)
self
.
items
=
{}
# type: Dict[str, Navigation
Widget
]
self
.
items
=
{}
# type: Dict[str, Navigation
Item
]
self
.
history
=
qrouter
self
.
expandAni
=
QPropertyAnimation
(
self
,
b
'geometry'
,
self
)
...
...
@@ -141,10 +149,10 @@ class NavigationPanel(QFrame):
if
routeKey
not
in
self
.
items
:
raise
RouteKeyError
(
f
"`
{
routeKey
}
` is illegal."
)
return
self
.
items
[
routeKey
]
return
self
.
items
[
routeKey
]
.
widget
def
addItem
(
self
,
routeKey
:
str
,
icon
:
Union
[
str
,
QIcon
,
FluentIconBase
],
text
:
str
,
onClick
=
None
,
selectable
=
True
,
position
=
NavigationItemPosition
.
TOP
,
tooltip
:
str
=
None
):
position
=
NavigationItemPosition
.
TOP
,
tooltip
:
str
=
None
,
parentRouteKey
:
str
=
None
):
""" add navigation item
Parameters
...
...
@@ -169,11 +177,14 @@ class NavigationPanel(QFrame):
tooltip: str
the tooltip of item
parentRouteKey: str
the route key of parent item, the parent widget should be `NavigationTreeWidget`
"""
return
self
.
insertItem
(
-
1
,
routeKey
,
icon
,
text
,
onClick
,
selectable
,
position
,
tooltip
)
return
self
.
insertItem
(
-
1
,
routeKey
,
icon
,
text
,
onClick
,
selectable
,
position
,
tooltip
,
parentRouteKey
)
def
addWidget
(
self
,
routeKey
:
str
,
widget
:
NavigationWidget
,
onClick
=
None
,
position
=
NavigationItemPosition
.
TOP
,
tooltip
:
str
=
None
):
tooltip
:
str
=
None
,
parentRouteKey
:
str
=
None
):
""" add custom widget
Parameters
...
...
@@ -192,81 +203,14 @@ class NavigationPanel(QFrame):
tooltip: str
the tooltip of widget
"""
self
.
insertWidget
(
-
1
,
routeKey
,
widget
,
onClick
,
position
,
tooltip
)
def
insertItem
(
self
,
index
:
int
,
routeKey
:
str
,
icon
:
Union
[
str
,
QIcon
,
FluentIconBase
],
text
:
str
,
onClick
=
None
,
selectable
=
True
,
position
=
NavigationItemPosition
.
TOP
,
tooltip
:
str
=
None
):
""" insert navigation item
Parameters
----------
index: int
insert position
routeKey: str
the unique name of item
icon: str | QIcon | FluentIconBase
the icon of navigation item
text: str
the text of navigation item
onClick: callable
the slot connected to item clicked signal
position: NavigationItemPosition
where the button is added
selectable: bool
whether the item is selectable
tooltip: str
the tooltip of item
"""
if
routeKey
in
self
.
items
:
return
button
=
NavigationPushButton
(
icon
,
text
,
selectable
,
self
)
self
.
insertWidget
(
index
,
routeKey
,
button
,
onClick
,
position
,
tooltip
)
return
button
def
addTreeItem
(
self
,
routeKey
:
str
,
icon
:
Union
[
str
,
QIcon
,
FluentIconBase
],
text
:
str
,
onClick
=
None
,
selectable
=
True
,
position
=
NavigationItemPosition
.
SCROLL
,
tooltip
:
str
=
None
,
parentRouteKey
=
None
):
""" add navigation tree item
Parameters
----------
routeKey: str
the unique name of item
icon: str | QIcon | FluentIconBase
the icon of navigation item
text: str
the text of navigation item
onClick: callable
the slot connected to item clicked signal
position: NavigationItemPosition
where the button is added
selectable: bool
whether the item is selectable
tooltip: str
the tooltip of item
parentRouteKey: str
the route key of parent item
the route key of parent item
, the parent item should be `NavigationTreeWidget`
"""
return
self
.
insertTreeItem
(
-
1
,
routeKey
,
icon
,
text
,
onClick
,
selectable
,
position
,
tooltip
,
parentRouteKey
)
self
.
insertWidget
(
-
1
,
routeKey
,
widget
,
onClick
,
position
,
tooltip
,
parentRouteKey
)
def
insert
Tree
Item
(
self
,
index
:
int
,
routeKey
:
str
,
icon
:
Union
[
str
,
QIcon
,
FluentIconBase
],
text
:
str
,
onClick
=
None
,
selectable
=
True
,
position
=
NavigationItemPosition
.
SCROLL
,
tooltip
:
str
=
None
,
parentRouteKey
=
None
):
def
insertItem
(
self
,
index
:
int
,
routeKey
:
str
,
icon
:
Union
[
str
,
QIcon
,
FluentIconBase
],
text
:
str
,
onClick
=
None
,
selectable
=
True
,
position
=
NavigationItemPosition
.
TOP
,
tooltip
:
str
=
None
,
parentRouteKey
=
None
):
""" insert navigation tree item
Parameters
...
...
@@ -296,22 +240,17 @@ class NavigationPanel(QFrame):
the tooltip of item
parentRouteKey: str
the route key of parent item
the route key of parent item
, the parent item should be `NavigationTreeWidget`
"""
if
routeKey
in
self
.
items
:
return
w
=
NavigationTreeWidget
(
icon
,
text
,
selectable
,
self
)
if
parentRouteKey
:
self
.
_registerWidget
(
routeKey
,
w
,
onClick
,
tooltip
)
self
.
widget
(
parentRouteKey
).
insertChild
(
index
,
w
)
else
:
self
.
insertWidget
(
index
,
routeKey
,
w
,
onClick
,
position
,
tooltip
)
self
.
insertWidget
(
index
,
routeKey
,
w
,
onClick
,
position
,
tooltip
,
parentRouteKey
)
return
w
def
insertWidget
(
self
,
index
:
int
,
routeKey
:
str
,
widget
:
NavigationWidget
,
onClick
=
None
,
position
=
NavigationItemPosition
.
TOP
,
tooltip
:
str
=
None
):
position
=
NavigationItemPosition
.
TOP
,
tooltip
:
str
=
None
,
parentRouteKey
:
str
=
None
):
""" insert custom widget
Parameters
...
...
@@ -333,12 +272,18 @@ class NavigationPanel(QFrame):
tooltip: str
the tooltip of widget
parentRouteKey: str
the route key of parent item, the parent item should be `NavigationTreeWidget`
"""
if
routeKey
in
self
.
items
:
return
self
.
_registerWidget
(
routeKey
,
widget
,
onClick
,
tooltip
)
self
.
_insertWidgetToLayout
(
index
,
widget
,
position
)
self
.
_registerWidget
(
routeKey
,
parentRouteKey
,
widget
,
onClick
,
tooltip
)
if
parentRouteKey
:
self
.
widget
(
parentRouteKey
).
insertChild
(
index
,
widget
)
else
:
self
.
_insertWidgetToLayout
(
index
,
widget
,
position
)
def
addSeparator
(
self
,
position
=
NavigationItemPosition
.
TOP
):
""" add separator
...
...
@@ -364,7 +309,7 @@ class NavigationPanel(QFrame):
separator
=
NavigationSeparator
(
self
)
self
.
_insertWidgetToLayout
(
index
,
separator
,
position
)
def
_registerWidget
(
self
,
routeKey
:
str
,
widget
:
NavigationWidget
,
onClick
,
tooltip
:
str
):
def
_registerWidget
(
self
,
routeKey
:
str
,
parentRouteKey
:
str
,
widget
:
NavigationWidget
,
onClick
,
tooltip
:
str
):
""" register widget """
widget
.
clicked
.
connect
(
self
.
_onWidgetClicked
)
...
...
@@ -372,7 +317,8 @@ class NavigationPanel(QFrame):
widget
.
clicked
.
connect
(
onClick
)
widget
.
setProperty
(
'routeKey'
,
routeKey
)
self
.
items
[
routeKey
]
=
widget
widget
.
setProperty
(
'parentRouteKey'
,
parentRouteKey
)
self
.
items
[
routeKey
]
=
NavigationItem
(
routeKey
,
parentRouteKey
,
widget
)
if
self
.
displayMode
in
[
NavigationDisplayMode
.
EXPAND
,
NavigationDisplayMode
.
MENU
]:
widget
.
setCompacted
(
False
)
...
...
@@ -406,8 +352,12 @@ class NavigationPanel(QFrame):
if
routeKey
not
in
self
.
items
:
return
w
=
self
.
items
.
pop
(
routeKey
)
w
.
deleteLater
()
item
=
self
.
items
.
pop
(
routeKey
)
if
item
.
parentRouteKey
is
not
None
:
self
.
widget
(
item
.
parentRouteKey
).
removeChild
(
item
.
widget
)
item
.
widget
.
deleteLater
()
self
.
history
.
remove
(
routeKey
)
def
setMenuButtonVisible
(
self
,
isVisible
:
bool
):
...
...
@@ -462,9 +412,10 @@ class NavigationPanel(QFrame):
if
self
.
expandAni
.
state
()
==
QPropertyAnimation
.
Running
:
return
for
w
in
self
.
items
.
values
():
if
isinstance
(
w
,
NavigationTreeWidget
)
and
w
.
isRoot
():
w
.
setExpanded
(
False
,
ani
=
False
)
for
item
in
self
.
items
.
values
():
w
=
item
.
widget
if
isinstance
(
w
,
NavigationTreeWidgetBase
)
and
w
.
isRoot
():
w
.
setExpanded
(
False
)
self
.
expandAni
.
setStartValue
(
QRect
(
self
.
pos
(),
QSize
(
self
.
width
(),
self
.
height
())))
...
...
@@ -494,7 +445,7 @@ class NavigationPanel(QFrame):
return
for
k
,
item
in
self
.
items
.
items
():
item
.
setSelected
(
k
==
routeKey
)
item
.
widget
.
setSelected
(
k
==
routeKey
)
def
_onWidgetClicked
(
self
):
widget
=
self
.
sender
()
# type: NavigationWidget
...
...
@@ -503,7 +454,7 @@ class NavigationPanel(QFrame):
self
.
setCurrentItem
(
widget
.
property
(
'routeKey'
))
if
widget
is
not
self
.
menuButton
and
self
.
displayMode
==
NavigationDisplayMode
.
MENU
\
and
not
isinstance
(
widget
,
NavigationTreeWidget
):
and
not
(
isinstance
(
widget
,
NavigationTreeWidgetBase
)
and
not
widget
.
isLeaf
()
):
self
.
collapse
()
def
resizeEvent
(
self
,
e
:
QResizeEvent
):
...
...
@@ -550,7 +501,7 @@ class NavigationPanel(QFrame):
self
.
setStyle
(
QApplication
.
style
())
for
item
in
self
.
items
.
values
():
item
.
setCompacted
(
True
)
item
.
widget
.
setCompacted
(
True
)
if
not
self
.
_parent
.
isWindow
():
self
.
setParent
(
self
.
_parent
)
...
...
qfluentwidgets/components/navigation/navigation_widget.py
浏览文件 @
92b0ca45
# coding:utf-8
from
typing
import
Union
,
List
from
PyQt5.QtCore
import
Qt
,
pyqtSignal
,
QRect
,
QRectF
,
QPropertyAnimation
,
pyqtProperty
,
QMargins
,
QEasingCurve
,
QPoint
from
PyQt5.QtCore
import
(
Qt
,
pyqtSignal
,
QRect
,
QRectF
,
QPropertyAnimation
,
pyqtProperty
,
QMargins
,
QEasingCurve
,
QPoint
,
QEvent
)
from
PyQt5.QtGui
import
QColor
,
QPainter
,
QPen
,
QIcon
,
QCursor
from
PyQt5.QtWidgets
import
QWidget
,
QVBoxLayout
...
...
@@ -24,6 +25,8 @@ class NavigationWidget(QWidget):
self
.
isPressed
=
False
self
.
isEnter
=
False
self
.
isSelectable
=
isSelectable
self
.
treeParent
=
None
self
.
nodeDepth
=
0
self
.
setFixedSize
(
40
,
36
)
def
enterEvent
(
self
,
e
):
...
...
@@ -65,7 +68,7 @@ class NavigationWidget(QWidget):
isSelected: bool
whether the button is selected
"""
if
not
self
.
isSelectable
or
self
.
isSelected
==
isSelected
:
if
not
self
.
isSelectable
:
return
self
.
isSelected
=
isSelected
...
...
@@ -241,15 +244,65 @@ class NavigationTreeItem(NavigationPushButton):
arrowAngle
=
pyqtProperty
(
float
,
getArrowAngle
,
setArrowAngle
)
class
NavigationTreeWidget
(
NavigationWidget
):
class
NavigationTreeWidgetBase
(
NavigationWidget
):
""" Navigation tree widget base class """
def
addChild
(
self
,
child
):
""" add child
Parameters
----------
child: NavigationTreeWidgetBase
child item
"""
raise
NotImplementedError
def
insertChild
(
self
,
index
:
int
,
child
:
NavigationWidget
):
""" insert child
Parameters
----------
child: NavigationTreeWidgetBase
child item
"""
raise
NotImplementedError
def
removeChild
(
self
,
child
:
NavigationWidget
):
""" remove child
Parameters
----------
child: NavigationTreeWidgetBase
child item
"""
raise
NotImplementedError
def
isRoot
(
self
):
""" is root node """
return
True
def
isLeaf
(
self
):
""" is leaf node """
return
True
def
setExpanded
(
self
,
isExpanded
:
bool
):
""" set the expanded status
Parameters
----------
isExpanded: bool
whether to expand node
"""
raise
NotImplementedError
class
NavigationTreeWidget
(
NavigationTreeWidgetBase
):
""" Navigation tree widget """
def
__init__
(
self
,
icon
:
Union
[
str
,
QIcon
,
FIF
],
text
:
str
,
isSelectable
:
bool
,
parent
=
None
):
super
().
__init__
(
isSelectable
,
parent
)
self
.
treeChildren
=
[]
# type: List[NavigationTreeWidget]
self
.
treeParent
=
None
# type: NavigationTreeWidget
self
.
nodeDepth
=
0
self
.
isExpanded
=
False
self
.
itemWidget
=
NavigationTreeItem
(
icon
,
text
,
isSelectable
,
self
)
...
...
@@ -267,27 +320,13 @@ class NavigationTreeWidget(NavigationWidget):
self
.
setAttribute
(
Qt
.
WA_TranslucentBackground
)
self
.
expandAni
.
valueChanged
.
connect
(
lambda
g
:
self
.
setFixedSize
(
g
.
size
()))
def
addChild
(
self
,
child
:
'NavigationTreeWidget'
):
""" add child
Parameters
----------
child: NavigationTreeWidget
child item
"""
def
addChild
(
self
,
child
):
self
.
insertChild
(
-
1
,
child
)
def
text
(
self
):
return
self
.
itemWidget
.
text
()
def
insertChild
(
self
,
index
:
int
,
child
:
'NavigationTreeWidget'
):
""" insert child
Parameters
----------
child: NavigationTreeWidget
child item
"""
def
insertChild
(
self
,
index
,
child
):
if
child
in
self
.
treeChildren
:
return
...
...
@@ -303,7 +342,11 @@ class NavigationTreeWidget(NavigationWidget):
self
.
treeChildren
.
insert
(
index
,
child
)
self
.
vBoxLayout
.
insertWidget
(
index
,
child
,
0
,
Qt
.
AlignTop
)
def
setExpanded
(
self
,
isExpanded
:
bool
,
ani
=
True
):
def
removeChild
(
self
,
child
):
self
.
treeChildren
.
remove
(
child
)
self
.
vBoxLayout
.
removeWidget
(
child
)
def
setExpanded
(
self
,
isExpanded
:
bool
,
ani
=
False
):
""" set the expanded status """
if
isExpanded
==
self
.
isExpanded
:
return
...
...
@@ -345,9 +388,9 @@ class NavigationTreeWidget(NavigationWidget):
def
_onClicked
(
self
,
triggerByUser
,
clickArrow
):
if
not
self
.
isCompacted
:
if
self
.
isSelectable
and
not
self
.
isSelected
and
not
clickArrow
:
self
.
setExpanded
(
True
)
self
.
setExpanded
(
True
,
ani
=
True
)
else
:
self
.
setExpanded
(
not
self
.
isExpanded
)
self
.
setExpanded
(
not
self
.
isExpanded
,
ani
=
True
)
if
not
clickArrow
or
self
.
isCompacted
:
self
.
clicked
.
emit
(
triggerByUser
)
qfluentwidgets/components/widgets/button.py
浏览文件 @
92b0ca45
...
...
@@ -2,12 +2,13 @@
from
typing
import
Union
from
PyQt5.QtCore
import
pyqtSignal
,
QUrl
,
Qt
,
QRectF
,
QSize
,
QPoint
,
pyqtProperty
from
PyQt5.QtGui
import
QDesktopServices
,
QIcon
,
QPainter
from
PyQt5.QtGui
import
QDesktopServices
,
QIcon
,
QPainter
,
QFont
from
PyQt5.QtWidgets
import
QHBoxLayout
,
QPushButton
,
QRadioButton
,
QToolButton
,
QApplication
,
QWidget
,
QSizePolicy
from
...common.animation
import
TranslateYAnimation
from
...common.icon
import
FluentIconBase
,
drawIcon
,
isDarkTheme
,
Theme
,
toQIcon
from
...common.icon
import
FluentIcon
as
FIF
from
...common.font
import
setFont
from
...common.style_sheet
import
FluentStyleSheet
from
...common.overload
import
singledispatchmethod
from
.menu
import
RoundMenu
...
...
@@ -24,6 +25,7 @@ class PushButton(QPushButton):
self
.
isHover
=
False
self
.
setIconSize
(
QSize
(
16
,
16
))
self
.
setIcon
(
None
)
setFont
(
self
)
self
.
_postInit
()
@
__init__
.
register
...
...
@@ -132,6 +134,7 @@ class HyperlinkButton(QPushButton):
self
.
_url
=
QUrl
()
FluentStyleSheet
.
BUTTON
.
apply
(
self
)
self
.
setCursor
(
Qt
.
PointingHandCursor
)
setFont
(
self
)
self
.
clicked
.
connect
(
lambda
i
:
QDesktopServices
.
openUrl
(
self
.
getUrl
()))
@
__init__
.
register
...
...
@@ -174,6 +177,7 @@ class ToolButton(QToolButton):
self
.
isHover
=
False
self
.
setIconSize
(
QSize
(
16
,
16
))
self
.
setIcon
(
QIcon
())
setFont
(
self
)
self
.
_postInit
()
@
__init__
.
register
...
...
qfluentwidgets/components/widgets/line_edit.py
浏览文件 @
92b0ca45
...
...
@@ -7,6 +7,7 @@ from PyQt5.QtWidgets import QHBoxLayout, QLineEdit, QToolButton, QTextEdit, QPla
from
...common.style_sheet
import
FluentStyleSheet
,
themeColor
from
...common.icon
import
isDarkTheme
,
FluentIconBase
,
drawIcon
from
...common.icon
import
FluentIcon
as
FIF
from
...common.font
import
setFont
from
.menu
import
LineEditMenu
,
TextEditMenu
from
.scroll_bar
import
SmoothScrollDelegate
...
...
@@ -62,6 +63,7 @@ class LineEdit(QLineEdit):
FluentStyleSheet
.
LINE_EDIT
.
apply
(
self
)
self
.
setFixedHeight
(
33
)
self
.
setAttribute
(
Qt
.
WA_MacShowFocusRect
,
False
)
setFont
(
self
)
self
.
hBoxLayout
=
QHBoxLayout
(
self
)
self
.
clearButton
=
LineEditButton
(
FIF
.
CLOSE
,
self
)
...
...
@@ -156,6 +158,7 @@ class TextEdit(QTextEdit):
super
().
__init__
(
parent
=
parent
)
self
.
scrollDelegate
=
SmoothScrollDelegate
(
self
)
FluentStyleSheet
.
LINE_EDIT
.
apply
(
self
)
setFont
(
self
)
def
contextMenuEvent
(
self
,
e
):
menu
=
TextEditMenu
(
self
)
...
...
@@ -169,6 +172,7 @@ class PlainTextEdit(QPlainTextEdit):
super
().
__init__
(
parent
=
parent
)
self
.
scrollDelegate
=
SmoothScrollDelegate
(
self
)
FluentStyleSheet
.
LINE_EDIT
.
apply
(
self
)
setFont
(
self
)
def
contextMenuEvent
(
self
,
e
):
menu
=
TextEditMenu
(
self
)
...
...
qfluentwidgets/components/widgets/spin_box.py
浏览文件 @
92b0ca45
...
...
@@ -8,6 +8,7 @@ from PyQt5.QtWidgets import (QSpinBox, QDoubleSpinBox, QToolButton, QHBoxLayout,
from
...common.style_sheet
import
FluentStyleSheet
,
themeColor
from
...common.icon
import
FluentIconBase
,
Theme
,
getIconColor
from
...common.font
import
setFont
from
...components.widgets
import
LineEditMenu
...
...
@@ -62,6 +63,7 @@ class Ui_SpinBox:
FluentStyleSheet
.
SPIN_BOX
.
apply
(
self
)
self
.
setButtonSymbols
(
QSpinBox
.
NoButtons
)
self
.
setFixedHeight
(
33
)
setFont
(
self
)
self
.
hBoxLayout
=
QHBoxLayout
(
self
)
self
.
upButton
=
SpinButton
(
SpinIcon
.
UP
,
self
)
...
...
qfluentwidgets/components/widgets/table_view.py
浏览文件 @
92b0ca45
...
...
@@ -6,6 +6,7 @@ from PyQt5.QtGui import QPainter, QColor, QKeyEvent, QPalette
from
PyQt5.QtWidgets
import
(
QStyledItemDelegate
,
QApplication
,
QStyleOptionViewItem
,
QTableView
,
QTableWidget
,
QWidget
,
QTableWidgetItem
)
from
...common.font
import
getFont
from
...common.style_sheet
import
isDarkTheme
,
FluentStyleSheet
,
themeColor
from
.line_edit
import
LineEdit
from
.scroll_bar
import
SmoothScrollDelegate
...
...
@@ -78,6 +79,7 @@ class TableItemDelegate(QStyledItemDelegate):
def
initStyleOption
(
self
,
option
:
QStyleOptionViewItem
,
index
:
QModelIndex
):
super
().
initStyleOption
(
option
,
index
)
option
.
font
=
getFont
(
13
)
if
isDarkTheme
():
option
.
palette
.
setColor
(
QPalette
.
Text
,
Qt
.
white
)
option
.
palette
.
setColor
(
QPalette
.
HighlightedText
,
Qt
.
white
)
...
...
qfluentwidgets/components/widgets/tree_view.py
浏览文件 @
92b0ca45
# coding:utf-8
import
typing
from
PyQt5.QtCore
import
Qt
,
QSize
from
PyQt5.QtGui
import
QPainter
,
QColor
from
PyQt5.QtWidgets
import
Q
Widget
,
Q
TreeWidget
,
QStyledItemDelegate
,
QStyle
,
QTreeView
from
PyQt5.QtGui
import
QPainter
,
QColor
,
QPalette
from
PyQt5.QtWidgets
import
QTreeWidget
,
QStyledItemDelegate
,
QStyle
,
QTreeView
from
...common.style_sheet
import
FluentStyleSheet
,
themeColor
,
isDarkTheme
from
...common.font
import
getFont
from
.scroll_area
import
SmoothScrollDelegate
...
...
@@ -39,6 +39,16 @@ class TreeItemDelegate(QStyledItemDelegate):
painter
.
restore
()
def
initStyleOption
(
self
,
option
,
index
):
super
().
initStyleOption
(
option
,
index
)
option
.
font
=
getFont
(
13
)
if
isDarkTheme
():
option
.
palette
.
setColor
(
QPalette
.
Text
,
Qt
.
white
)
option
.
palette
.
setColor
(
QPalette
.
HighlightedText
,
Qt
.
white
)
else
:
option
.
palette
.
setColor
(
QPalette
.
Text
,
Qt
.
black
)
option
.
palette
.
setColor
(
QPalette
.
HighlightedText
,
Qt
.
black
)
class
TreeViewBase
:
""" Tree view base class """
...
...
setup.py
浏览文件 @
92b0ca45
...
...
@@ -6,7 +6,7 @@ with open('README.md', encoding='utf-8') as f:
setuptools
.
setup
(
name
=
"PyQt-Fluent-Widgets"
,
version
=
"0.9.
0
"
,
version
=
"0.9.
1
"
,
keywords
=
"pyqt fluent widgets"
,
author
=
"zhiyiYo"
,
author_email
=
"shokokawaii@outlook.com"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录