RinUI 0.0.11__py3-none-any.whl → 0.1.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. RinUI/__init__.py +4 -4
  2. RinUI/assets/fonts/FluentSystemIcons-Index.js +5255 -5255
  3. RinUI/assets/img/default_app_icon.png +0 -0
  4. RinUI/components/Base.qml +78 -78
  5. RinUI/components/BasicInput/Button.qml +146 -147
  6. RinUI/components/BasicInput/CheckBox.qml +98 -98
  7. RinUI/components/BasicInput/ComboBox.qml +159 -159
  8. RinUI/components/BasicInput/DropDownButton.qml +20 -20
  9. RinUI/components/BasicInput/Hyperlink.qml +17 -17
  10. RinUI/components/BasicInput/PillButton.qml +10 -10
  11. RinUI/components/BasicInput/RadioButton.qml +94 -94
  12. RinUI/components/BasicInput/RoundButton.qml +26 -26
  13. RinUI/components/BasicInput/Slider.qml +212 -212
  14. RinUI/components/BasicInput/Switch.qml +101 -101
  15. RinUI/components/BasicInput/ToggleButton.qml +10 -10
  16. RinUI/components/BasicInput/ToolButton.qml +30 -30
  17. RinUI/components/ContextMenu.qml +183 -183
  18. RinUI/components/DateAndTime/DatePicker.qml +142 -140
  19. RinUI/components/DateAndTime/PickerView.qml +223 -223
  20. RinUI/components/DateAndTime/TimePicker.qml +114 -114
  21. RinUI/components/DialogsAndFlyouts/Dialog.qml +106 -106
  22. RinUI/components/DialogsAndFlyouts/DialogButtonBox.qml +47 -47
  23. RinUI/components/DialogsAndFlyouts/Flyout.qml +87 -144
  24. RinUI/components/DialogsAndFlyouts/Popup.qml +110 -106
  25. RinUI/components/FocusIndicator.qml +33 -33
  26. RinUI/components/IconWidget.qml +52 -52
  27. RinUI/components/Indicator.qml +89 -89
  28. RinUI/components/Layout/Expander.qml +159 -159
  29. RinUI/components/Layout/SettingExpander.qml +66 -66
  30. RinUI/components/Layout/SettingItem.qml +70 -70
  31. RinUI/components/ListAndCollections/Clip.qml +21 -21
  32. RinUI/components/ListAndCollections/Frame.qml +43 -43
  33. RinUI/components/ListAndCollections/ListView.qml +104 -104
  34. RinUI/components/ListAndCollections/ListViewDelegate.qml +82 -82
  35. RinUI/components/ListAndCollections/SettingCard.qml +72 -72
  36. RinUI/components/ListAndCollections/TableView.qml +81 -81
  37. RinUI/components/ListAndCollections/TableViewDelegate.qml +88 -88
  38. RinUI/components/Media/Avatar.qml +83 -0
  39. RinUI/components/MenusAndToolbars/Menu.qml +150 -150
  40. RinUI/components/MenusAndToolbars/MenuBar.qml +42 -42
  41. RinUI/components/MenusAndToolbars/MenuItem.qml +131 -131
  42. RinUI/components/MenusAndToolbars/MenuItemGroup.qml +43 -43
  43. RinUI/components/MenusAndToolbars/MenuSeparator.qml +13 -13
  44. RinUI/components/MenusAndToolbars/TextInputMenu.qml +37 -37
  45. RinUI/components/MenusAndToolbars/ToolSeparator.qml +16 -16
  46. RinUI/components/Navigation/ErrorPage.qml +48 -48
  47. RinUI/components/Navigation/NavigationBar.qml +179 -179
  48. RinUI/components/Navigation/NavigationItem.qml +193 -193
  49. RinUI/components/Navigation/NavigationSubItem.qml +103 -103
  50. RinUI/components/Navigation/NavigationView.qml +228 -227
  51. RinUI/components/Navigation/Segmented.qml +17 -0
  52. RinUI/components/Navigation/SegmentedItem.qml +108 -0
  53. RinUI/components/Navigation/SelectorBar.qml +12 -57
  54. RinUI/components/Navigation/SelectorBarItem.qml +89 -0
  55. RinUI/components/ScrollBar.qml +204 -204
  56. RinUI/components/ScrollView.qml +12 -12
  57. RinUI/components/Shadow.qml +47 -47
  58. RinUI/components/StatusAndInfo/InfoBadge.qml +77 -77
  59. RinUI/components/StatusAndInfo/InfoBar.qml +256 -251
  60. RinUI/components/StatusAndInfo/ProgressBar.qml +126 -126
  61. RinUI/components/StatusAndInfo/ProgressRing.qml +149 -0
  62. RinUI/components/StatusAndInfo/Toast.qml +236 -236
  63. RinUI/components/StatusAndInfo/ToolTip.qml +93 -93
  64. RinUI/components/Text/SpinBox.qml +150 -133
  65. RinUI/components/Text/Text.qml +44 -44
  66. RinUI/components/Text/TextArea.qml +117 -117
  67. RinUI/components/Text/TextField.qml +113 -113
  68. RinUI/components/Text/TextInput.qml +47 -47
  69. RinUI/components/qmldir +80 -77
  70. RinUI/core/__init__.py +4 -4
  71. RinUI/core/config.py +129 -129
  72. RinUI/core/launcher.py +129 -129
  73. RinUI/core/theme.py +339 -339
  74. RinUI/core/translator.py +25 -25
  75. RinUI/hooks/__init__.py +3 -3
  76. RinUI/hooks/hook-RinUI.py +3 -3
  77. RinUI/qmldir +108 -97
  78. RinUI/themes/Appearance.qml +36 -0
  79. RinUI/themes/Colors.qml +36 -0
  80. RinUI/themes/dark.qml +145 -136
  81. RinUI/themes/light.qml +145 -136
  82. RinUI/themes/qmldir +9 -6
  83. RinUI/themes/theme.qml +151 -149
  84. RinUI/themes/utils.qml +37 -37
  85. RinUI/utils/Animation.qml +12 -12
  86. RinUI/utils/FloatLayer.qml +132 -123
  87. RinUI/utils/FontIconLoader.qml +13 -13
  88. RinUI/utils/Position.qml +19 -19
  89. RinUI/utils/Severity.qml +13 -13
  90. RinUI/utils/Typography.qml +17 -17
  91. RinUI/utils/qmldir +4 -4
  92. RinUI/windows/CtrlBtn.qml +118 -118
  93. RinUI/windows/FluentPage.qml +92 -92
  94. RinUI/windows/FluentWindow.qml +31 -30
  95. RinUI/windows/FluentWindowBase.qml +158 -158
  96. RinUI/windows/TitleBar.qml +135 -135
  97. RinUI/windows/qmldir +7 -7
  98. RinUI/windows/window/ApplicationWindow.qml +8 -8
  99. RinUI/windows/window/Window.qml +118 -118
  100. {rinui-0.0.11.data → rinui-0.1.1.data}/data/LICENSE +21 -21
  101. {rinui-0.0.11.data → rinui-0.1.1.data}/data/README.md +100 -97
  102. {rinui-0.0.11.dist-info → rinui-0.1.1.dist-info}/METADATA +116 -112
  103. rinui-0.1.1.dist-info/RECORD +112 -0
  104. {rinui-0.0.11.dist-info → rinui-0.1.1.dist-info}/WHEEL +1 -1
  105. {rinui-0.0.11.dist-info → rinui-0.1.1.dist-info/licenses}/LICENSE +21 -21
  106. RinUI/__pycache__/__init__.cpython-38.pyc +0 -0
  107. RinUI/config/rin_ui.json +0 -8
  108. RinUI/core/__pycache__/__init__.cpython-38.pyc +0 -0
  109. RinUI/core/__pycache__/config.cpython-38.pyc +0 -0
  110. RinUI/core/__pycache__/launcher.cpython-38.pyc +0 -0
  111. RinUI/core/__pycache__/theme.cpython-38.pyc +0 -0
  112. RinUI/core/__pycache__/translator.cpython-38.pyc +0 -0
  113. rinui-0.0.11.dist-info/RECORD +0 -112
  114. {rinui-0.0.11.dist-info → rinui-0.1.1.dist-info}/entry_points.txt +0 -0
  115. {rinui-0.0.11.dist-info → rinui-0.1.1.dist-info}/top_level.txt +0 -0
