Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
k54kdk
PyQt Fluent Widgets
提交
87fa1ce7
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看板
提交
87fa1ce7
编写于
8月 09, 2023
作者:
之一Yo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
调整 Mica 配置项默认值
上级
9831c57c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
12 addition
and
7 deletion
+12
-7
examples/gallery/app/common/config.py
examples/gallery/app/common/config.py
+6
-1
examples/gallery/app/view/setting_interface.py
examples/gallery/app/view/setting_interface.py
+2
-5
qfluentwidgets/components/settings/setting_card.py
qfluentwidgets/components/settings/setting_card.py
+3
-0
qfluentwidgets/components/widgets/frameless_window.py
qfluentwidgets/components/widgets/frameless_window.py
+1
-1
未找到文件。
examples/gallery/app/common/config.py
浏览文件 @
87fa1ce7
# coding:utf-8
import
sys
from
enum
import
Enum
from
PyQt5.QtCore
import
QLocale
...
...
@@ -26,6 +27,10 @@ class LanguageSerializer(ConfigSerializer):
return
Language
(
QLocale
(
value
))
if
value
!=
"Auto"
else
Language
.
AUTO
def
isWin11
():
return
sys
.
platform
==
'win32'
and
sys
.
getwindowsversion
().
build
>=
22000
class
Config
(
QConfig
):
""" Config of application """
...
...
@@ -36,7 +41,7 @@ class Config(QConfig):
"Folders"
,
"Download"
,
"app/download"
,
FolderValidator
())
# main window
micaEnabled
=
ConfigItem
(
"MainWindow"
,
"MicaEnabled"
,
True
,
BoolValidator
())
micaEnabled
=
ConfigItem
(
"MainWindow"
,
"MicaEnabled"
,
isWin11
()
,
BoolValidator
())
dpiScale
=
OptionsConfigItem
(
"MainWindow"
,
"DpiScale"
,
"Auto"
,
OptionsValidator
([
1
,
1.25
,
1.5
,
1.75
,
2
,
"Auto"
]),
restart
=
True
)
language
=
OptionsConfigItem
(
...
...
examples/gallery/app/view/setting_interface.py
浏览文件 @
87fa1ce7
# coding:utf-8
import
sys
from
qfluentwidgets
import
(
SettingCardGroup
,
SwitchSettingCard
,
FolderListSettingCard
,
OptionsSettingCard
,
PushSettingCard
,
HyperlinkCard
,
PrimaryPushSettingCard
,
ScrollArea
,
...
...
@@ -12,7 +10,7 @@ from PyQt5.QtCore import Qt, pyqtSignal, QUrl, QStandardPaths
from
PyQt5.QtGui
import
QDesktopServices
from
PyQt5.QtWidgets
import
QWidget
,
QLabel
,
QFileDialog
from
..common.config
import
cfg
,
HELP_URL
,
FEEDBACK_URL
,
AUTHOR
,
VERSION
,
YEAR
from
..common.config
import
cfg
,
HELP_URL
,
FEEDBACK_URL
,
AUTHOR
,
VERSION
,
YEAR
,
isWin11
from
..common.signal_bus
import
signalBus
from
..common.style_sheet
import
StyleSheet
...
...
@@ -158,8 +156,7 @@ class SettingInterface(ScrollArea):
self
.
settingLabel
.
setObjectName
(
'settingLabel'
)
StyleSheet
.
SETTING_INTERFACE
.
apply
(
self
)
isWin11
=
sys
.
platform
==
'win32'
and
sys
.
getwindowsversion
().
build
>=
22000
self
.
micaCard
.
switchButton
.
setEnabled
(
isWin11
)
self
.
micaCard
.
setEnabled
(
isWin11
())
# initialize layout
self
.
__initLayout
()
...
...
qfluentwidgets/components/settings/setting_card.py
浏览文件 @
87fa1ce7
...
...
@@ -137,6 +137,9 @@ class SwitchSettingCard(SettingCard):
self
.
switchButton
.
setText
(
self
.
tr
(
'On'
)
if
isChecked
else
self
.
tr
(
'Off'
))
def
setChecked
(
self
,
isChecked
:
bool
):
self
.
setValue
(
isChecked
)
def
isChecked
(
self
):
return
self
.
switchButton
.
isChecked
()
...
...
qfluentwidgets/components/widgets/frameless_window.py
浏览文件 @
87fa1ce7
import
sys
if
sys
.
platform
!=
"win32"
or
sys
.
getwindowsversion
().
build
<
=
22000
:
if
sys
.
platform
!=
"win32"
or
sys
.
getwindowsversion
().
build
<
22000
:
from
qframelesswindow
import
FramelessWindow
else
:
from
ctypes.wintypes
import
MSG
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录