Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
k54kdk
PyQt Fluent Widgets
提交
a6a833cf
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看板
提交
a6a833cf
编写于
6月 17, 2023
作者:
之一Yo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
添加开关工具按钮、透明按钮、透明开关按钮和透明下拉按钮
上级
b25ecf90
变更
9
展开全部
隐藏空白更改
内联
并排
Showing
9 changed file
with
77018 addition
and
76801 deletion
+77018
-76801
examples/button/demo.py
examples/button/demo.py
+62
-16
plugins/basic_input_plugin.py
plugins/basic_input_plugin.py
+82
-2
qfluentwidgets/__init__.py
qfluentwidgets/__init__.py
+1
-1
qfluentwidgets/_rc/qss/dark/button.qss
qfluentwidgets/_rc/qss/dark/button.qss
+28
-13
qfluentwidgets/_rc/qss/light/button.qss
qfluentwidgets/_rc/qss/light/button.qss
+37
-13
qfluentwidgets/_rc/resource.py
qfluentwidgets/_rc/resource.py
+76766
-76754
qfluentwidgets/components/widgets/__init__.py
qfluentwidgets/components/widgets/__init__.py
+3
-1
qfluentwidgets/components/widgets/button.py
qfluentwidgets/components/widgets/button.py
+38
-0
setup.py
setup.py
+1
-1
未找到文件。
examples/button/demo.py
浏览文件 @
a6a833cf
...
...
@@ -6,7 +6,10 @@ from PyQt5.QtWidgets import QApplication, QWidget, QVBoxLayout, QAction, QGridLa
from
qfluentwidgets
import
(
Action
,
DropDownPushButton
,
DropDownToolButton
,
PushButton
,
PrimaryPushButton
,
HyperlinkButton
,
setTheme
,
Theme
,
ToolButton
,
ToggleButton
,
RoundMenu
,
SplitPushButton
,
SplitToolButton
,
PrimaryToolButton
,
PrimarySplitPushButton
,
PrimarySplitToolButton
,
PrimaryDropDownPushButton
,
PrimaryDropDownToolButton
)
PrimarySplitToolButton
,
PrimaryDropDownPushButton
,
PrimaryDropDownToolButton
,
TogglePushButton
,
ToggleToolButton
,
TransparentPushButton
,
TransparentToolButton
,
TransparentToggleToolButton
,
TransparentTogglePushButton
,
TransparentDropDownToolButton
,
TransparentDropDownPushButton
)
from
qfluentwidgets
import
FluentIcon
as
FIF
...
...
@@ -47,6 +50,21 @@ class ToolButtonDemo(QWidget):
self
.
primarySplitToolButton
=
PrimarySplitToolButton
(
FIF
.
GITHUB
,
self
)
self
.
primarySplitToolButton
.
setFlyout
(
self
.
menu
)
# toggle tool button
self
.
toggleToolButton
=
ToggleToolButton
(
FIF
.
SETTING
,
self
)
self
.
toggleToolButton
.
toggled
.
connect
(
lambda
:
print
(
'Toggled'
))
self
.
toggleToolButton
.
toggle
()
# transparent toggle tool button
self
.
transparentToggleToolButton
=
TransparentToggleToolButton
(
FIF
.
GITHUB
,
self
)
# transparent tool button
self
.
tranparentToolButton
=
TransparentToolButton
(
FIF
.
MAIL
,
self
)
# transparent drop down tool button
self
.
transparentDropDownToolButton
=
TransparentDropDownToolButton
(
FIF
.
MAIL
,
self
)
self
.
transparentDropDownToolButton
.
setMenu
(
self
.
menu
)
# add buttons to layout
self
.
gridLayout
=
QGridLayout
(
self
)
self
.
gridLayout
.
addWidget
(
self
.
toolButton
,
0
,
0
)
...
...
@@ -55,6 +73,10 @@ class ToolButtonDemo(QWidget):
self
.
gridLayout
.
addWidget
(
self
.
primaryToolButton
,
1
,
0
)
self
.
gridLayout
.
addWidget
(
self
.
primaryDropDownToolButton
,
1
,
1
)
self
.
gridLayout
.
addWidget
(
self
.
primarySplitToolButton
,
1
,
2
)
self
.
gridLayout
.
addWidget
(
self
.
toggleToolButton
,
2
,
0
)
self
.
gridLayout
.
addWidget
(
self
.
transparentToggleToolButton
,
2
,
1
)
self
.
gridLayout
.
addWidget
(
self
.
tranparentToolButton
,
3
,
0
)
self
.
gridLayout
.
addWidget
(
self
.
transparentDropDownToolButton
,
3
,
1
)
self
.
resize
(
300
,
300
)
...
...
@@ -79,9 +101,17 @@ class PushButtonDemo(QWidget):
self
.
primaryButton1
=
PrimaryPushButton
(
'Accent style button'
,
self
)
self
.
primaryButton2
=
PrimaryPushButton
(
'Accent style button with icon'
,
self
,
FIF
.
UPDATE
)
# transparent push button
self
.
transparentPushButton1
=
TransparentPushButton
(
'Transparent push button'
,
self
)
self
.
transparentPushButton2
=
TransparentPushButton
(
'Transparent push button'
,
self
,
FIF
.
BOOK_SHELF
)
# toggle button
self
.
toggleButton1
=
ToggleButton
(
'Toggle Button'
,
self
)
self
.
toggleButton2
=
ToggleButton
(
'Toggle Button'
,
self
,
FIF
.
SEND
)
self
.
toggleButton1
=
TogglePushButton
(
'Toggle push button'
,
self
)
self
.
toggleButton2
=
TogglePushButton
(
'Toggle push button'
,
self
,
FIF
.
SEND
)
# transparent toggle push button
self
.
transparentTogglePushButton1
=
TransparentTogglePushButton
(
'Transparent toggle button'
,
self
)
self
.
transparentTogglePushButton2
=
TransparentTogglePushButton
(
'Transparent toggle button'
,
self
,
FIF
.
BOOK_SHELF
)
# drop down push button
self
.
dropDownPushButton1
=
DropDownPushButton
(
'Email'
,
self
)
...
...
@@ -95,6 +125,12 @@ class PushButtonDemo(QWidget):
self
.
primaryDropDownPushButton1
.
setMenu
(
self
.
menu
)
self
.
primaryDropDownPushButton2
.
setMenu
(
self
.
menu
)
# primary color drop down push button
self
.
transparentDropDownPushButton1
=
TransparentDropDownPushButton
(
'Email'
,
self
)
self
.
transparentDropDownPushButton2
=
TransparentDropDownPushButton
(
'Email'
,
self
,
FIF
.
MAIL
)
self
.
transparentDropDownPushButton1
.
setMenu
(
self
.
menu
)
self
.
transparentDropDownPushButton2
.
setMenu
(
self
.
menu
)
# split push button
self
.
splitPushButton1
=
SplitPushButton
(
'Split push button'
,
self
)
self
.
splitPushButton2
=
SplitPushButton
(
'Split push button'
,
self
,
FIF
.
GITHUB
)
...
...
@@ -119,19 +155,29 @@ class PushButtonDemo(QWidget):
self
.
gridLayout
.
addWidget
(
self
.
pushButton2
,
0
,
1
)
self
.
gridLayout
.
addWidget
(
self
.
primaryButton1
,
1
,
0
)
self
.
gridLayout
.
addWidget
(
self
.
primaryButton2
,
1
,
1
)
self
.
gridLayout
.
addWidget
(
self
.
toggleButton1
,
2
,
0
)
self
.
gridLayout
.
addWidget
(
self
.
toggleButton2
,
2
,
1
)
self
.
gridLayout
.
addWidget
(
self
.
splitPushButton1
,
3
,
0
)
self
.
gridLayout
.
addWidget
(
self
.
splitPushButton2
,
3
,
1
)
self
.
gridLayout
.
addWidget
(
self
.
primarySplitPushButton1
,
4
,
0
)
self
.
gridLayout
.
addWidget
(
self
.
primarySplitPushButton2
,
4
,
1
)
self
.
gridLayout
.
addWidget
(
self
.
dropDownPushButton1
,
5
,
0
,
Qt
.
AlignLeft
)
self
.
gridLayout
.
addWidget
(
self
.
dropDownPushButton2
,
5
,
1
,
Qt
.
AlignLeft
)
self
.
gridLayout
.
addWidget
(
self
.
primaryDropDownPushButton1
,
6
,
0
,
Qt
.
AlignLeft
)
self
.
gridLayout
.
addWidget
(
self
.
primaryDropDownPushButton2
,
6
,
1
,
Qt
.
AlignLeft
)
self
.
gridLayout
.
addWidget
(
self
.
hyperlinkButton
,
7
,
0
)
self
.
resize
(
600
,
600
)
self
.
gridLayout
.
addWidget
(
self
.
transparentPushButton1
,
2
,
0
)
self
.
gridLayout
.
addWidget
(
self
.
transparentPushButton2
,
2
,
1
)
self
.
gridLayout
.
addWidget
(
self
.
toggleButton1
,
3
,
0
)
self
.
gridLayout
.
addWidget
(
self
.
toggleButton2
,
3
,
1
)
self
.
gridLayout
.
addWidget
(
self
.
transparentTogglePushButton1
,
4
,
0
)
self
.
gridLayout
.
addWidget
(
self
.
transparentTogglePushButton2
,
4
,
1
)
self
.
gridLayout
.
addWidget
(
self
.
splitPushButton1
,
5
,
0
)
self
.
gridLayout
.
addWidget
(
self
.
splitPushButton2
,
5
,
1
)
self
.
gridLayout
.
addWidget
(
self
.
primarySplitPushButton1
,
6
,
0
)
self
.
gridLayout
.
addWidget
(
self
.
primarySplitPushButton2
,
6
,
1
)
self
.
gridLayout
.
addWidget
(
self
.
dropDownPushButton1
,
7
,
0
,
Qt
.
AlignLeft
)
self
.
gridLayout
.
addWidget
(
self
.
dropDownPushButton2
,
7
,
1
,
Qt
.
AlignLeft
)
self
.
gridLayout
.
addWidget
(
self
.
primaryDropDownPushButton1
,
8
,
0
,
Qt
.
AlignLeft
)
self
.
gridLayout
.
addWidget
(
self
.
primaryDropDownPushButton2
,
8
,
1
,
Qt
.
AlignLeft
)
self
.
gridLayout
.
addWidget
(
self
.
transparentDropDownPushButton1
,
9
,
0
,
Qt
.
AlignLeft
)
self
.
gridLayout
.
addWidget
(
self
.
transparentDropDownPushButton2
,
9
,
1
,
Qt
.
AlignLeft
)
self
.
gridLayout
.
addWidget
(
self
.
hyperlinkButton
,
10
,
0
)
self
.
resize
(
600
,
700
)
...
...
plugins/basic_input_plugin.py
浏览文件 @
a6a833cf
...
...
@@ -5,7 +5,9 @@ from qfluentwidgets import (PrimaryPushButton, SplitPushButton, DropDownPushButt
ToolButton
,
SplitToolButton
,
DropDownToolButton
,
FluentIcon
,
ToggleButton
,
SwitchButton
,
RadioButton
,
CheckBox
,
HyperlinkButton
,
Slider
,
ComboBox
,
IconWidget
,
EditableComboBox
,
PixmapLabel
,
PushButton
,
PrimaryToolButton
,
PrimarySplitToolButton
,
PrimarySplitPushButton
,
PrimaryDropDownPushButton
,
PrimaryDropDownToolButton
,
TransparentToolButton
)
PrimarySplitPushButton
,
PrimaryDropDownPushButton
,
PrimaryDropDownToolButton
,
TransparentToolButton
,
TransparentPushButton
,
ToggleToolButton
,
TransparentToggleToolButton
,
TransparentTogglePushButton
,
TransparentDropDownPushButton
,
TransparentDropDownToolButton
)
from
plugin_base
import
PluginBase
from
task_menu_factory
import
EditTextTaskMenuFactory
...
...
@@ -299,7 +301,7 @@ class RadioButtonPlugin(TextPlugin, QPyDesignerCustomWidgetPlugin):
class
ToggleButtonPlugin
(
TextPlugin
,
QPyDesignerCustomWidgetPlugin
):
""" Toggle button plugin """
""" Toggle
push
button plugin """
def
createWidget
(
self
,
parent
):
return
ToggleButton
(
self
.
toolTip
(),
parent
)
...
...
@@ -311,6 +313,84 @@ class ToggleButtonPlugin(TextPlugin, QPyDesignerCustomWidgetPlugin):
return
"ToggleButton"
class
ToggleToolButtonPlugin
(
BasicInputPlugin
,
QPyDesignerCustomWidgetPlugin
):
""" Toggle tool button plugin """
def
createWidget
(
self
,
parent
):
return
ToggleToolButton
(
FluentIcon
.
BASKETBALL
,
parent
)
def
icon
(
self
):
return
super
().
icon
(
'ToggleButton'
)
def
name
(
self
):
return
"ToggleToolButton"
class
TransparentPushButtonPlugin
(
TextPlugin
,
QPyDesignerCustomWidgetPlugin
):
""" Transparent push button plugin """
def
createWidget
(
self
,
parent
):
return
TransparentPushButton
(
self
.
toolTip
(),
parent
)
def
icon
(
self
):
return
super
().
icon
(
'Button'
)
def
name
(
self
):
return
"TransparentPushButton"
class
TransparentTogglePushButtonPlugin
(
TextPlugin
,
QPyDesignerCustomWidgetPlugin
):
""" Transparent toggle push button plugin """
def
createWidget
(
self
,
parent
):
return
TransparentTogglePushButton
(
self
.
toolTip
(),
parent
)
def
icon
(
self
):
return
super
().
icon
(
'ToggleButton'
)
def
name
(
self
):
return
"TransparentTogglePushButton"
class
TransparentDropDownPushButtonPlugin
(
TextPlugin
,
QPyDesignerCustomWidgetPlugin
):
""" Transparent drop down push button plugin """
def
createWidget
(
self
,
parent
):
return
TransparentDropDownPushButton
(
self
.
toolTip
(),
parent
)
def
icon
(
self
):
return
super
().
icon
(
'DropDownButton'
)
def
name
(
self
):
return
"TransparentDropDownPushButton"
class
TransparentToggleToolButtonPlugin
(
BasicInputPlugin
,
QPyDesignerCustomWidgetPlugin
):
""" Transparent toggle tool button plugin """
def
createWidget
(
self
,
parent
):
return
TransparentToggleToolButton
(
FluentIcon
.
BASKETBALL
,
parent
)
def
icon
(
self
):
return
super
().
icon
(
'ToggleButton'
)
def
name
(
self
):
return
"TransparentToggleToolButton"
class
TransparentDropDownToolButtonPlugin
(
BasicInputPlugin
,
QPyDesignerCustomWidgetPlugin
):
""" Transparent drop down tool button plugin """
def
createWidget
(
self
,
parent
):
return
TransparentDropDownToolButton
(
FluentIcon
.
BASKETBALL
,
parent
)
def
icon
(
self
):
return
super
().
icon
(
'DropDownButton'
)
def
name
(
self
):
return
"TransparentDropDownToolButton"
class
SliderPlugin
(
BasicInputPlugin
,
QPyDesignerCustomWidgetPlugin
):
""" Slider plugin """
...
...
qfluentwidgets/__init__.py
浏览文件 @
a6a833cf
...
...
@@ -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.
4
"
__version__
=
"0.9.
5
"
from
.components
import
*
from
.common
import
*
...
...
qfluentwidgets/_rc/qss/dark/button.qss
浏览文件 @
a6a833cf
PushButton, ToolButton, ToggleButton {
PushButton, ToolButton, ToggleButton
, ToggleToolButton
{
background: rgba(255, 255, 255, 0.0605);
border: 1px solid rgba(255, 255, 255, 0.053);
border-top: 1px solid rgba(255, 255, 255, 0.08);
...
...
@@ -36,17 +36,17 @@ PrimaryDropDownPushButton[hasIcon=true] {
padding: 5px 31px 6px 36px;
}
PushButton:hover, ToolButton:hover, ToggleButton:hover {
PushButton:hover, ToolButton:hover, ToggleButton:hover
,ToggleToolButton:hover
{
background: rgba(255, 255, 255, 0.0837);
}
PushButton:pressed, ToolButton:pressed, ToggleButton:pressed {
PushButton:pressed, ToolButton:pressed, ToggleButton:pressed
, ToggleToolButton:pressed
{
color: rgba(255, 255, 255, 0.786);
background: rgba(255, 255, 255, 0.0326);
border-top: 1px solid rgba(255, 255, 255, 0.053);
}
PushButton:disabled, ToolButton:disabled, ToggleButton:disabled {
PushButton:disabled, ToolButton:disabled, ToggleButton:disabled
, ToggleToolButton:disabled
{
color: rgba(255, 255, 255, 0.3628);
background: rgba(255, 255, 255, 0.0419);
border: 1px solid rgba(255, 255, 255, 0.053);
...
...
@@ -62,7 +62,8 @@ SplitDropButton:pressed {
PrimaryPushButton,
PrimaryToolButton,
ToggleButton:checked {
ToggleButton:checked,
ToggleToolButton:checked {
color: black;
background-color: --ThemeColorPrimary;
border: 1px solid --ThemeColorLight1;
...
...
@@ -71,7 +72,8 @@ ToggleButton:checked {
PrimaryPushButton:hover,
PrimaryToolButton:hover,
ToggleButton:checked:hover {
ToggleButton:checked:hover,
ToggleToolButton:checked:hover {
background-color: --ThemeColorDark1;
border: 1px solid --ThemeColorLight1;
border-bottom: 1px solid --ThemeColorLight2;
...
...
@@ -79,7 +81,8 @@ ToggleButton:checked:hover {
PrimaryPushButton:pressed,
PrimaryToolButton:pressed,
ToggleButton:checked:pressed {
ToggleButton:checked:pressed,
ToggleToolButton:checked:pressed {
color: rgba(0, 0, 0, 0.63);
background-color: --ThemeColorDark2;
border: 1px solid --ThemeColorDark2;
...
...
@@ -87,7 +90,8 @@ ToggleButton:checked:pressed {
PrimaryPushButton:disabled,
PrimaryToolButton:disabled,
ToggleButton:checked:disabled {
ToggleButton:checked:disabled,
ToggleToolButton:checked:disabled {
color: rgba(255, 255, 255, 0.43);
background-color: rgb(52, 52, 52);
border: 1px solid rgb(52, 52, 52);
...
...
@@ -217,24 +221,35 @@ RadioButton::indicator:disabled:checked {
stop:1 rgba(255, 255, 255, 0.158));
}
TransparentToolButton {
TransparentToolButton,
TransparentToggleToolButton,
TransparentPushButton,
TransparentTogglePushButton {
background-color: transparent;
border: none;
border-radius: 4px;
margin: 0;
}
TransparentToolButton:hover {
TransparentToolButton:hover,
TransparentToggleToolButton:hover,
TransparentPushButton:hover,
TransparentTogglePushButton:hover {
background-color: rgba(255, 255, 255, 9);
border: none;
}
TransparentToolButton:pressed {
TransparentToolButton:pressed,
TransparentToggleToolButton:pressed,
TransparentPushButton:pressed,
TransparentTogglePushButton:pressed {
background-color: rgba(255, 255, 255, 6);
border: none;
}
TransparentToolButton:disabled {
TransparentToolButton:disabled,
TransparentToggleToolButton:disabled,
TransprentPushButton:disabled,
TransprentTogglePushButton:disabled {
background-color: transparent;
border: none;
}
\ No newline at end of file
qfluentwidgets/_rc/qss/light/button.qss
浏览文件 @
a6a833cf
PushButton, ToolButton, ToggleButton {
PushButton, ToolButton, ToggleButton
, ToggleToolButton
{
color: black;
background: rgba(255, 255, 255, 0.7);
border: 1px solid rgba(0, 0, 0, 0.073);
...
...
@@ -35,17 +35,17 @@ PrimaryDropDownPushButton[hasIcon=true] {
padding: 5px 31px 6px 36px;
}
PushButton:hover, ToolButton:hover, ToggleButton:hover {
PushButton:hover, ToolButton:hover, ToggleButton:hover
, ToggleToolButton:hover
{
background: rgba(249, 249, 249, 0.5);
}
PushButton:pressed, ToolButton:pressed, ToggleButton:pressed {
PushButton:pressed, ToolButton:pressed, ToggleButton:pressed
, ToggleToolButton:pressed
{
color: rgba(0, 0, 0, 0.63);
background: rgba(249, 249, 249, 0.3);
border-bottom: 1px solid rgba(0, 0, 0, 0.073);
}
PushButton:disabled, ToolButton:disabled, ToggleButton:disabled {
PushButton:disabled, ToolButton:disabled, ToggleButton:disabled
, ToggleToolButton:disabled
{
color: rgba(0, 0, 0, 0.36);
background: rgba(249, 249, 249, 0.3);
border: 1px solid rgba(0, 0, 0, 0.06);
...
...
@@ -55,7 +55,8 @@ PushButton:disabled, ToolButton:disabled, ToggleButton:disabled {
PrimaryPushButton,
PrimaryToolButton,
ToggleButton:checked {
ToggleButton:checked,
ToggleToolButton:checked {
color: white;
background-color: --ThemeColorPrimary;
border: 1px solid --ThemeColorLight1;
...
...
@@ -64,7 +65,8 @@ ToggleButton:checked {
PrimaryPushButton:hover,
PrimaryToolButton:hover,
ToggleButton:checked:hover {
ToggleButton:checked:hover,
ToggleToolButton:checked:hover {
background-color: --ThemeColorLight1;
border: 1px solid --ThemeColorLight2;
border-bottom: 1px solid --ThemeColorDark1;
...
...
@@ -72,7 +74,8 @@ ToggleButton:checked:hover {
PrimaryPushButton:pressed,
PrimaryToolButton:pressed,
ToggleButton:checked:pressed {
ToggleButton:checked:pressed,
ToggleToolButton:checked:pressed {
color: rgba(255, 255, 255, 0.63);
background-color: --ThemeColorLight3;
border: 1px solid --ThemeColorLight3;
...
...
@@ -80,7 +83,8 @@ ToggleButton:checked:pressed {
PrimaryPushButton:disabled,
PrimaryToolButton:disabled,
ToggleButton:checked:disabled {
ToggleButton:checked:disabled,
ToggleToolButton:checked:disabled {
color: rgba(255, 255, 255, 0.9);
background-color: rgb(205, 205, 205);
border: 1px solid rgb(205, 205, 205);
...
...
@@ -217,24 +221,44 @@ RadioButton::indicator:disabled:checked {
stop:1 rgba(0, 0, 0, 0.2169));
}
TransparentToolButton {
TransparentToolButton,
TransparentToggleToolButton,
TransparentDropDownToolButton,
TransparentPushButton,
TransparentDropDownPushButton,
TransparentTogglePushButton {
background-color: transparent;
border: none;
border-radius:
4
px;
border-radius:
5
px;
margin: 0;
}
TransparentToolButton:hover {
TransparentToolButton:hover,
TransparentToggleToolButton:hover,
TransparentDropDownToolButton:hover,
TransparentPushButton:hover,
TransparentDropDownPushButton:hover,
TransparentTogglePushButton:hover {
background-color: rgba(0, 0, 0, 9);
border: none;
}
TransparentToolButton:pressed {
TransparentToolButton:pressed,
TransparentToggleToolButton:pressed,
TransparentDropDownToolButton:pressed,
TransparentPushButton:pressed,
TransparentDropDownPushButton:pressed,
TransparentTogglePushButton:pressed {
background-color: rgba(0, 0, 0, 6);
border: none;
}
TransparentToolButton:disabled {
TransparentToolButton:disabled,
TransparentToggleToolButton:disabled,
TransparentDropDownToolButton:disabled,
TransprentPushButton:disabled,
TransparentDropDownPushButton:disabled,
TransprentTogglePushButton:disabled {
background-color: transparent;
border: none;
}
qfluentwidgets/_rc/resource.py
浏览文件 @
a6a833cf
此差异已折叠。
点击以展开。
qfluentwidgets/components/widgets/__init__.py
浏览文件 @
a6a833cf
from
.button
import
(
DropDownPushButton
,
DropDownToolButton
,
PrimaryPushButton
,
PushButton
,
RadioButton
,
HyperlinkButton
,
ToolButton
,
TransparentToolButton
,
ToggleButton
,
SplitWidgetBase
,
SplitPushButton
,
SplitToolButton
,
PrimaryToolButton
,
PrimarySplitPushButton
,
PrimarySplitToolButton
,
PrimaryDropDownPushButton
,
PrimaryDropDownToolButton
)
PrimarySplitToolButton
,
PrimaryDropDownPushButton
,
PrimaryDropDownToolButton
,
TogglePushButton
,
ToggleToolButton
,
TransparentPushButton
,
TransparentTogglePushButton
,
TransparentToggleToolButton
,
TransparentDropDownPushButton
,
TransparentDropDownToolButton
)
from
.check_box
import
CheckBox
from
.combo_box
import
ComboBox
,
EditableComboBox
from
.line_edit
import
LineEdit
,
TextEdit
,
PlainTextEdit
,
LineEditButton
,
SearchLineEdit
...
...
qfluentwidgets/components/widgets/button.py
浏览文件 @
a6a833cf
...
...
@@ -112,7 +112,12 @@ class PrimaryPushButton(PushButton):
PushButton
.
_drawIcon
(
self
,
icon
,
painter
,
rect
)
class
TransparentPushButton
(
PushButton
):
""" Transparent push button """
class
ToggleButton
(
PushButton
):
""" Toggle push button """
def
_postInit
(
self
):
self
.
setCheckable
(
True
)
...
...
@@ -125,6 +130,13 @@ class ToggleButton(PushButton):
PrimaryPushButton
.
_drawIcon
(
self
,
icon
,
painter
,
rect
)
TogglePushButton
=
ToggleButton
class
TransparentTogglePushButton
(
TogglePushButton
):
""" Transparent toggle push button """
class
HyperlinkButton
(
QPushButton
):
""" Hyperlink button """
...
...
@@ -271,6 +283,24 @@ class PrimaryToolButton(ToolButton):
return
drawIcon
(
icon
,
painter
,
rect
)
class
ToggleToolButton
(
ToolButton
):
""" Toggle tool button """
def
_postInit
(
self
):
self
.
setCheckable
(
True
)
self
.
setChecked
(
False
)
def
_drawIcon
(
self
,
icon
,
painter
,
rect
):
if
not
self
.
isChecked
():
return
ToolButton
.
_drawIcon
(
self
,
icon
,
painter
,
rect
)
PrimaryToolButton
.
_drawIcon
(
self
,
icon
,
painter
,
rect
)
class
TransparentToggleToolButton
(
ToggleToolButton
):
""" Transparent toggle tool button """
class
DropDownButtonBase
:
""" Drop down button base class """
...
...
@@ -334,6 +364,10 @@ class DropDownPushButton(DropDownButtonBase, PushButton):
DropDownButtonBase
.
paintEvent
(
self
,
e
)
class
TransparentDropDownPushButton
(
DropDownPushButton
):
""" Transparent drop down push button """
class
DropDownToolButton
(
DropDownButtonBase
,
ToolButton
):
""" Drop down tool button """
...
...
@@ -350,6 +384,10 @@ class DropDownToolButton(DropDownButtonBase, ToolButton):
DropDownButtonBase
.
paintEvent
(
self
,
e
)
class
TransparentDropDownToolButton
(
DropDownToolButton
):
""" Transparent drop down tool button """
class
PrimaryDropDownButtonBase
(
DropDownButtonBase
):
""" Primary color drop down button base class """
...
...
setup.py
浏览文件 @
a6a833cf
...
...
@@ -6,7 +6,7 @@ with open('README.md', encoding='utf-8') as f:
setuptools
.
setup
(
name
=
"PyQt-Fluent-Widgets"
,
version
=
"0.9.
4
"
,
version
=
"0.9.
5
"
,
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录