RinUI/core/translator.py CHANGED
@@ -1,25 +1,25 @@
1
- from PySide6.QtCore import QTranslator, QLocale
2
- from .config import RINUI_PATH
3
- import os
4
-
5
-
6
- class RinUITranslator(QTranslator):
7
- """
8
- RinUI i18n translator.
9
- :param locale: QLocale, optional, default is system locale
10
- """
11
- def __init__(self, locale: QLocale = QLocale.system().name(), parent=None): # follow system
12
- super().__init__(parent)
13
- self.load(locale or QLocale())
14
-
15
- def load(self, locale: QLocale) -> bool:
16
- """
17
- Load translation file for the given locale.
18
- :param locale: QLocale, the locale to load (eg = QLocale(QLocale.Chinese, QLocale.China), QLocale("zh_CN"))
19
- :return: bool
20
- """
21
- print(f"🌏 Current locale: {locale.name()}")
22
- path = os.path.join(RINUI_PATH, "RinUI", "languages", f"{locale.name()}.qm")
23
- if not os.path.exists(path):
24
- raise FileNotFoundError(f"Cannot find translation file: {path}")
25
- return super().load(path)
1
+ from PySide6.QtCore import QTranslator, QLocale
2
+ from .config import RINUI_PATH
3
+ import os
4
+
5
+
6
+ class RinUITranslator(QTranslator):
7
+ """
8
+ RinUI i18n translator.
9
+ :param locale: QLocale, optional, default is system locale
10
+ """
11
+ def __init__(self, locale: QLocale = QLocale.system().name(), parent=None): # follow system
12
+ super().__init__(parent)
13
+ self.load(locale or QLocale())
14
+
15
+ def load(self, locale: QLocale) -> bool:
16
+ """
17
+ Load translation file for the given locale.
18
+ :param locale: QLocale, the locale to load (eg = QLocale(QLocale.Chinese, QLocale.China), QLocale("zh_CN"))
19
+ :return: bool
20
+ """
21
+ print(f"🌏 Current locale: {locale.name()}")
22
+ path = os.path.join(RINUI_PATH, "RinUI", "languages", f"{locale.name()}.qm")
23
+ if not os.path.exists(path):
24
+ raise FileNotFoundError(f"Cannot find translation file: {path}")
25
+ return super().load(path)
RinUI/hooks/__init__.py CHANGED
@@ -1,3 +1,3 @@
1
- def get_hook_dirs():
2
- import os
3
- return [os.path.dirname(__file__)]
1
+ def get_hook_dirs():
2
+ import os
3
+ return [os.path.dirname(__file__)]
RinUI/hooks/hook-RinUI.py CHANGED
@@ -1,3 +1,3 @@
1
- from PyInstaller.utils.hooks import collect_data_files
2
-
3
- datas = collect_data_files('RinUI', include_py_files=False)
1
+ from PyInstaller.utils.hooks import collect_data_files
2
+
3
+ datas = collect_data_files('RinUI', include_py_files=False)
RinUI/qmldir CHANGED
@@ -1,98 +1,109 @@
1
- module RinUI
2
-
3
- singleton Theme 1.0 themes/theme.qml
4
- singleton Utils 1.0 themes/utils.qml
5
-
6
- Shadow 1.0 components/Shadow.qml
7
- FocusIndicator 1.0 components/FocusIndicator.qml
8
-
9
- # Basic Input
10
- Button 1.0 components/BasicInput/Button.qml
11
- RoundButton 1.0 components/BasicInput/RoundButton.qml
12
- PillButton 1.0 components/BasicInput/PillButton.qml
13
- DropDownButton 1.0 components/BasicInput/DropDownButton.qml
14
- ToggleButton 1.0 components/BasicInput/ToggleButton.qml
15
- ToolButton 1.0 components/BasicInput/ToolButton.qml
16
- ComboBox 1.0 components/BasicInput/ComboBox.qml
17
- Switch 1.0 components/BasicInput/Switch.qml
18
- Hyperlink 1.0 components/BasicInput/Hyperlink.qml
19
- RadioButton 1.0 components/BasicInput/RadioButton.qml
20
- CheckBox 1.0 components/BasicInput/CheckBox.qml
21
- Slider 1.0 components/BasicInput/Slider.qml
22
-
23
- # Date & Time
24
- TimePicker 1.0 components/DateAndTime/TimePicker.qml
25
- DatePicker 1.0 components/DateAndTime/DatePicker.qml
26
- PickerView 1.0 components/DateAndTime/PickerView.qml
27
-
28
- # Dialogs & Flyouts
29
- Dialog 1.0 components/DialogsAndFlyouts/Dialog.qml
30
- Flyout 1.0 components/DialogsAndFlyouts/Flyout.qml
31
- TeachingTip 1.0 components/DialogsAndFlyouts/TeachingTip.qml
32
-
33
- # Layout
34
- Expander 1.0 components/Layout/Expander.qml
35
- SettingExpander 1.0 components/Layout/SettingExpander.qml
36
- SettingItem 1.0 components/Layout/SettingItem.qml
37
-
38
-
39
- # Text
40
- Text 1.0 components/Text/Text.qml
41
- TextField 1.0 components/Text/TextField.qml
42
- TextArea 1.0 components/Text/TextArea.qml
43
- SpinBox 1.0 components/Text/SpinBox.qml
44
- TextInput 1.0 components/Text/TextInput.qml
45
-
46
-
47
- # Status & Info
48
- InfoBadge 1.0 components/StatusAndInfo/InfoBadge.qml
49
- InfoBar 1.0 components/StatusAndInfo/InfoBar.qml
50
- ProgressBar 1.0 components/StatusAndInfo/ProgressBar.qml
51
- ToolTip 1.0 components/StatusAndInfo/ToolTip.qml
52
-
53
- # ListAndCollections
54
- Clip 1.0 components/ListAndCollections/Clip.qml
55
- Frame 1.0 components/ListAndCollections/Frame.qml
56
- SettingCard 1.0 components/ListAndCollections/SettingCard.qml
57
- ListView 1.0 components/ListAndCollections/ListView.qml
58
- ListViewDelegate 1.0 components/ListAndCollections/ListViewDelegate.qml
59
- TableView 1.0 components/ListAndCollections/TableView.qml
60
- TableViewDelegate 1.0 components/ListAndCollections/TableViewDelegate.qml
61
-
62
- # Menus & Toolbars
63
- Menu 1.0 components/MenusAndToolbars/Menu.qml
64
- TextInputMenu 1.0 components/MenusAndToolbars/TextInputMenu.qml
65
- MenuItem 1.0 components/MenusAndToolbars/MenuItem.qml
66
- MenuItemGroup 1.0 components/MenusAndToolbars/MenuItemGroup.qml
67
- MenuSeparator 1.0 components/MenusAndToolbars/MenuSeparator.qml
68
- ToolSeparator 1.0 components/MenusAndToolbars/ToolSeparator.qml
69
- MenuBar 1.0 components/MenusAndToolbars/MenuBar.qml
70
-
71
- # Navigation
72
- NavigationView 1.0 components/Navigation/NavigationView.qml
73
- NavigationBar 1.0 components/Navigation/NavigationBar.qml
74
- SelectorBar 1.0 components/Navigation/SelectorBar.qml
75
-
76
- # Window
77
- ApplicationWindow 1.0 windows/window/ApplicationWindow.qml
78
- Window 1.0 windows/window/Window.qml
79
-
80
-
81
- ScrollViewer 1.0 components/ScrollViewer.qml
82
- ScrollBar 1.0 components/ScrollBar.qml
83
-
84
- IconWidget 1.0 components/IconWidget.qml
85
-
86
-
87
- ContextMenu 1.0 components/ContextMenu.qml
88
-
89
- FluentWindow 1.0 windows/FluentWindow.qml
90
- FluentWindowBase 1.0 windows/FluentWindowBase.qml
91
- CtrlBtn 1.0 windows/CtrlBtn.qml
92
- FluentPage 1.0 windows/FluentPage.qml
93
-
94
- singleton Typography 1.0 utils/Typography.qml
95
- singleton Severity 1.0 utils/Severity.qml
96
- singleton Position 1.0 utils/Position.qml
97
-
1
+ module RinUI
2
+
3
+ singleton Theme 1.0 themes/theme.qml
4
+ singleton Utils 1.0 themes/utils.qml
5
+ singleton Colors 1.0 themes/Colors.qml
6
+ singleton Appearance 1.0 themes/Appearance.qml
7
+
8
+ Shadow 1.0 components/Shadow.qml
9
+ FocusIndicator 1.0 components/FocusIndicator.qml
10
+
11
+ # Basic Input
12
+ Button 1.0 components/BasicInput/Button.qml
13
+ RoundButton 1.0 components/BasicInput/RoundButton.qml
14
+ PillButton 1.0 components/BasicInput/PillButton.qml
15
+ DropDownButton 1.0 components/BasicInput/DropDownButton.qml
16
+ ToggleButton 1.0 components/BasicInput/ToggleButton.qml
17
+ ToolButton 1.0 components/BasicInput/ToolButton.qml
18
+ ComboBox 1.0 components/BasicInput/ComboBox.qml
19
+ Switch 1.0 components/BasicInput/Switch.qml
20
+ Hyperlink 1.0 components/BasicInput/Hyperlink.qml
21
+ RadioButton 1.0 components/BasicInput/RadioButton.qml
22
+ CheckBox 1.0 components/BasicInput/CheckBox.qml
23
+ Slider 1.0 components/BasicInput/Slider.qml
24
+
25
+ # Date & Time
26
+ TimePicker 1.0 components/DateAndTime/TimePicker.qml
27
+ DatePicker 1.0 components/DateAndTime/DatePicker.qml
28
+ PickerView 1.0 components/DateAndTime/PickerView.qml
29
+
30
+ # Dialogs & Flyouts
31
+ Dialog 1.0 components/DialogsAndFlyouts/Dialog.qml
32
+ Flyout 1.0 components/DialogsAndFlyouts/Flyout.qml
33
+ Popup 1.0 components/DialogsAndFlyouts/Popup.qml
34
+ TeachingTip 1.0 components/DialogsAndFlyouts/TeachingTip.qml
35
+
36
+ # Layout
37
+ Expander 1.0 components/Layout/Expander.qml
38
+ SettingExpander 1.0 components/Layout/SettingExpander.qml
39
+ SettingItem 1.0 components/Layout/SettingItem.qml
40
+
41
+
42
+ # Text
43
+ Text 1.0 components/Text/Text.qml
44
+ TextField 1.0 components/Text/TextField.qml
45
+ TextArea 1.0 components/Text/TextArea.qml
46
+ SpinBox 1.0 components/Text/SpinBox.qml
47
+ TextInput 1.0 components/Text/TextInput.qml
48
+
49
+
50
+ # Status & Info
51
+ InfoBadge 1.0 components/StatusAndInfo/InfoBadge.qml
52
+ InfoBar 1.0 components/StatusAndInfo/InfoBar.qml
53
+ ProgressBar 1.0 components/StatusAndInfo/ProgressBar.qml
54
+ ProgressRing 1.0 components/StatusAndInfo/ProgressRing.qml
55
+ ToolTip 1.0 components/StatusAndInfo/ToolTip.qml
56
+
57
+ # ListAndCollections
58
+ Clip 1.0 components/ListAndCollections/Clip.qml
59
+ Frame 1.0 components/ListAndCollections/Frame.qml
60
+ SettingCard 1.0 components/ListAndCollections/SettingCard.qml
61
+ ListView 1.0 components/ListAndCollections/ListView.qml
62
+ ListViewDelegate 1.0 components/ListAndCollections/ListViewDelegate.qml
63
+ TableView 1.0 components/ListAndCollections/TableView.qml
64
+ TableViewDelegate 1.0 components/ListAndCollections/TableViewDelegate.qml
65
+
66
+ # Menus & Toolbars
67
+ Menu 1.0 components/MenusAndToolbars/Menu.qml
68
+ TextInputMenu 1.0 components/MenusAndToolbars/TextInputMenu.qml
69
+ MenuItem 1.0 components/MenusAndToolbars/MenuItem.qml
70
+ MenuItemGroup 1.0 components/MenusAndToolbars/MenuItemGroup.qml
71
+ MenuSeparator 1.0 components/MenusAndToolbars/MenuSeparator.qml
72
+ ToolSeparator 1.0 components/MenusAndToolbars/ToolSeparator.qml
73
+ MenuBar 1.0 components/MenusAndToolbars/MenuBar.qml
74
+
75
+ # Media
76
+ Avatar 1.0 components/Media/Avatar.qml
77
+
78
+ # Navigation
79
+ NavigationView 1.0 components/Navigation/NavigationView.qml
80
+ NavigationBar 1.0 components/Navigation/NavigationBar.qml
81
+ SelectorBar 1.0 components/Navigation/SelectorBar.qml
82
+ SelectorBarItem 1.0 components/Navigation/SelectorBarItem.qml
83
+ Segmented 1.0 components/Navigation/Segmented.qml
84
+ SegmentedItem 1.0 components/Navigation/SegmentedItem.qml
85
+
86
+
87
+ # Window
88
+ ApplicationWindow 1.0 windows/window/ApplicationWindow.qml
89
+ Window 1.0 windows/window/Window.qml
90
+
91
+
92
+ ScrollViewer 1.0 components/ScrollViewer.qml
93
+ ScrollBar 1.0 components/ScrollBar.qml
94
+
95
+ IconWidget 1.0 components/IconWidget.qml
96
+
97
+
98
+ ContextMenu 1.0 components/ContextMenu.qml
99
+
100
+ FluentWindow 1.0 windows/FluentWindow.qml
101
+ FluentWindowBase 1.0 windows/FluentWindowBase.qml
102
+ CtrlBtn 1.0 windows/CtrlBtn.qml
103
+ FluentPage 1.0 windows/FluentPage.qml
104
+
105
+ singleton Typography 1.0 utils/Typography.qml
106
+ singleton Severity 1.0 utils/Severity.qml
107
+ singleton Position 1.0 utils/Position.qml
108
+
98
109
  FloatLayer 1.0 utils/FloatLayer.qml
