RinUI 0.1.0__py3-none-any.whl → 0.1.1.post1__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 (114) hide show
  1. RinUI/__init__.py +4 -4
  2. RinUI/assets/fonts/FluentSystemIcons-Index.js +5255 -5255
  3. RinUI/components/Base.qml +78 -78
  4. RinUI/components/BasicInput/Button.qml +146 -146
  5. RinUI/components/BasicInput/CheckBox.qml +98 -98
  6. RinUI/components/BasicInput/ComboBox.qml +159 -159
  7. RinUI/components/BasicInput/DropDownButton.qml +20 -20
  8. RinUI/components/BasicInput/Hyperlink.qml +17 -17
  9. RinUI/components/BasicInput/PillButton.qml +10 -10
  10. RinUI/components/BasicInput/RadioButton.qml +94 -94
  11. RinUI/components/BasicInput/RoundButton.qml +26 -26
  12. RinUI/components/BasicInput/Slider.qml +212 -212
  13. RinUI/components/BasicInput/Switch.qml +101 -101
  14. RinUI/components/BasicInput/ToggleButton.qml +10 -10
  15. RinUI/components/BasicInput/ToolButton.qml +30 -30
  16. RinUI/components/ContextMenu.qml +183 -183
  17. RinUI/components/DateAndTime/DatePicker.qml +142 -140
  18. RinUI/components/DateAndTime/PickerView.qml +223 -223
  19. RinUI/components/DateAndTime/TimePicker.qml +114 -114
  20. RinUI/components/DialogsAndFlyouts/Dialog.qml +106 -106
  21. RinUI/components/DialogsAndFlyouts/DialogButtonBox.qml +47 -47
  22. RinUI/components/DialogsAndFlyouts/Flyout.qml +87 -87
  23. RinUI/components/DialogsAndFlyouts/Popup.qml +110 -106
  24. RinUI/components/FocusIndicator.qml +33 -33
  25. RinUI/components/IconWidget.qml +52 -52
  26. RinUI/components/Indicator.qml +89 -89
  27. RinUI/components/Layout/Expander.qml +159 -159
  28. RinUI/components/Layout/SettingExpander.qml +66 -66
  29. RinUI/components/Layout/SettingItem.qml +70 -70
  30. RinUI/components/ListAndCollections/Clip.qml +21 -21
  31. RinUI/components/ListAndCollections/Frame.qml +43 -43
  32. RinUI/components/ListAndCollections/ListView.qml +104 -104
  33. RinUI/components/ListAndCollections/ListViewDelegate.qml +82 -82
  34. RinUI/components/ListAndCollections/SettingCard.qml +72 -72
  35. RinUI/components/ListAndCollections/TableView.qml +81 -81
  36. RinUI/components/ListAndCollections/TableViewDelegate.qml +88 -88
  37. RinUI/components/Media/Avatar.qml +82 -82
  38. RinUI/components/MenusAndToolbars/Menu.qml +150 -150
  39. RinUI/components/MenusAndToolbars/MenuBar.qml +42 -42
  40. RinUI/components/MenusAndToolbars/MenuItem.qml +131 -131
  41. RinUI/components/MenusAndToolbars/MenuItemGroup.qml +43 -43
  42. RinUI/components/MenusAndToolbars/MenuSeparator.qml +13 -13
  43. RinUI/components/MenusAndToolbars/TextInputMenu.qml +37 -37
  44. RinUI/components/MenusAndToolbars/ToolSeparator.qml +16 -16
  45. RinUI/components/Navigation/ErrorPage.qml +48 -48
  46. RinUI/components/Navigation/NavigationBar.qml +179 -179
  47. RinUI/components/Navigation/NavigationItem.qml +193 -193
  48. RinUI/components/Navigation/NavigationSubItem.qml +103 -103
  49. RinUI/components/Navigation/NavigationView.qml +228 -227
  50. RinUI/components/Navigation/Segmented.qml +16 -16
  51. RinUI/components/Navigation/SegmentedItem.qml +107 -107
  52. RinUI/components/Navigation/SelectorBar.qml +12 -12
  53. RinUI/components/Navigation/SelectorBarItem.qml +88 -88
  54. RinUI/components/ScrollBar.qml +204 -204
  55. RinUI/components/ScrollView.qml +12 -12
  56. RinUI/components/Shadow.qml +47 -47
  57. RinUI/components/StatusAndInfo/InfoBadge.qml +77 -77
  58. RinUI/components/StatusAndInfo/InfoBar.qml +256 -251
  59. RinUI/components/StatusAndInfo/ProgressBar.qml +126 -126
  60. RinUI/components/StatusAndInfo/ProgressRing.qml +149 -0
  61. RinUI/components/StatusAndInfo/Toast.qml +236 -236
  62. RinUI/components/StatusAndInfo/ToolTip.qml +93 -93
  63. RinUI/components/Text/SpinBox.qml +150 -133
  64. RinUI/components/Text/Text.qml +44 -44
  65. RinUI/components/Text/TextArea.qml +117 -117
  66. RinUI/components/Text/TextField.qml +113 -113
  67. RinUI/components/Text/TextInput.qml +47 -47
  68. RinUI/components/qmldir +80 -80
  69. RinUI/core/__init__.py +4 -4
  70. RinUI/core/config.py +129 -129
  71. RinUI/core/launcher.py +129 -129
  72. RinUI/core/theme.py +339 -339
  73. RinUI/core/translator.py +26 -25
  74. RinUI/hooks/__init__.py +3 -3
  75. RinUI/hooks/hook-RinUI.py +3 -3
  76. RinUI/qmldir +108 -104
  77. RinUI/themes/Appearance.qml +36 -0
  78. RinUI/themes/Colors.qml +36 -0
  79. RinUI/themes/dark.qml +145 -145
  80. RinUI/themes/light.qml +145 -145
  81. RinUI/themes/qmldir +9 -6
  82. RinUI/themes/theme.qml +151 -149
  83. RinUI/themes/utils.qml +37 -37
  84. RinUI/utils/Animation.qml +12 -12
  85. RinUI/utils/FloatLayer.qml +132 -123
  86. RinUI/utils/FontIconLoader.qml +13 -13
  87. RinUI/utils/Position.qml +19 -19
  88. RinUI/utils/Severity.qml +13 -13
  89. RinUI/utils/Typography.qml +17 -17
  90. RinUI/utils/qmldir +4 -4
  91. RinUI/windows/CtrlBtn.qml +118 -118
  92. RinUI/windows/FluentPage.qml +92 -92
  93. RinUI/windows/FluentWindow.qml +31 -30
  94. RinUI/windows/FluentWindowBase.qml +158 -158
  95. RinUI/windows/TitleBar.qml +135 -135
  96. RinUI/windows/qmldir +7 -7
  97. RinUI/windows/window/ApplicationWindow.qml +8 -8
  98. RinUI/windows/window/Window.qml +118 -118
  99. {rinui-0.1.0.data → rinui-0.1.1.post1.data}/data/LICENSE +21 -21
  100. {rinui-0.1.0.data → rinui-0.1.1.post1.data}/data/README.md +100 -100
  101. {rinui-0.1.0.dist-info → rinui-0.1.1.post1.dist-info}/METADATA +116 -115
  102. rinui-0.1.1.post1.dist-info/RECORD +112 -0
  103. {rinui-0.1.0.dist-info → rinui-0.1.1.post1.dist-info}/WHEEL +1 -1
  104. {rinui-0.1.0.dist-info → rinui-0.1.1.post1.dist-info/licenses}/LICENSE +21 -21
  105. RinUI/__pycache__/__init__.cpython-38.pyc +0 -0
  106. RinUI/config/rin_ui.json +0 -8
  107. RinUI/core/__pycache__/__init__.cpython-38.pyc +0 -0
  108. RinUI/core/__pycache__/config.cpython-38.pyc +0 -0
  109. RinUI/core/__pycache__/launcher.cpython-38.pyc +0 -0
  110. RinUI/core/__pycache__/theme.cpython-38.pyc +0 -0
  111. RinUI/core/__pycache__/translator.cpython-38.pyc +0 -0
  112. rinui-0.1.0.dist-info/RECORD +0 -116
  113. {rinui-0.1.0.dist-info → rinui-0.1.1.post1.dist-info}/entry_points.txt +0 -0
  114. {rinui-0.1.0.dist-info → rinui-0.1.1.post1.dist-info}/top_level.txt +0 -0
