Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
k54kdk
PyQt Fluent Widgets
提交
882810b9
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看板
提交
882810b9
编写于
3月 01, 2023
作者:
之一Yo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
调整提示气泡的样式为圆角
上级
949e71a1
变更
17
展开全部
隐藏空白更改
内联
并排
Showing
17 changed file
with
40956 addition
and
40977 deletion
+40956
-40977
examples/settings/setting_interface.py
examples/settings/setting_interface.py
+2
-1
qfluentwidgets/__init__.py
qfluentwidgets/__init__.py
+1
-1
qfluentwidgets/_rc/images/state_tool_tip/close_black.png
qfluentwidgets/_rc/images/state_tool_tip/close_black.png
+0
-0
qfluentwidgets/_rc/images/state_tool_tip/close_black.svg
qfluentwidgets/_rc/images/state_tool_tip/close_black.svg
+0
-7
qfluentwidgets/_rc/images/state_tool_tip/close_hover.svg
qfluentwidgets/_rc/images/state_tool_tip/close_hover.svg
+6
-0
qfluentwidgets/_rc/images/state_tool_tip/close_normal.svg
qfluentwidgets/_rc/images/state_tool_tip/close_normal.svg
+6
-0
qfluentwidgets/_rc/images/state_tool_tip/close_pressed.svg
qfluentwidgets/_rc/images/state_tool_tip/close_pressed.svg
+6
-0
qfluentwidgets/_rc/images/state_tool_tip/close_white.png
qfluentwidgets/_rc/images/state_tool_tip/close_white.png
+0
-0
qfluentwidgets/_rc/images/state_tool_tip/close_white.svg
qfluentwidgets/_rc/images/state_tool_tip/close_white.svg
+0
-7
qfluentwidgets/_rc/qss/dark/state_tool_tip.qss
qfluentwidgets/_rc/qss/dark/state_tool_tip.qss
+6
-17
qfluentwidgets/_rc/qss/light/state_tool_tip.qss
qfluentwidgets/_rc/qss/light/state_tool_tip.qss
+6
-17
qfluentwidgets/_rc/resource.py
qfluentwidgets/_rc/resource.py
+40833
-40916
qfluentwidgets/_rc/resource.qrc
qfluentwidgets/_rc/resource.qrc
+3
-2
qfluentwidgets/components/settings/folder_list_setting_card.py
...ntwidgets/components/settings/folder_list_setting_card.py
+6
-2
qfluentwidgets/components/widgets/state_tool_tip.py
qfluentwidgets/components/widgets/state_tool_tip.py
+23
-6
qfluentwidgets/components/widgets/three_state_button.py
qfluentwidgets/components/widgets/three_state_button.py
+57
-0
setup.py
setup.py
+1
-1
未找到文件。
examples/settings/setting_interface.py
浏览文件 @
882810b9
...
...
@@ -5,7 +5,7 @@ from qfluentwidgets import (SettingCardGroup, SwitchSettingCard, FolderListSetti
ColorSettingCard
,
HyperlinkCard
,
PrimaryPushSettingCard
,
ScrollArea
,
ComboBoxSettingCard
,
ExpandLayout
,
setStyleSheet
,
ToastToolTip
)
from
qfluentwidgets
import
FluentIconFactory
as
FIF
from
PyQt5.QtCore
import
Qt
,
pyqtSignal
,
QUrl
from
PyQt5.QtCore
import
Qt
,
pyqtSignal
,
QUrl
,
QStandardPaths
from
PyQt5.QtGui
import
QDesktopServices
from
PyQt5.QtWidgets
import
QWidget
,
QLabel
,
QFontDialog
,
QFileDialog
...
...
@@ -33,6 +33,7 @@ class SettingInterface(ScrollArea):
self
.
musicFolderCard
=
FolderListSettingCard
(
cfg
.
musicFolders
,
self
.
tr
(
"Local music library"
),
directory
=
QStandardPaths
.
writableLocation
(
QStandardPaths
.
MusicLocation
),
parent
=
self
.
musicInThisPCGroup
)
self
.
downloadFolderCard
=
PushSettingCard
(
...
...
qfluentwidgets/__init__.py
浏览文件 @
882810b9
...
...
@@ -10,7 +10,7 @@ online at https://pyqt-fluent-widgets.readthedocs.io.
:license: MIT, see LICENSE for more details.
"""
__version__
=
"0.2.
5
"
__version__
=
"0.2.
6
"
from
.components
import
*
from
.common
import
*
...
...
qfluentwidgets/_rc/images/state_tool_tip/close_black.png
已删除
100644 → 0
浏览文件 @
949e71a1
206 字节
qfluentwidgets/_rc/images/state_tool_tip/close_black.svg
已删除
100644 → 0
浏览文件 @
949e71a1
<?xml version="1.0" encoding="utf-8"?>
<svg
xmlns=
"http://www.w3.org/2000/svg"
height=
"16"
width=
"16"
viewBox=
"0 0 16 16"
>
<g>
<path
id=
"path1"
transform=
"rotate(0,8,8) translate(0,0) scale(0.205128205128205,0.205128205128205) "
fill=
"#000000"
d=
"M15,12L16.13671875,12.22265625 17.109375,12.890625 45,40.78125 72.890625,12.890625 73.86328125,12.22265625 75,12 76.13671875,12.22265625 77.109375,12.890625 77.77734375,13.86328125 78,15 77.77734375,16.13671875 77.109375,17.109375 49.21875,45 77.109375,72.890625 77.77734375,73.86328125 78,75 77.77734375,76.13671875 77.109375,77.109375 76.13671875,77.77734375 75,78 73.86328125,77.77734375 72.890625,77.109375 45,49.21875 17.109375,77.109375 16.13671875,77.77734375 15,78 13.8632802963257,77.77734375 12.890625,77.109375 12.22265625,76.13671875 12,75 12.22265625,73.86328125 12.890625,72.890625 40.78125,45 12.890625,17.109375 12.22265625,16.13671875 12,15 12.22265625,13.86328125 12.890625,12.890625 13.8632802963257,12.22265625 15,12z"
/>
</g>
</svg>
qfluentwidgets/_rc/images/state_tool_tip/close_hover.svg
0 → 100644
浏览文件 @
882810b9
<?xml version="1.0" encoding="utf-8"?>
<svg
xmlns=
"http://www.w3.org/2000/svg"
height=
"16"
width=
"16"
viewBox=
"0 0 16 16"
>
<g>
<path
id=
"path1"
transform=
"rotate(0,8,8) translate(-1,-1) scale(0.0345572354211663,0.0345572354211663) "
fill=
"#CCEAF1"
d=
"M79,49L256,225.75 433,49 463,79 286.25,256 463,433 433,463 256,286.25 79,463 49,433 225.75,256 49,79 79,49z"
/>
</g>
</svg>
qfluentwidgets/_rc/images/state_tool_tip/close_normal.svg
0 → 100644
浏览文件 @
882810b9
<?xml version="1.0" encoding="utf-8"?>
<svg
xmlns=
"http://www.w3.org/2000/svg"
height=
"16"
width=
"16"
viewBox=
"0 0 16 16"
>
<g>
<path
id=
"path1"
transform=
"rotate(0,8,8) translate(-1,-1) scale(0.0345572354211663,0.0345572354211663) "
fill=
"#FFFFFF"
d=
"M79,49L256,225.75 433,49 463,79 286.25,256 463,433 433,463 256,286.25 79,463 49,433 225.75,256 49,79 79,49z"
/>
</g>
</svg>
qfluentwidgets/_rc/images/state_tool_tip/close_pressed.svg
0 → 100644
浏览文件 @
882810b9
<?xml version="1.0" encoding="utf-8"?>
<svg
xmlns=
"http://www.w3.org/2000/svg"
height=
"16"
width=
"16"
viewBox=
"0 0 16 16"
>
<g>
<path
id=
"path1"
transform=
"rotate(0,8,8) translate(-1,-1) scale(0.0345572354211663,0.0345572354211663) "
fill=
"#99D6E4"
d=
"M79,49L256,225.75 433,49 463,79 286.25,256 463,433 433,463 256,286.25 79,463 49,433 225.75,256 49,79 79,49z"
/>
</g>
</svg>
qfluentwidgets/_rc/images/state_tool_tip/close_white.png
已删除
100644 → 0
浏览文件 @
949e71a1
204 字节
qfluentwidgets/_rc/images/state_tool_tip/close_white.svg
已删除
100644 → 0
浏览文件 @
949e71a1
<?xml version="1.0" encoding="utf-8"?>
<svg
xmlns=
"http://www.w3.org/2000/svg"
height=
"16"
width=
"16"
viewBox=
"0 0 16 16"
>
<g>
<path
id=
"path1"
transform=
"rotate(0,8,8) translate(0,0) scale(0.205128205128205,0.205128205128205) "
fill=
"#FFFFFF"
d=
"M15,12L16.13671875,12.22265625 17.109375,12.890625 45,40.78125 72.890625,12.890625 73.86328125,12.22265625 75,12 76.13671875,12.22265625 77.109375,12.890625 77.77734375,13.86328125 78,15 77.77734375,16.13671875 77.109375,17.109375 49.21875,45 77.109375,72.890625 77.77734375,73.86328125 78,75 77.77734375,76.13671875 77.109375,77.109375 76.13671875,77.77734375 75,78 73.86328125,77.77734375 72.890625,77.109375 45,49.21875 17.109375,77.109375 16.13671875,77.77734375 15,78 13.8632802963257,77.77734375 12.890625,77.109375 12.22265625,76.13671875 12,75 12.22265625,73.86328125 12.890625,72.890625 40.78125,45 12.890625,17.109375 12.22265625,16.13671875 12,15 12.22265625,13.86328125 12.890625,12.890625 13.8632802963257,12.22265625 15,12z"
/>
</g>
</svg>
qfluentwidgets/_rc/qss/dark/state_tool_tip.qss
浏览文件 @
882810b9
QWidget {
StateToolTip,
ToastToolTip {
background-color: rgb(0, 107, 131);
border: none;
border-radius: 7px;
}
QLabel#titleLabel {
color: white;
background-color: transparent;
font: 14px 'Segoe UI', 'Microsoft YaHei';
}
QLabel#contentLabel {
color: white;
background-color: transparent;
font: 13px 'Segoe UI', 'Microsoft YaHei';
}
QToolButton {
border: none;
margin: 0px;
width: 11px;
height: 11px;
border-image: url(:/qfluentwidgets/images/state_tool_tip/close_white.svg) top center no-repeat;
}
QToolButton:hover {
border-image: url(:/qfluentwidgets/images/state_tool_tip/close_black.svg) top center no-repeat;
}
QToolButton:pressed {
border-image: url(:/qfluentwidgets/images/state_tool_tip/close_black.svg) top center no-repeat;
}
\ No newline at end of file
qfluentwidgets/_rc/qss/light/state_tool_tip.qss
浏览文件 @
882810b9
QWidget {
StateToolTip,
ToastToolTip {
background-color: rgb(0, 107, 131);
border: none;
border-radius: 7px;
}
QLabel#titleLabel {
color: white;
background-color: transparent;
font: 14px 'Segoe UI', 'Microsoft YaHei';
}
QLabel#contentLabel {
color: white;
background-color: transparent;
font: 13px 'Segoe UI', 'Microsoft YaHei';
}
QToolButton {
border: none;
margin: 0px;
width: 11px;
height: 11px;
border-image: url(:/qfluentwidgets/images/state_tool_tip/close_white.svg) top center no-repeat;
}
QToolButton:hover {
border-image: url(:/qfluentwidgets/images/state_tool_tip/close_black.svg) top center no-repeat;
}
QToolButton:pressed {
border-image: url(:/qfluentwidgets/images/state_tool_tip/close_black.svg) top center no-repeat;
}
\ No newline at end of file
qfluentwidgets/_rc/resource.py
浏览文件 @
882810b9
此差异已折叠。
点击以展开。
qfluentwidgets/_rc/resource.qrc
浏览文件 @
882810b9
...
...
@@ -75,8 +75,9 @@
<file>images/icons/Zoom_white.svg</file>
<file>images/icons/Language_black.svg</file>
<file>images/icons/Language_white.svg</file>
<file>images/state_tool_tip/close_white.svg</file>
<file>images/state_tool_tip/close_black.svg</file>
<file>images/state_tool_tip/close_normal.svg</file>
<file>images/state_tool_tip/close_hover.svg</file>
<file>images/state_tool_tip/close_pressed.svg</file>
<file>images/state_tool_tip/completed.svg</file>
<file>images/state_tool_tip/info.svg</file>
<file>images/state_tool_tip/running.svg</file>
...
...
qfluentwidgets/components/settings/folder_list_setting_card.py
浏览文件 @
882810b9
...
...
@@ -97,7 +97,7 @@ class FolderListSettingCard(ExpandSettingCard):
folderChanged
=
pyqtSignal
(
list
)
def
__init__
(
self
,
configItem
:
ConfigItem
,
title
:
str
,
content
:
str
=
None
,
parent
=
None
):
def
__init__
(
self
,
configItem
:
ConfigItem
,
title
:
str
,
content
:
str
=
None
,
directory
=
"./"
,
parent
=
None
):
"""
Parameters
----------
...
...
@@ -110,11 +110,15 @@ class FolderListSettingCard(ExpandSettingCard):
content: str
the content of card
directory: str
working directory of file dialog
parent: QWidget
parent widget
"""
super
().
__init__
(
FIF
.
path
(
FIF
.
FOLDER
),
title
,
content
,
parent
)
self
.
configItem
=
configItem
self
.
_dialogDirectory
=
directory
self
.
addFolderButton
=
PushButton
(
FIF
.
path
(
FIF
.
FOLDER_ADD
),
self
.
tr
(
'Add folder'
),
self
)
...
...
@@ -136,7 +140,7 @@ class FolderListSettingCard(ExpandSettingCard):
def
__showFolderDialog
(
self
):
""" show folder dialog """
folder
=
QFileDialog
.
getExistingDirectory
(
self
,
self
.
tr
(
"Choose folder"
),
"./"
)
self
,
self
.
tr
(
"Choose folder"
),
self
.
_dialogDirectory
)
if
not
folder
or
folder
in
self
.
folders
:
return
...
...
qfluentwidgets/components/widgets/state_tool_tip.py
浏览文件 @
882810b9
...
...
@@ -5,6 +5,7 @@ from PyQt5.QtWidgets import QLabel, QWidget, QToolButton, QGraphicsOpacityEffect
from
PyQt5.QtSvg
import
QSvgWidget
from
...common
import
setStyleSheet
,
drawSvgIcon
from
...components.widgets.three_state_button
import
ThreeStateButton
,
ButtonState
class
StateToolTip
(
QWidget
):
...
...
@@ -36,7 +37,15 @@ class StateToolTip(QWidget):
self
.
animation
=
QPropertyAnimation
(
self
,
b
"windowOpacity"
)
self
.
busyIconPath
=
":/qfluentwidgets/images/state_tool_tip/running.svg"
self
.
doneIconPath
=
":/qfluentwidgets/images/state_tool_tip/completed.svg"
self
.
closeButton
=
QToolButton
(
self
)
self
.
closeButton
=
ThreeStateButton
(
{
ButtonState
.
NORMAL
:
':/qfluentwidgets/images/state_tool_tip/close_normal.svg'
,
ButtonState
.
HOVER
:
':/qfluentwidgets/images/state_tool_tip/close_hover.svg'
,
ButtonState
.
PRESSED
:
':/qfluentwidgets/images/state_tool_tip/close_pressed.svg'
,
},
parent
=
self
,
buttonSize
=
(
12
,
12
)
)
self
.
isDone
=
False
self
.
rotateAngle
=
0
...
...
@@ -67,7 +76,7 @@ class StateToolTip(QWidget):
self
.
contentLabel
.
width
())
+
56
,
51
)
self
.
titleLabel
.
move
(
32
,
9
)
self
.
contentLabel
.
move
(
12
,
27
)
self
.
closeButton
.
move
(
self
.
width
()
-
24
,
1
8
)
self
.
closeButton
.
move
(
self
.
width
()
-
24
,
1
9
)
def
__setQss
(
self
):
""" set style sheet """
...
...
@@ -124,7 +133,7 @@ class StateToolTip(QWidget):
""" paint state tooltip """
super
().
paintEvent
(
e
)
painter
=
QPainter
(
self
)
painter
.
setRenderHints
(
QPainter
.
SmoothPixmapTransform
)
painter
.
setRenderHints
(
QPainter
.
Antialiasing
)
painter
.
setPen
(
Qt
.
NoPen
)
if
not
self
.
isDone
:
painter
.
translate
(
19
,
18
)
...
...
@@ -161,11 +170,19 @@ class ToastToolTip(QWidget):
self
.
titleLabel
=
QLabel
(
self
.
title
,
self
)
self
.
contentLabel
=
QLabel
(
self
.
content
,
self
)
self
.
iconLabel
=
QSvgWidget
(
self
.
icon
,
self
)
self
.
closeButton
=
QToolButton
(
self
)
self
.
closeTimer
=
QTimer
(
self
)
self
.
opacityEffect
=
QGraphicsOpacityEffect
(
self
)
self
.
opacityAni
=
QPropertyAnimation
(
self
.
opacityEffect
,
b
"opacity"
)
self
.
slideAni
=
QPropertyAnimation
(
self
,
b
'pos'
)
self
.
closeButton
=
ThreeStateButton
(
{
ButtonState
.
NORMAL
:
':/qfluentwidgets/images/state_tool_tip/close_normal.svg'
,
ButtonState
.
HOVER
:
':/qfluentwidgets/images/state_tool_tip/close_hover.svg'
,
ButtonState
.
PRESSED
:
':/qfluentwidgets/images/state_tool_tip/close_pressed.svg'
,
},
parent
=
self
,
buttonSize
=
(
12
,
12
)
)
self
.
__initWidget
()
...
...
@@ -175,7 +192,7 @@ class ToastToolTip(QWidget):
self
.
closeButton
.
setFixedSize
(
QSize
(
11
,
11
))
self
.
closeButton
.
setIconSize
(
QSize
(
11
,
11
))
self
.
closeTimer
.
setInterval
(
2000
)
self
.
contentLabel
.
setMinimumWidth
(
25
0
)
self
.
contentLabel
.
setMinimumWidth
(
18
0
)
self
.
iconLabel
.
resize
(
16
,
16
)
self
.
iconLabel
.
move
(
12
,
10
)
...
...
@@ -196,7 +213,7 @@ class ToastToolTip(QWidget):
self
.
contentLabel
.
width
())
+
72
,
51
)
self
.
titleLabel
.
move
(
32
,
9
)
self
.
contentLabel
.
move
(
12
,
27
)
self
.
closeButton
.
move
(
self
.
width
()
-
24
,
1
8
)
self
.
closeButton
.
move
(
self
.
width
()
-
24
,
1
9
)
def
__setQss
(
self
):
""" set style sheet """
...
...
qfluentwidgets/components/widgets/three_state_button.py
0 → 100644
浏览文件 @
882810b9
# coding:utf-8
from
enum
import
Enum
from
PyQt5.QtCore
import
QEvent
,
QSize
,
Qt
from
PyQt5.QtGui
import
QIcon
from
PyQt5.QtWidgets
import
QToolButton
class
ButtonState
(
Enum
):
""" Button state """
NORMAL
=
0
HOVER
=
1
PRESSED
=
2
class
ThreeStateButton
(
QToolButton
):
""" Three state tool button class """
def
__init__
(
self
,
iconPaths
,
parent
=
None
,
buttonSize
=
(
40
,
40
),
iconSize
=
None
):
"""
Parameters
----------
iconPaths: Dict[ButtonState, str]
icon path dict
parent:
parent window
button: tuple
button size
iconSize: tuple
icon size
"""
super
().
__init__
(
parent
)
self
.
iconPaths
=
iconPaths
self
.
resize
(
*
buttonSize
)
self
.
setIconSize
(
self
.
size
()
if
not
iconSize
else
QSize
(
*
iconSize
))
self
.
setCursor
(
Qt
.
ArrowCursor
)
self
.
setStyleSheet
(
'border: none; margin: 0px; background: transparent'
)
self
.
setState
(
ButtonState
.
NORMAL
)
self
.
installEventFilter
(
self
)
def
eventFilter
(
self
,
obj
,
e
):
if
obj
is
self
:
if
e
.
type
()
==
QEvent
.
Enter
:
self
.
setState
(
ButtonState
.
HOVER
)
if
e
.
type
()
in
[
QEvent
.
Leave
,
QEvent
.
MouseButtonRelease
]:
self
.
setState
(
ButtonState
.
NORMAL
)
if
e
.
type
()
==
QEvent
.
MouseButtonPress
:
self
.
setState
(
ButtonState
.
PRESSED
)
return
super
().
eventFilter
(
obj
,
e
)
def
setState
(
self
,
state
):
""" set the state of button """
self
.
setIcon
(
QIcon
(
self
.
iconPaths
[
state
]))
\ No newline at end of file
setup.py
浏览文件 @
882810b9
...
...
@@ -6,7 +6,7 @@ with open('README.md', encoding='utf-8') as f:
setuptools
.
setup
(
name
=
"PyQt-Fluent-Widgets"
,
version
=
"0.2.
5
"
,
version
=
"0.2.
6
"
,
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录