@@ -0,0 +1,36 @@
1
+ pragma Singleton
2
+ import QtQuick 2.15
3
+ import "../themes"
4
+
5
+ QtObject {
6
+ id: root
7
+
8
+ readonly property var themeColors: Theme.currentTheme !== null && Theme.currentTheme !== undefined
9
+ ? Theme.currentTheme.appearance
10
+ : undefined
11
+
12
+ // JS Proxy 模拟动态属性访问
13
+ readonly property var proxy: (function() {
14
+ if (typeof Proxy === "undefined") {
15
+ console.warn("Proxy is not supported in this QML environment.")
16
+ return {}
17
+ }
18
+
19
+ return new Proxy({}, {
20
+ get(target, prop) {
21
+ if (root.themeColors && prop in root.themeColors) {
22
+ return root.themeColors[prop]
23
+ }
24
+ return undefined
25
+ },
26
+ has(target, prop) {
27
+ return root.themeColors && prop in root.themeColors
28
+ }
29
+ })
30
+ })()
31
+
32
+ // Sample: Appearance.get("controlColor") 或 Colors.proxy.controlColor
33
+ function get(name) {
34
+ return root.proxy[name]
35
+ }
36
+ }
@@ -0,0 +1,36 @@
1
+ pragma Singleton
2
+ import QtQuick 2.15
3
+ import "../themes"
4
+
5
+ QtObject {
6
+ id: root
7
+
8
+ readonly property var themeColors: Theme.currentTheme !== null && Theme.currentTheme !== undefined
9
+ ? Theme.currentTheme.colors
10
+ : undefined
11
+
12
+ // JS Proxy 模拟动态属性访问
13
+ readonly property var proxy: (function() {
14
+ if (typeof Proxy === "undefined") {
15
+ console.warn("Proxy is not supported in this QML environment.")
16
+ return {}
17
+ }
18
+
19
+ return new Proxy({}, {
20
+ get(target, prop) {
21
+ if (root.themeColors && prop in root.themeColors) {
22
+ return root.themeColors[prop]
23
+ }
24
+ return undefined
25
+ },
26
+ has(target, prop) {
27
+ return root.themeColors && prop in root.themeColors
28
+ }
29
+ })
30
+ })
31
+
32
+ // Sample: Appearance.get("windowRadius") 或 Appearance.proxy.windowRadius
33
+ function get(name) {
34
+ return root.proxy[name]
35
+ }
36
+ }
RinUI/themes/dark.qml CHANGED
@@ -1,137 +1,146 @@
1
-
2
- import QtQuick 2.15
3
- import "../themes"
4
-
5
- QtObject {
6
- property string name: "Dark"
7
- property bool isDark: true
8
-
9
- // Colors //
10
- property QtObject colors: QtObject {
11
- // Controls
12
- property color controlColor: Qt.alpha("#ffffff", 0.065)
13
- property color controlSecondaryColor: Qt.alpha("#ffffff", 0.1)
14
- property color controlTertiaryColor: Qt.alpha("#ffffff", 0.0419)
15
- property color controlQuaternaryColor: Qt.alpha("#ffffff", 0.0698)
16
- property color controlStrongColor: Qt.alpha("#ffffff", 0.5442)
17
- property color controlInputActiveColor: Qt.alpha("#1E1E1E", 0.7)
18
-
19
- property color controlBorderColor: Qt.alpha("#ffffff", 0.09)
20
- property color controlBottomBorderColor: Qt.alpha("#000000", 0.03)
21
- property color controlAccentBottomBorderColor: Qt.alpha("#000000", 0.14)
22
- property color controlBorderStrongColor: Qt.alpha("#ffffff", 0.6047)
23
- property color controlBorderAccentColor: Qt.alpha("#ffffff", 0.08)
24
- property color textControlBorderColor: Qt.alpha("#ffffff", 0.54)
25
- property color textControlBorderFocusedColor: Utils.primaryColor
26
- property color flyoutBorderColor: Qt.alpha("#000000", 0.2)
27
-
28
- property color controlSolidColor: "#454545"
29
- property color dividerBorderColor: Qt.alpha("#ffffff", 0.0837)
30
- // Accessibility
31
- property color focusBorderOuter: "#ffffff"
32
- property color focusBorderInner: Qt.alpha("#000000", 0.7)
33
-
34
- // Card
35
- property color cardColor: Qt.alpha("#ffffff", 0.0512)
36
- property color cardSecondaryColor: Qt.alpha("#ffffff", 0.0326)
37
- property color cardTertiaryColor: Qt.alpha("#ffffff", 0.0698)
38
- property color cardBorderColor: Qt.alpha("#000000", 0.1)
39
-
40
- // Background
41
- property color backgroundColor: "#202020"
42
- property color windowBorderColor: Qt.alpha("#757575", 0.0698)
43
- property color backgroundAcrylicColor: "#2c2c2c"
44
- property color backgroundSmokeColor: Qt.alpha("#000000", 0.3)
45
-
46
- property color subtleColor: "transparent"
47
- property color subtleSecondaryColor: Qt.alpha("#ffffff", 0.0605)
48
- property color subtleTertiaryColor: Qt.alpha("#ffffff", 0.0419)
49
- property color captionCloseColor: "#c42b1c"
50
- property color captionCloseTextColor: "#ffffff"
51
-
52
- // Layer
53
- property color layerColor: Qt.alpha("#3A3A3A", 0.3)
54
-
55
- // Text
56
- property color textColor: "#ffffff"
57
- property color textSecondaryColor: Qt.alpha("#ffffff", 0.6047)
58
- property color textAccentColor: primaryColor
59
- property color textOnAccentColor: "#000000"
60
- property color textSelectedColor: "#000000"
61
-
62
- property color primaryColor: Qt.color(Utils.primaryColor).lighter(1.6).darker(1.2)
63
- property color disabledColor: "#ffffff"
64
-
65
- // System Colors
66
- property color systemAttentionColor: primaryColor
67
- property color systemSuccessColor: "#6ccb5f"
68
- property color systemCautionColor: "#fce100"
69
- property color systemCriticalColor: "#ff99a4"
70
- property color systemNeutralColor: "#9f9f9f"
71
-
72
- property color systemAttentionBackgroundColor: "#2e2e2e"
73
- property color systemSuccessBackgroundColor: "#393d1b"
74
- property color systemCautionBackgroundColor: "#433519"
75
- property color systemCriticalBackgroundColor: "#442726"
76
- property color systemNeutralBackgroundColor: "#333333"
77
- }
78
-
79
- // Appearance //
80
- property QtObject appearance: QtObject {
81
- property int buttonRadius: 5
82
- property int borderWidth: 1
83
- property real borderFactor: 1.2
84
- property real borderOnAccentFactor: 1.08
85
- property int smallRadius: 3
86
-
87
- property int dialogTitleBarHeight: 32
88
- property int windowTitleBarHeight: 48
89
- property int windowRadius: 7
90
- property int windowButtonWidth: 46
91
-
92
- property int scrollBarMinWidth: 2
93
- property int scrollBarWidth: 6
94
- property int scrollBarPadding: 3
95
-
96
- property int sliderHandleSize: 20
97
- }
98
-
99
- // Shadows //
100
- property var shadows: {
101
- "dialog": {
102
- "color": Qt.rgba(0, 0, 0, 0.37), // 模糊颜色
103
- "blur": 64, // 模糊度
104
- "offsetY": 32
105
- },
106
- "tooltip": {
107
- "color": Qt.alpha("#000000", 0.14),
108
- "blur": 8,
109
- "offsetY": 4
110
- },
111
- "cardRest": {
112
- "color": Qt.rgba(0, 0, 0, 0.04),
113
- "blur": 4,
114
- "offsetY": 2
115
- },
116
- "flyout": {
117
- "color": Qt.alpha("#000000", 0.14),
118
- "blur": 24,
119
- "offsetY": 8
120
- },
121
- }
122
-
123
- // Typography //
124
- property QtObject typography: QtObject {
125
- // property string fontFamily: "Segoe UI"
126
- // property string fontIcon: "FluentSystemIcons-Resizeable.ttf" // 字体图标路径 / font icon (put it in the "assets/fonts" folder)
127
- // Font Sizes
128
- property int displaySize: 68
129
- property int titleLargeSize: 40
130
- property int titleSize: 28
131
- property int subtitleSize: 20
132
- property int bodyLargeSize: 18
133
- property int bodySize: 14
134
- property int bodyStrongSize: 14
135
- property int captionSize: 12
136
- }
1
+
2
+ import QtQuick 2.15
3
+ import "../themes"
4
+
5
+ QtObject {
6
+ property string name: "Dark"
7
+ property bool isDark: true
8
+
9
+ // Colors //
10
+ property QtObject colors: QtObject {
11
+ // Controls
12
+ property color controlColor: Qt.alpha("#ffffff", 0.065)
13
+ property color controlSecondaryColor: Qt.alpha("#ffffff", 0.1)
14
+ property color controlTertiaryColor: Qt.alpha("#ffffff", 0.0419)
15
+ property color controlQuaternaryColor: Qt.alpha("#ffffff", 0.0698)
16
+ property color controlStrongColor: Qt.alpha("#ffffff", 0.5442)
17
+ property color controlInputActiveColor: Qt.alpha("#1E1E1E", 0.7)
18
+
19
+ property color controlAltSecondaryColor: Qt.alpha("#000000", 0.1)
20
+ property color controlAltTertiaryColor: Qt.alpha("#ffffff", 0.0419)
21
+ property color controlAltQuaternaryColor: Qt.alpha("#ffffff", 0.0698)
22
+
23
+ property color controlFillColor: Qt.alpha("#ffffff", 0.0605)
24
+ property color controlFillSecondaryColor: Qt.alpha("#ffffff", 0.0837)
25
+ property color controlFillTertiaryColor: Qt.alpha("#ffffff", 0.0326)
26
+ property color controlFillQuaternaryColor: Qt.alpha("#ffffff", 0.0605)
27
+
28
+ property color controlBorderColor: Qt.alpha("#ffffff", 0.09)
29
+ property color controlBottomBorderColor: Qt.alpha("#000000", 0.03)
30
+ property color controlAccentBottomBorderColor: Qt.alpha("#000000", 0.14)
31
+ property color controlBorderStrongColor: Qt.alpha("#ffffff", 0.6047)
32
+ property color controlBorderAccentColor: Qt.alpha("#ffffff", 0.08)
33
+ property color textControlBorderColor: Qt.alpha("#ffffff", 0.54)
34
+ property color textControlBorderFocusedColor: Utils.primaryColor
35
+ property color flyoutBorderColor: Qt.alpha("#000000", 0.2)
36
+
37
+ property color controlSolidColor: "#454545"
38
+ property color dividerBorderColor: Qt.alpha("#ffffff", 0.0837)
39
+ // Accessibility
40
+ property color focusBorderOuter: "#ffffff"
41
+ property color focusBorderInner: Qt.alpha("#000000", 0.7)
42
+
43
+ // Card
44
+ property color cardColor: Qt.alpha("#ffffff", 0.0512)
45
+ property color cardSecondaryColor: Qt.alpha("#ffffff", 0.0326)
46
+ property color cardTertiaryColor: Qt.alpha("#ffffff", 0.0698)
47
+ property color cardBorderColor: Qt.alpha("#000000", 0.1)
48
+
49
+ // Background
50
+ property color backgroundColor: "#202020"
51
+ property color windowBorderColor: Qt.alpha("#757575", 0.0698)
52
+ property color backgroundAcrylicColor: "#2c2c2c"
53
+ property color backgroundSmokeColor: Qt.alpha("#000000", 0.3)
54
+
55
+ property color subtleColor: "transparent"
56
+ property color subtleSecondaryColor: Qt.alpha("#ffffff", 0.0605)
57
+ property color subtleTertiaryColor: Qt.alpha("#ffffff", 0.0419)
58
+ property color captionCloseColor: "#c42b1c"
59
+ property color captionCloseTextColor: "#ffffff"
60
+
61
+ // Layer
62
+ property color layerColor: Qt.alpha("#3A3A3A", 0.3)
63
+
64
+ // Text
65
+ property color textColor: "#ffffff"
66
+ property color textSecondaryColor: Qt.alpha("#ffffff", 0.6047)
67
+ property color textAccentColor: primaryColor
68
+ property color textOnAccentColor: "#000000"
69
+ property color textSelectedColor: "#000000"
70
+
71
+ property color primaryColor: Qt.color(Utils.primaryColor).lighter(1.6).darker(1.2)
72
+ property color disabledColor: "#ffffff"
73
+
74
+ // System Colors
75
+ property color systemAttentionColor: primaryColor
76
+ property color systemSuccessColor: "#6ccb5f"
77
+ property color systemCautionColor: "#fce100"
78
+ property color systemCriticalColor: "#ff99a4"
79
+ property color systemNeutralColor: "#9f9f9f"
80
+
81
+ property color systemAttentionBackgroundColor: "#2e2e2e"
82
+ property color systemSuccessBackgroundColor: "#393d1b"
83
+ property color systemCautionBackgroundColor: "#433519"
84
+ property color systemCriticalBackgroundColor: "#442726"
85
+ property color systemNeutralBackgroundColor: "#333333"
86
+ }
87
+
88
+ // Appearance //
89
+ property QtObject appearance: QtObject {
90
+ property int buttonRadius: 5
91
+ property int borderWidth: 1
92
+ property real borderFactor: 1.2
93
+ property real borderOnAccentFactor: 1.08
94
+ property int smallRadius: 3
95
+
96
+ property int dialogTitleBarHeight: 32
97
+ property int windowTitleBarHeight: 48
98
+ property int windowRadius: 7
99
+ property int windowButtonWidth: 46
100
+
101
+ property int scrollBarMinWidth: 2
102
+ property int scrollBarWidth: 6
103
+ property int scrollBarPadding: 3
104
+
105
+ property int sliderHandleSize: 20
106
+ }
107
+
108
+ // Shadows //
109
+ property var shadows: {
110
+ "dialog": {
111
+ "color": Qt.rgba(0, 0, 0, 0.37), // 模糊颜色
112
+ "blur": 64, // 模糊度
113
+ "offsetY": 32
114
+ },
115
+ "tooltip": {
116
+ "color": Qt.alpha("#000000", 0.14),
117
+ "blur": 8,
118
+ "offsetY": 4
119
+ },
120
+ "cardRest": {
121
+ "color": Qt.rgba(0, 0, 0, 0.04),
122
+ "blur": 4,
123
+ "offsetY": 2
124
+ },
125
+ "flyout": {
126
+ "color": Qt.alpha("#000000", 0.14),
127
+ "blur": 24,
128
+ "offsetY": 8
129
+ },
130
+ }
131
+
132
+ // Typography //
133
+ property QtObject typography: QtObject {
134
+ // property string fontFamily: "Segoe UI"
135
+ // property string fontIcon: "FluentSystemIcons-Resizeable.ttf" // 字体图标路径 / font icon (put it in the "assets/fonts" folder)
136
+ // Font Sizes
137
+ property int displaySize: 68
138
+ property int titleLargeSize: 40
139
+ property int titleSize: 28
140
+ property int subtitleSize: 20
141
+ property int bodyLargeSize: 18
142
+ property int bodySize: 14
143
+ property int bodyStrongSize: 14
144
+ property int captionSize: 12
145
+ }
137
146
  }