@@ -1,127 +1,127 @@
1
- import QtQuick 2.15
2
- import QtQuick.Controls.Basic 2.15
3
- import Qt5Compat.GraphicalEffects 1.0
4
- import "../../themes"
5
- import "../../components"
6
-
7
- ProgressBar {
8
- id: root
9
-
10
- property color backgroundColor: indeterminate
11
- ? "transparent"
12
- : Theme.currentTheme.colors.controlBorderStrongColor
13
- property color primaryColor: Theme.currentTheme.colors.primaryColor
14
- property int radius: 99
15
- property int state: ProgressBar.Running
16
- enum State {
17
- Running,
18
- Paused,
19
- Error
20
- }
21
-
22
- // 尺寸规范
23
- implicitWidth: 200
24
- implicitHeight: 3
25
- value: 0
26
-
27
- // 背景轨道
28
- background: Rectangle {
29
- anchors.verticalCenter: parent.verticalCenter
30
- width: parent.width
31
- height: 1
32
- radius: root.radius
33
- color: backgroundColor
34
- Text {
35
- text: root.state
36
- }
37
- }
38
-
39
- // 遮罩
40
- layer.enabled: true
41
- layer.smooth: true
42
- layer.effect: OpacityMask {
43
- maskSource: Rectangle {
44
- width: root.width
45
- height: root.height
46
- radius: root.radius
47
- }
48
- }
49
-
50
- // 进度指示
51
- contentItem: Rectangle {
52
- id: indicator
53
- height: parent.height
54
- radius: root.radius
55
- color: root.state === 1 ? Theme.currentTheme.colors.systemCautionColor :
56
- root.state === 2 ? Theme.currentTheme.colors.systemCriticalColor :
57
- Theme.currentTheme.colors.primaryColor
58
-
59
- width: indeterminate ? state === 0 ? root.width / 3 : parent.width : root.visualPosition * parent.width
60
- x: indeterminate ? -indicator.width : 0
61
-
62
- NumberAnimation {
63
- target: indicator
64
-
65
- property: "x"
66
- from: -indicator.width
67
- to: root.width
68
- duration: Utils.progressBarAnimationSpeed
69
- loops: Animation.Infinite
70
- easing.type: Easing.InOutQuart
71
-
72
- running: indeterminate && state === 0
73
- }
74
-
75
- // 进度动画
76
- Behavior on width {
77
- enabled: !indeterminate
78
- NumberAnimation {
79
- duration: Utils.animationSpeed // 175
80
- easing.type: Easing.OutCubic
81
- }
82
- }
83
- Behavior on color {
84
- ColorAnimation {
85
- duration: Utils.animationSpeed
86
- easing.type: Easing.OutCubic
87
- }
88
- }
89
- }
90
-
91
- // 归位动画
92
- SequentialAnimation {
93
- running: indeterminate && state !== 0
94
- NumberAnimation {
95
- target: indicator
96
- property: "width"
97
- from: indicator.width
98
- to: root.width / 10
99
- duration: Utils.animationSpeedFaster
100
- easing.type: Easing.InQuart
101
- }
102
- NumberAnimation {
103
- target: indicator
104
- property: "width"
105
- from: 0
106
- to: root.width
107
- duration: Utils.animationSpeedMiddle
108
- easing.type: Easing.OutQuint
109
- }
110
- }
111
-
112
- onStateChanged: {
113
- if (state !== 0 && indeterminate) {
114
- indicator.x = 0
115
- } else if (state === 0 && indeterminate) {
116
- indicator.width = root.width / 3
117
- }
118
- }
119
-
120
- Component.onCompleted: {
121
- if (!indeterminate) {
122
- indicator.width = root.visualPosition * root.width
123
- } else {
124
- indicator.width = state === 0 ? root.width / 3 : parent.width
125
- }
126
- }
1
+ import QtQuick 2.15
2
+ import QtQuick.Controls.Basic 2.15
3
+ import Qt5Compat.GraphicalEffects 1.0
4
+ import "../../themes"
5
+ import "../../components"
6
+
7
+ ProgressBar {
8
+ id: root
9
+
10
+ property color backgroundColor: indeterminate
11
+ ? "transparent"
12
+ : Theme.currentTheme.colors.controlBorderStrongColor
13
+ property color primaryColor: Theme.currentTheme.colors.primaryColor
14
+ property int radius: 99
15
+ property int state: ProgressBar.Running
16
+ enum State {
17
+ Running,
18
+ Paused,
19
+ Error
20
+ }
21
+
22
+ // 尺寸规范
23
+ implicitWidth: 200
24
+ implicitHeight: 3
25
+ value: 0
26
+
27
+ // 背景轨道
28
+ background: Rectangle {
29
+ anchors.verticalCenter: parent.verticalCenter
30
+ width: parent.width
31
+ height: 1
32
+ radius: root.radius
33
+ color: backgroundColor
34
+ Text {
35
+ text: root.state
36
+ }
37
+ }
38
+
39
+ // 遮罩
40
+ layer.enabled: true
41
+ layer.smooth: true
42
+ layer.effect: OpacityMask {
43
+ maskSource: Rectangle {
44
+ width: root.width
45
+ height: root.height
46
+ radius: root.radius
47
+ }
48
+ }
49
+
50
+ // 进度指示
51
+ contentItem: Rectangle {
52
+ id: indicator
53
+ height: parent.height
54
+ radius: root.radius
55
+ color: root.state === 1 ? Theme.currentTheme.colors.systemCautionColor :
56
+ root.state === 2 ? Theme.currentTheme.colors.systemCriticalColor :
57
+ Theme.currentTheme.colors.primaryColor
58
+
59
+ width: indeterminate ? state === 0 ? root.width / 3 : parent.width : root.visualPosition * parent.width
60
+ x: indeterminate ? -indicator.width : 0
61
+
62
+ NumberAnimation {
63
+ target: indicator
64
+
65
+ property: "x"
66
+ from: -indicator.width
67
+ to: root.width
68
+ duration: Utils.progressBarAnimationSpeed
69
+ loops: Animation.Infinite
70
+ easing.type: Easing.InOutQuart
71
+
72
+ running: indeterminate && state === 0
73
+ }
74
+
75
+ // 进度动画
76
+ Behavior on width {
77
+ enabled: !indeterminate
78
+ NumberAnimation {
79
+ duration: Utils.animationSpeed // 175
80
+ easing.type: Easing.OutCubic
81
+ }
82
+ }
83
+ Behavior on color {
84
+ ColorAnimation {
85
+ duration: Utils.animationSpeed
86
+ easing.type: Easing.OutCubic
87
+ }
88
+ }
89
+ }
90
+
91
+ // 归位动画
92
+ SequentialAnimation {
93
+ running: indeterminate && state !== 0
94
+ NumberAnimation {
95
+ target: indicator
96
+ property: "width"
97
+ from: indicator.width
98
+ to: root.width / 10
99
+ duration: Utils.animationSpeedFaster
100
+ easing.type: Easing.InQuart
101
+ }
102
+ NumberAnimation {
103
+ target: indicator
104
+ property: "width"
105
+ from: 0
106
+ to: root.width
107
+ duration: Utils.animationSpeedMiddle
108
+ easing.type: Easing.OutQuint
109
+ }
110
+ }
111
+
112
+ onStateChanged: {
113
+ if (state !== 0 && indeterminate) {
114
+ indicator.x = 0
115
+ } else if (state === 0 && indeterminate) {
116
+ indicator.width = root.width / 3
117
+ }
118
+ }
119
+
120
+ Component.onCompleted: {
121
+ if (!indeterminate) {
122
+ indicator.width = root.visualPosition * root.width
123
+ } else {
124
+ indicator.width = state === 0 ? root.width / 3 : parent.width
125
+ }
126
+ }
127
127
  }
@@ -0,0 +1,149 @@
1
+ import QtQuick 2.15
2
+ import QtQuick.Controls 2.15
3
+ import QtQuick.Controls.Basic 2.15 as QQC
4
+ import Qt5Compat.GraphicalEffects 1.0
5
+ import "../../themes"
6
+ import "../../components"
7
+
8
+ QQC.ProgressBar {
9
+ id: root
10
+
11
+ property int state: ProgressRing.Running
12
+ enum State {
13
+ Running,
14
+ Paused,
15
+ Error
16
+ }
17
+
18
+ implicitWidth: size
19
+ implicitHeight: size
20
+
21
+ property int strokeWidth: 6 // 圆环宽度
22
+ property int size: 56 // 尺寸
23
+ property real radius: (Math.min(width, height) - strokeWidth) / 2
24
+
25
+ property color backgroundColor: "transparent"
26
+ property color primaryColor: Theme.currentTheme.colors.primaryColor
27
+
28
+
29
+ // 颜色根据状态变化
30
+ property color _ringColor: state === ProgressRing.Paused
31
+ ? Theme.currentTheme.colors.systemCautionColor
32
+ : state === ProgressRing.Error
33
+ ? Theme.currentTheme.colors.systemCriticalColor
34
+ : Theme.currentTheme.colors.primaryColor
35
+ property real _progress: (to - from) === 0
36
+ ? 0
37
+ : Math.max(0, Math.min(1, (value - from) / (to - from)))
38
+
39
+
40
+ background: Item {}
41
+
42
+ contentItem: Canvas {
43
+ id: canvas
44
+ anchors.fill: parent
45
+ antialiasing: true
46
+ renderTarget: Canvas.Image
47
+
48
+ property real startAngle: 0
49
+ property real sweepAngle: 270
50
+
51
+ onPaint: {
52
+ var ctx = getContext("2d")
53
+ ctx.clearRect(0, 0, width, height)
54
+ ctx.lineWidth = root.strokeWidth
55
+ ctx.lineCap = "round"
56
+
57
+ var centerX = width / 2
58
+ var centerY = height / 2
59
+
60
+ // 背景圆环
61
+ ctx.strokeStyle = root.backgroundColor
62
+ ctx.beginPath()
63
+ ctx.arc(centerX, centerY, root.radius, 0, 2 * Math.PI)
64
+ ctx.stroke()
65
+
66
+ // 前景圆环
67
+ ctx.strokeStyle = root._ringColor
68
+ ctx.beginPath()
69
+ if (root.indeterminate) {
70
+ ctx.arc(centerX, centerY, root.radius,
71
+ Math.PI * (startAngle - 90) / 180,
72
+ Math.PI * (startAngle - 90 + sweepAngle) / 180)
73
+ } else {
74
+ ctx.arc(centerX, centerY, root.radius,
75
+ -Math.PI / 2,
76
+ -Math.PI / 2 + root._progress * 2 * Math.PI)
77
+ }
78
+ ctx.stroke()
79
+ }
80
+
81
+ onStartAngleChanged: requestPaint()
82
+ onSweepAngleChanged: requestPaint()
83
+ onWidthChanged: requestPaint()
84
+ onHeightChanged: requestPaint()
85
+
86
+ Component.onCompleted: requestPaint()
87
+
88
+ // 旋转动画
89
+ SequentialAnimation on startAngle {
90
+ running: root.indeterminate && root.state === ProgressRing.Running
91
+ loops: Animation.Infinite
92
+ PropertyAnimation { from: 0; to: 450; duration: Utils.progressBarAnimationSpeed / 1.5 }
93
+ PropertyAnimation { from: 450; to: 1080; duration: Utils.progressBarAnimationSpeed / 1.5 }
94
+ }
95
+ SequentialAnimation on sweepAngle {
96
+ running: root.indeterminate && root.state === ProgressRing.Running
97
+ loops: Animation.Infinite
98
+ PropertyAnimation { from: 0; to: 180; duration: Utils.progressBarAnimationSpeed / 1.5 }
99
+ PropertyAnimation { from: 180; to: 0; duration: Utils.progressBarAnimationSpeed / 1.5 }
100
+ }
101
+
102
+ // 填充
103
+ SequentialAnimation on startAngle {
104
+ running: root.indeterminate && root.state !== ProgressRing.Running
105
+ PropertyAnimation {
106
+ from: 0; to: 0; duration: Utils.animationSpeedMiddle; easing.type: Easing.InOutCubic
107
+ }
108
+ }
109
+ SequentialAnimation on sweepAngle {
110
+ running: root.indeterminate && root.state !== ProgressRing.Running
111
+ PropertyAnimation {
112
+ from: 0; to: 360; duration: Utils.animationSpeedMiddle; easing.type: Easing.InOutCubic
113
+ }
114
+ }
115
+ }
116
+
117
+ // 动画
118
+ Behavior on _progress {
119
+ NumberAnimation {
120
+ duration: Utils.animationSpeed
121
+ easing.type: Easing.InOutQuad
122
+ }
123
+ }
124
+
125
+ // 动画
126
+ Behavior on _ringColor {
127
+ ColorAnimation {
128
+ duration: Utils.animationSpeed
129
+ easing.type: Easing.OutCubic
130
+ }
131
+ }
132
+
133
+ onStateChanged: {
134
+ if (!indeterminate)
135
+ canvas.requestPaint()
136
+ }
137
+ on_ProgressChanged: {
138
+ if (!indeterminate)
139
+ canvas.requestPaint()
140
+ }
141
+ on_RingColorChanged: {
142
+ canvas.requestPaint()
143
+ }
144
+ onBackgroundColorChanged: {
145
+ if (state === ProgressRing.Running) {
146
+ canvas.requestPaint()
147
+ }
148
+ }
149
+ }