Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
k54kdk
PyQt Fluent Widgets
提交
d654dc35
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看板
提交
d654dc35
编写于
5月 03, 2023
作者:
之一Yo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复导航窗口展开时仍然显示工具提示的问题,fixes #165
上级
1b7d725c
变更
16
展开全部
隐藏空白更改
内联
并排
Showing
16 changed file
with
52503 addition
and
52408 deletion
+52503
-52408
examples/gallery/app/view/main_window.py
examples/gallery/app/view/main_window.py
+2
-1
examples/gallery/demo.py
examples/gallery/demo.py
+0
-5
qfluentwidgets/__init__.py
qfluentwidgets/__init__.py
+1
-1
qfluentwidgets/_rc/i18n/qfluentwidgets.zh_CN.qm
qfluentwidgets/_rc/i18n/qfluentwidgets.zh_CN.qm
+0
-0
qfluentwidgets/_rc/i18n/qfluentwidgets.zh_CN.ts
qfluentwidgets/_rc/i18n/qfluentwidgets.zh_CN.ts
+15
-0
qfluentwidgets/_rc/i18n/qfluentwidgets.zh_HK.qm
qfluentwidgets/_rc/i18n/qfluentwidgets.zh_HK.qm
+0
-0
qfluentwidgets/_rc/i18n/qfluentwidgets.zh_HK.ts
qfluentwidgets/_rc/i18n/qfluentwidgets.zh_HK.ts
+15
-0
qfluentwidgets/_rc/i18n/qfluentwidgets.zh_TW.qm
qfluentwidgets/_rc/i18n/qfluentwidgets.zh_TW.qm
+0
-0
qfluentwidgets/_rc/i18n/qfluentwidgets.zh_TW.ts
qfluentwidgets/_rc/i18n/qfluentwidgets.zh_TW.ts
+15
-0
qfluentwidgets/_rc/qss/dark/tree_view.qss
qfluentwidgets/_rc/qss/dark/tree_view.qss
+2
-2
qfluentwidgets/_rc/resource.py
qfluentwidgets/_rc/resource.py
+52427
-52391
qfluentwidgets/components/navigation/navigation_panel.py
qfluentwidgets/components/navigation/navigation_panel.py
+10
-1
qfluentwidgets/components/widgets/line_edit.py
qfluentwidgets/components/widgets/line_edit.py
+2
-2
qfluentwidgets/components/widgets/scroll_bar.py
qfluentwidgets/components/widgets/scroll_bar.py
+2
-2
qfluentwidgets/components/widgets/tool_tip.py
qfluentwidgets/components/widgets/tool_tip.py
+11
-2
setup.py
setup.py
+1
-1
未找到文件。
examples/gallery/app/view/main_window.py
浏览文件 @
d654dc35
...
@@ -171,7 +171,8 @@ class MainWindow(FramelessWindow):
...
@@ -171,7 +171,8 @@ class MainWindow(FramelessWindow):
icon
=
icon
,
icon
=
icon
,
text
=
text
,
text
=
text
,
onClick
=
lambda
t
:
self
.
switchTo
(
interface
,
t
),
onClick
=
lambda
t
:
self
.
switchTo
(
interface
,
t
),
position
=
position
position
=
position
,
tooltip
=
text
)
)
def
initWindow
(
self
):
def
initWindow
(
self
):
...
...
examples/gallery/demo.py
浏览文件 @
d654dc35
...
@@ -26,11 +26,6 @@ QApplication.setAttribute(Qt.AA_UseHighDpiPixmaps)
...
@@ -26,11 +26,6 @@ QApplication.setAttribute(Qt.AA_UseHighDpiPixmaps)
app
=
QApplication
(
sys
.
argv
)
app
=
QApplication
(
sys
.
argv
)
app
.
setAttribute
(
Qt
.
AA_DontCreateNativeWidgetSiblings
)
app
.
setAttribute
(
Qt
.
AA_DontCreateNativeWidgetSiblings
)
# font anti aliasing
font
=
app
.
font
()
font
.
setHintingPreference
(
QFont
.
PreferNoHinting
)
app
.
setFont
(
font
)
# internationalization
# internationalization
locale
=
cfg
.
get
(
cfg
.
language
).
value
locale
=
cfg
.
get
(
cfg
.
language
).
value
translator
=
FluentTranslator
(
locale
)
translator
=
FluentTranslator
(
locale
)
...
...
qfluentwidgets/__init__.py
浏览文件 @
d654dc35
...
@@ -12,7 +12,7 @@ Examples are available at https://github.com/zhiyiYo/PyQt-Fluent-Widgets/tree/ma
...
@@ -12,7 +12,7 @@ Examples are available at https://github.com/zhiyiYo/PyQt-Fluent-Widgets/tree/ma
:license: GPLv3, see LICENSE for more details.
:license: GPLv3, see LICENSE for more details.
"""
"""
__version__
=
"0.8.
3
"
__version__
=
"0.8.
4
"
from
.components
import
*
from
.components
import
*
from
.common
import
*
from
.common
import
*
...
...
qfluentwidgets/_rc/i18n/qfluentwidgets.zh_CN.qm
浏览文件 @
d654dc35
无法预览此类型文件
qfluentwidgets/_rc/i18n/qfluentwidgets.zh_CN.ts
浏览文件 @
d654dc35
...
@@ -55,6 +55,21 @@
...
@@ -55,6 +55,21 @@
<
translation
>
取消
<
/translation
>
<
translation
>
取消
<
/translation
>
<
/message
>
<
/message
>
<
/context
>
<
/context
>
<
context
>
<
name
>
NavigationPanel
<
/name
>
<
message
>
<
source
>
Open
Navigation
<
/source
>
<
translation
>
打开导航
<
/translation
>
<
/message
>
<
message
>
<
source
>
Close
Navigation
<
/source
>
<
translation
>
关闭导航
<
/translation
>
<
/message
>
<
message
>
<
source
>
Back
<
/source
>
<
translation
>
返回
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
context
>
<
name
>
Dialog
<
/name
>
<
name
>
Dialog
<
/name
>
<
message
>
<
message
>
...
...
qfluentwidgets/_rc/i18n/qfluentwidgets.zh_HK.qm
浏览文件 @
d654dc35
无法预览此类型文件
qfluentwidgets/_rc/i18n/qfluentwidgets.zh_HK.ts
浏览文件 @
d654dc35
...
@@ -55,6 +55,21 @@
...
@@ -55,6 +55,21 @@
<
translation
>
取消
<
/translation
>
<
translation
>
取消
<
/translation
>
<
/message
>
<
/message
>
<
/context
>
<
/context
>
<
context
>
<
name
>
NavigationPanel
<
/name
>
<
message
>
<
source
>
Open
Navigation
<
/source
>
<
translation
>
打開導航
<
/translation
>
<
/message
>
<
message
>
<
source
>
Close
Navigation
<
/source
>
<
translation
>
關閉導航
<
/translation
>
<
/message
>
<
message
>
<
source
>
Back
<
/source
>
<
translation
>
返回
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
context
>
<
name
>
Dialog
<
/name
>
<
name
>
Dialog
<
/name
>
<
message
>
<
message
>
...
...
qfluentwidgets/_rc/i18n/qfluentwidgets.zh_TW.qm
浏览文件 @
d654dc35
无法预览此类型文件
qfluentwidgets/_rc/i18n/qfluentwidgets.zh_TW.ts
浏览文件 @
d654dc35
...
@@ -55,6 +55,21 @@
...
@@ -55,6 +55,21 @@
<
translation
>
取消
<
/translation
>
<
translation
>
取消
<
/translation
>
<
/message
>
<
/message
>
<
/context
>
<
/context
>
<
context
>
<
name
>
NavigationPanel
<
/name
>
<
message
>
<
source
>
Open
Navigation
<
/source
>
<
translation
>
打開導航
<
/translation
>
<
/message
>
<
message
>
<
source
>
Close
Navigation
<
/source
>
<
translation
>
關閉導航
<
/translation
>
<
/message
>
<
message
>
<
source
>
Back
<
/source
>
<
translation
>
返回
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
context
>
<
name
>
Dialog
<
/name
>
<
name
>
Dialog
<
/name
>
<
message
>
<
message
>
...
...
qfluentwidgets/_rc/qss/dark/tree_view.qss
浏览文件 @
d654dc35
...
@@ -10,8 +10,8 @@ QTreeView {
...
@@ -10,8 +10,8 @@ QTreeView {
QTreeView::item {
QTreeView::item {
padding: 4px;
padding: 4px;
margin-top:
3
px;
margin-top:
2
px;
margin-bottom:
3
px;
margin-bottom:
2
px;
padding-left: 20px;
padding-left: 20px;
border-radius: 5px;
border-radius: 5px;
color: white;
color: white;
...
...
qfluentwidgets/_rc/resource.py
浏览文件 @
d654dc35
此差异已折叠。
点击以展开。
qfluentwidgets/components/navigation/navigation_panel.py
浏览文件 @
d654dc35
...
@@ -29,6 +29,15 @@ class NavigationItemPosition(Enum):
...
@@ -29,6 +29,15 @@ class NavigationItemPosition(Enum):
BOTTOM
=
2
BOTTOM
=
2
class
NavigationToolTipFilter
(
ToolTipFilter
):
""" Navigation tool tip filter """
def
_canShowToolTip
(
self
)
->
bool
:
isVisible
=
super
().
_canShowToolTip
()
parent
=
self
.
parent
()
# type: NavigationWidget
return
isVisible
and
parent
.
isCompacted
class
NavigationPanel
(
QFrame
):
class
NavigationPanel
(
QFrame
):
""" Navigation panel """
""" Navigation panel """
...
@@ -189,7 +198,7 @@ class NavigationPanel(QFrame):
...
@@ -189,7 +198,7 @@ class NavigationPanel(QFrame):
if
tooltip
:
if
tooltip
:
widget
.
setToolTip
(
tooltip
)
widget
.
setToolTip
(
tooltip
)
widget
.
installEventFilter
(
ToolTipFilter
(
widget
,
1000
))
widget
.
installEventFilter
(
Navigation
ToolTipFilter
(
widget
,
1000
))
self
.
_addWidgetToLayout
(
widget
,
position
)
self
.
_addWidgetToLayout
(
widget
,
position
)
...
...
qfluentwidgets/components/widgets/line_edit.py
浏览文件 @
d654dc35
...
@@ -153,7 +153,7 @@ class TextEdit(QTextEdit):
...
@@ -153,7 +153,7 @@ class TextEdit(QTextEdit):
def
__init__
(
self
,
parent
=
None
):
def
__init__
(
self
,
parent
=
None
):
super
().
__init__
(
parent
=
parent
)
super
().
__init__
(
parent
=
parent
)
self
.
installEventFilter
(
SmoothScrollDelegate
(
self
)
)
self
.
scrollDelegate
=
SmoothScrollDelegate
(
self
)
FluentStyleSheet
.
LINE_EDIT
.
apply
(
self
)
FluentStyleSheet
.
LINE_EDIT
.
apply
(
self
)
def
contextMenuEvent
(
self
,
e
):
def
contextMenuEvent
(
self
,
e
):
...
@@ -166,7 +166,7 @@ class PlainTextEdit(QPlainTextEdit):
...
@@ -166,7 +166,7 @@ class PlainTextEdit(QPlainTextEdit):
def
__init__
(
self
,
parent
=
None
):
def
__init__
(
self
,
parent
=
None
):
super
().
__init__
(
parent
=
parent
)
super
().
__init__
(
parent
=
parent
)
self
.
installEventFilter
(
SmoothScrollDelegate
(
self
)
)
self
.
scrollDelegate
=
SmoothScrollDelegate
(
self
)
FluentStyleSheet
.
LINE_EDIT
.
apply
(
self
)
FluentStyleSheet
.
LINE_EDIT
.
apply
(
self
)
def
contextMenuEvent
(
self
,
e
):
def
contextMenuEvent
(
self
,
e
):
...
...
qfluentwidgets/components/widgets/scroll_bar.py
浏览文件 @
d654dc35
...
@@ -334,7 +334,7 @@ class ScrollBar(QWidget):
...
@@ -334,7 +334,7 @@ class ScrollBar(QWidget):
def
_adjustHandleSize
(
self
):
def
_adjustHandleSize
(
self
):
total
=
self
.
maximum
()
-
self
.
minimum
()
+
self
.
parent
().
height
()
total
=
self
.
maximum
()
-
self
.
minimum
()
+
self
.
parent
().
height
()
if
total
!=
0
:
if
total
!=
0
:
s
=
self
.
_grooveLength
()
*
self
.
parent
().
height
()
/
total
s
=
int
(
self
.
_grooveLength
()
*
self
.
parent
().
height
()
/
total
)
else
:
else
:
s
=
1
s
=
1
...
@@ -345,7 +345,7 @@ class ScrollBar(QWidget):
...
@@ -345,7 +345,7 @@ class ScrollBar(QWidget):
def
_adjustHandlePos
(
self
):
def
_adjustHandlePos
(
self
):
total
=
max
(
self
.
maximum
()
-
self
.
minimum
(),
1
)
total
=
max
(
self
.
maximum
()
-
self
.
minimum
(),
1
)
delta
=
self
.
value
()
/
total
*
self
.
_slideLength
(
)
delta
=
int
(
self
.
value
()
/
total
*
self
.
_slideLength
()
)
if
self
.
orientation
()
==
Qt
.
Vertical
:
if
self
.
orientation
()
==
Qt
.
Vertical
:
x
=
self
.
width
()
-
self
.
handle
.
width
()
-
3
x
=
self
.
width
()
-
self
.
handle
.
width
()
-
3
...
...
qfluentwidgets/components/widgets/tool_tip.py
浏览文件 @
d654dc35
...
@@ -264,6 +264,8 @@ class ToolTipFilter(QObject):
...
@@ -264,6 +264,8 @@ class ToolTipFilter(QObject):
self
.
_tooltipDelay
=
showDelay
self
.
_tooltipDelay
=
showDelay
self
.
position
=
position
self
.
position
=
position
self
.
timer
=
QTimer
(
self
)
self
.
timer
=
QTimer
(
self
)
self
.
timer
.
setSingleShot
(
True
)
self
.
timer
.
timeout
.
connect
(
self
.
showToolTip
)
def
eventFilter
(
self
,
obj
:
QObject
,
e
:
QEvent
)
->
bool
:
def
eventFilter
(
self
,
obj
:
QObject
,
e
:
QEvent
)
->
bool
:
if
e
.
type
()
==
QEvent
.
ToolTip
:
if
e
.
type
()
==
QEvent
.
ToolTip
:
...
@@ -273,7 +275,7 @@ class ToolTipFilter(QObject):
...
@@ -273,7 +275,7 @@ class ToolTipFilter(QObject):
elif
e
.
type
()
==
QEvent
.
Enter
:
elif
e
.
type
()
==
QEvent
.
Enter
:
self
.
isEnter
=
True
self
.
isEnter
=
True
parent
=
self
.
parent
()
# type: QWidget
parent
=
self
.
parent
()
# type: QWidget
if
parent
.
isWidgetType
()
and
parent
.
toolTip
()
and
parent
.
isEnabled
():
if
self
.
_canShowToolTip
():
if
self
.
_tooltip
is
None
:
if
self
.
_tooltip
is
None
:
self
.
_tooltip
=
ToolTip
(
parent
.
toolTip
(),
parent
.
window
())
self
.
_tooltip
=
ToolTip
(
parent
.
toolTip
(),
parent
.
window
())
...
@@ -281,13 +283,16 @@ class ToolTipFilter(QObject):
...
@@ -281,13 +283,16 @@ class ToolTipFilter(QObject):
self
.
_tooltip
.
setDuration
(
t
)
self
.
_tooltip
.
setDuration
(
t
)
# show the tool tip after delay
# show the tool tip after delay
QTimer
.
singleShot
(
self
.
_tooltipDelay
,
self
.
showToolTip
)
self
.
timer
.
start
(
self
.
_tooltipDelay
)
elif
e
.
type
()
==
QEvent
.
MouseButtonPress
:
self
.
hideToolTip
()
return
super
().
eventFilter
(
obj
,
e
)
return
super
().
eventFilter
(
obj
,
e
)
def
hideToolTip
(
self
):
def
hideToolTip
(
self
):
""" hide tool tip """
""" hide tool tip """
self
.
isEnter
=
False
self
.
isEnter
=
False
self
.
timer
.
stop
()
if
self
.
_tooltip
:
if
self
.
_tooltip
:
self
.
_tooltip
.
hide
()
self
.
_tooltip
.
hide
()
...
@@ -304,3 +309,7 @@ class ToolTipFilter(QObject):
...
@@ -304,3 +309,7 @@ class ToolTipFilter(QObject):
def
setToolTipDelay
(
self
,
delay
:
int
):
def
setToolTipDelay
(
self
,
delay
:
int
):
""" set the delay of tool tip """
""" set the delay of tool tip """
self
.
_tooltipDelay
=
delay
self
.
_tooltipDelay
=
delay
def
_canShowToolTip
(
self
)
->
bool
:
parent
=
self
.
parent
()
# type: QWidget
return
parent
.
isWidgetType
()
and
parent
.
toolTip
()
and
parent
.
isEnabled
()
setup.py
浏览文件 @
d654dc35
...
@@ -6,7 +6,7 @@ with open('README.md', encoding='utf-8') as f:
...
@@ -6,7 +6,7 @@ with open('README.md', encoding='utf-8') as f:
setuptools
.
setup
(
setuptools
.
setup
(
name
=
"PyQt-Fluent-Widgets"
,
name
=
"PyQt-Fluent-Widgets"
,
version
=
"0.8.
3
"
,
version
=
"0.8.
4
"
,
keywords
=
"pyqt fluent widgets"
,
keywords
=
"pyqt fluent widgets"
,
author
=
"zhiyiYo"
,
author
=
"zhiyiYo"
,
author_email
=
"shokokawaii@outlook.com"
,
author_email
=
"shokokawaii@outlook.com"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录