RinUI 0.0.9.2__tar.gz → 0.0.10.1__tar.gz

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 (112) hide show
  1. {rinui-0.0.9.2/RinUI.egg-info → rinui-0.0.10.1}/PKG-INFO +1 -1
  2. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/__init__.py +1 -1
  3. rinui-0.0.10.1/RinUI/__pycache__/__init__.cpython-38.pyc +0 -0
  4. rinui-0.0.10.1/RinUI/components/BasicInput/PillButton.qml +11 -0
  5. rinui-0.0.10.1/RinUI/components/BasicInput/RoundButton.qml +27 -0
  6. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/MenusAndToolbars/Menu.qml +5 -3
  7. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/MenusAndToolbars/MenuItem.qml +13 -0
  8. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/StatusAndInfo/InfoBar.qml +7 -1
  9. rinui-0.0.10.1/RinUI/components/Text/TextArea.qml +146 -0
  10. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/Text/TextField.qml +48 -0
  11. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/qmldir +1 -0
  12. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/core/__pycache__/__init__.cpython-38.pyc +0 -0
  13. rinui-0.0.10.1/RinUI/core/__pycache__/config.cpython-38.pyc +0 -0
  14. rinui-0.0.10.1/RinUI/core/__pycache__/launcher.cpython-38.pyc +0 -0
  15. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/core/config.py +11 -0
  16. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/core/launcher.py +18 -19
  17. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/qmldir +4 -0
  18. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/windows/TitleBar.qml +4 -0
  19. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/windows/window/Window.qml +1 -1
  20. {rinui-0.0.9.2 → rinui-0.0.10.1/RinUI.egg-info}/PKG-INFO +1 -1
  21. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI.egg-info/SOURCES.txt +3 -0
  22. {rinui-0.0.9.2 → rinui-0.0.10.1}/pyproject.toml +1 -1
  23. rinui-0.0.9.2/RinUI/__pycache__/__init__.cpython-38.pyc +0 -0
  24. rinui-0.0.9.2/RinUI/core/__pycache__/config.cpython-38.pyc +0 -0
  25. rinui-0.0.9.2/RinUI/core/__pycache__/launcher.cpython-38.pyc +0 -0
  26. {rinui-0.0.9.2 → rinui-0.0.10.1}/LICENSE +0 -0
  27. {rinui-0.0.9.2 → rinui-0.0.10.1}/MANIFEST.in +0 -0
  28. {rinui-0.0.9.2 → rinui-0.0.10.1}/README.md +0 -0
  29. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/assets/fonts/FluentSystemIcons-Index.js +0 -0
  30. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/assets/fonts/FluentSystemIcons-Resizable.ttf +0 -0
  31. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/assets/img/default_app_icon.png +0 -0
  32. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/Base.qml +0 -0
  33. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/BasicInput/Button.qml +0 -0
  34. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/BasicInput/CheckBox.qml +0 -0
  35. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/BasicInput/ComboBox.qml +0 -0
  36. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/BasicInput/DropDownButton.qml +0 -0
  37. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/BasicInput/Hyperlink.qml +0 -0
  38. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/BasicInput/RadioButton.qml +0 -0
  39. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/BasicInput/Slider.qml +0 -0
  40. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/BasicInput/Switch.qml +0 -0
  41. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/BasicInput/ToggleButton.qml +0 -0
  42. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/BasicInput/ToolButton.qml +0 -0
  43. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/ContextMenu.qml +0 -0
  44. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/DateAndTime/DatePicker.qml +0 -0
  45. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/DateAndTime/PickerView.qml +0 -0
  46. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/DateAndTime/TimePicker.qml +0 -0
  47. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/DialogsAndFlyouts/Dialog.qml +0 -0
  48. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/DialogsAndFlyouts/DialogButtonBox.qml +0 -0
  49. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/DialogsAndFlyouts/Flyout.qml +0 -0
  50. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/DialogsAndFlyouts/Popup.qml +0 -0
  51. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/FocusIndicator.qml +0 -0
  52. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/IconWidget.qml +0 -0
  53. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/Indicator.qml +0 -0
  54. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/Layout/Expander.qml +0 -0
  55. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/Layout/SettingExpander.qml +0 -0
  56. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/Layout/SettingItem.qml +0 -0
  57. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/ListAndCollections/Clip.qml +0 -0
  58. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/ListAndCollections/Frame.qml +0 -0
  59. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/ListAndCollections/ListView.qml +0 -0
  60. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/ListAndCollections/ListViewDelegate.qml +0 -0
  61. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/ListAndCollections/SettingCard.qml +0 -0
  62. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/ListAndCollections/TableView.qml +0 -0
  63. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/ListAndCollections/TableViewDelegate.qml +0 -0
  64. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/MenusAndToolbars/MenuBar.qml +0 -0
  65. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/MenusAndToolbars/MenuItemGroup.qml +0 -0
  66. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/MenusAndToolbars/MenuSeparator.qml +0 -0
  67. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/MenusAndToolbars/ToolSeparator.qml +0 -0
  68. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/Navigation/ErrorPage.qml +0 -0
  69. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/Navigation/NavigationBar.qml +0 -0
  70. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/Navigation/NavigationItem.qml +0 -0
  71. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/Navigation/NavigationSubItem.qml +0 -0
  72. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/Navigation/NavigationView.qml +0 -0
  73. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/Navigation/SelectorBar.qml +0 -0
  74. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/ScrollBar.qml +0 -0
  75. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/ScrollView.qml +0 -0
  76. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/Shadow.qml +0 -0
  77. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/StatusAndInfo/InfoBadge.qml +0 -0
  78. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/StatusAndInfo/ProgressBar.qml +0 -0
  79. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/StatusAndInfo/Toast.qml +0 -0
  80. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/StatusAndInfo/ToolTip.qml +0 -0
  81. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/Text/SpinBox.qml +0 -0
  82. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/Text/Text.qml +0 -0
  83. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/Text/TextInput.qml +0 -0
  84. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/config/rin_ui.json +0 -0
  85. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/core/__init__.py +0 -0
  86. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/core/__pycache__/theme.cpython-38.pyc +0 -0
  87. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/core/theme.py +0 -0
  88. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/hooks/__init__.py +0 -0
  89. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/hooks/hook-RinUI.py +0 -0
  90. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/themes/dark.qml +0 -0
  91. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/themes/light.qml +0 -0
  92. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/themes/qmldir +0 -0
  93. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/themes/theme.qml +0 -0
  94. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/themes/utils.qml +0 -0
  95. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/utils/Animation.qml +0 -0
  96. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/utils/FloatLayer.qml +0 -0
  97. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/utils/FontIconLoader.qml +0 -0
  98. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/utils/Position.qml +0 -0
  99. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/utils/Severity.qml +0 -0
  100. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/utils/Typography.qml +0 -0
  101. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/utils/qmldir +0 -0
  102. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/windows/CtrlBtn.qml +0 -0
  103. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/windows/FluentPage.qml +0 -0
  104. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/windows/FluentWindow.qml +0 -0
  105. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/windows/FluentWindowBase.qml +0 -0
  106. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/windows/qmldir +0 -0
  107. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/windows/window/ApplicationWindow.qml +0 -0
  108. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI.egg-info/dependency_links.txt +0 -0
  109. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI.egg-info/entry_points.txt +0 -0
  110. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI.egg-info/requires.txt +0 -0
  111. {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI.egg-info/top_level.txt +0 -0
  112. {rinui-0.0.9.2 → rinui-0.0.10.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: RinUI
3
- Version: 0.0.9.2
3
+ Version: 0.0.10.1
4
4
  Summary: A Fluent Design-like UI library for Qt Quick (QML) based on PySide6
5
5
  Author-email: RinLit <lintu233_qwq@icloud.com>
6
6
  Classifier: Programming Language :: Python :: 3
@@ -1,4 +1,4 @@
1
1
  from .core import *
2
2
 
3
- __version__ = "0.0.9.2"
3
+ __version__ = "0.0.10"
4
4
  __author__ = "RinLit"
@@ -0,0 +1,11 @@
1
+ import QtQuick 2.15
2
+ import QtQuick.Controls.Basic 2.15
3
+ import QtQuick.Layouts 2.15
4
+ import "../../themes"
5
+ import "../../components"
6
+
7
+ RoundButton {
8
+ id: root
9
+ highlighted: checked
10
+ checkable: true
11
+ }
@@ -0,0 +1,27 @@
1
+ import QtQuick 2.15
2
+ import QtQuick.Controls.Basic 2.15
3
+ import QtQuick.Layouts 2.15
4
+ import Qt5Compat.GraphicalEffects
5
+ import "../../themes"
6
+ import "../../components"
7
+
8
+ Button {
9
+ id: root
10
+ property alias radius: background.radius
11
+ backgroundColor: highlighted ? primaryColor : Theme.currentTheme.colors.controlQuaternaryColor
12
+
13
+ background: Rectangle {
14
+ id: background
15
+ anchors.fill: parent
16
+ color: hovered ? hoverColor : backgroundColor
17
+ radius: height / 2
18
+
19
+ border.width: Theme.currentTheme.appearance.borderWidth // 边框宽度 / Border Width
20
+ border.color: flat ? "transparent" :
21
+ enabled ? highlighted ? primaryColor : Theme.currentTheme.colors.controlBorderColor :
22
+ highlighted ? Theme.currentTheme.colors.disabledColor : Theme.currentTheme.colors.controlBorderColor
23
+
24
+ Behavior on color { ColorAnimation { duration: Utils.appearanceSpeed; easing.type: Easing.OutQuart } }
25
+ opacity: flat && !hovered || !hoverable ? 0 : 1
26
+ }
27
+ }
@@ -19,7 +19,8 @@ Menu {
19
19
  case Position.Right:
20
20
  return parent.width + 5
21
21
  default:
22
- return (parent.width - root.width) / 2
22
+ // return (parent.width - root.width) / 2
23
+ return root.x
23
24
  }
24
25
  }
25
26
 
@@ -33,7 +34,8 @@ Menu {
33
34
  case Position.Right:
34
35
  return (parent.height - root.height) / 2
35
36
  default:
36
- return -root.height + 5 // 默认顶部
37
+ // return -root.height + 5 // 默认顶部
38
+ return root.y
37
39
  }
38
40
  }
39
41
 
@@ -49,7 +51,7 @@ Menu {
49
51
  property: "opacity"
50
52
  from: 0
51
53
  to: 1
52
- duration: 70
54
+ duration: Utils.animationSpeed
53
55
  easing.type: Easing.InOutQuart
54
56
  }
55
57
  NumberAnimation {
@@ -116,4 +116,17 @@ MenuItem {
116
116
 
117
117
  Behavior on color { ColorAnimation { duration: Utils.animationSpeed; easing.type: Easing.OutQuart } }
118
118
  }
119
+
120
+ // States //
121
+ // 状态变化
122
+ states: [
123
+ State {
124
+ name: "disabled"
125
+ when: !enabled
126
+ PropertyChanges {
127
+ target: root
128
+ opacity: 0.3628
129
+ }
130
+ }
131
+ ]
119
132
  }
@@ -104,6 +104,7 @@ Frame {
104
104
  }
105
105
 
106
106
  Flow {
107
+ id: flow
107
108
  Layout.alignment: Qt.AlignTop
108
109
  Layout.fillWidth: true
109
110
  Layout.topMargin: 3
@@ -118,7 +119,12 @@ Frame {
118
119
  }
119
120
  Text {
120
121
  id: bodyText
121
- property bool wrap: (infoBar.width - titleText.width - custom.width - 24) < implicitWidth
122
+ property bool wrap: (
123
+ (
124
+ infoBar.width - iconWidget.width - rights.width - main.spacing * 2 - infoBar.padding * 2
125
+ )
126
+ < implicitWidth
127
+ )
122
128
  width: wrap ?
123
129
  parent.width : implicitWidth
124
130
  typography: Typography.Body
@@ -0,0 +1,146 @@
1
+ import QtQuick 2.15
2
+ import Qt5Compat.GraphicalEffects
3
+ import QtQuick.Controls.Basic 2.15
4
+ import "../../themes"
5
+ import "../../components"
6
+
7
+ TextArea {
8
+ id: root
9
+
10
+ property bool frameless: false
11
+ property bool editable: true
12
+ property color primaryColor: Theme.currentTheme.colors.primaryColor
13
+
14
+ selectByMouse: true
15
+ enabled: editable
16
+
17
+ // Menu
18
+ Menu {
19
+ id: contextMenu
20
+ position: -1
21
+ Action {
22
+ icon.name: "ic_fluent_cut_20_regular"
23
+ text: qsTr("Cut")
24
+ enabled: root.selectedText.length > 0 && root.editable // 选中&可编辑
25
+ shortcut: "Ctrl+X"
26
+ onTriggered: root.cut()
27
+ }
28
+ Action {
29
+ icon.name: "ic_fluent_copy_20_regular"
30
+ text: qsTr("Copy")
31
+ enabled: root.selectedText.length > 0 // 选中内容
32
+ shortcut: "Ctrl+C"
33
+ onTriggered: root.copy()
34
+ }
35
+ Action {
36
+ icon.name: "ic_fluent_clipboard_paste_20_regular"
37
+ text: qsTr("Paste")
38
+ enabled: root.editable
39
+ shortcut: "Ctrl+V"
40
+ onTriggered: root.paste()
41
+ }
42
+ Action {
43
+ icon.name: " "
44
+ text: qsTr("Select All")
45
+ shortcut: "Ctrl+A"
46
+ onTriggered: root.selectAll()
47
+ }
48
+ }
49
+
50
+ MouseArea {
51
+ anchors.fill: parent
52
+ acceptedButtons: Qt.RightButton
53
+ propagateComposedEvents: true
54
+ onPressed: (mouse) => {
55
+ if (mouse.button === Qt.RightButton)
56
+ contextMenu.popup(mouse.scenePosition)
57
+ mouse.accepted = false
58
+ }
59
+
60
+ // 鼠标
61
+ cursorShape: Qt.IBeamCursor
62
+ }
63
+
64
+ // 背景 / Background //
65
+ background: Rectangle {
66
+ id: background
67
+ anchors.fill: parent
68
+ radius: Theme.currentTheme.appearance.buttonRadius
69
+ color: frameless ? "transparent" : Theme.currentTheme.colors.controlColor
70
+ clip: true
71
+ border.width: Theme.currentTheme.appearance.borderWidth
72
+ border.color: frameless ? root.activeFocus ? Theme.currentTheme.colors.controlBorderColor : "transparent" :
73
+ Theme.currentTheme.colors.controlBorderColor
74
+
75
+ layer.enabled: true
76
+ layer.smooth: true
77
+ layer.effect: OpacityMask {
78
+ maskSource: Rectangle {
79
+ width: background.width
80
+ height: background.height
81
+ radius: background.radius
82
+ }
83
+ }
84
+
85
+ // 底部指示器 / indicator //
86
+ Rectangle {
87
+ id: indicator
88
+ width: parent.width
89
+ anchors.horizontalCenter: parent.horizontalCenter
90
+ anchors.bottom: parent.bottom
91
+ radius: 999
92
+ height: root.activeFocus ? Theme.currentTheme.appearance.borderWidth * 2 : Theme.currentTheme.appearance.borderWidth
93
+ color: root.activeFocus ? primaryColor : frameless ? "transparent" : Theme.currentTheme.colors.textControlBorderColor
94
+
95
+ Behavior on color { ColorAnimation { duration: Utils.animationSpeed; easing.type: Easing.OutQuint } }
96
+ Behavior on height { NumberAnimation { duration: Utils.animationSpeed; easing.type: Easing.OutQuint } }
97
+ }
98
+ }
99
+
100
+ Behavior on opacity { NumberAnimation { duration: Utils.animationSpeed; easing.type: Easing.OutQuint } }
101
+
102
+
103
+ // 字体 / Font //
104
+ font.pixelSize: Theme.currentTheme.typography.bodySize
105
+
106
+ wrapMode: Text.WordWrap // 自动换行
107
+ selectionColor: Theme.currentTheme.colors.primaryColor
108
+ color: Theme.currentTheme.colors.textColor
109
+ placeholderTextColor: Theme.currentTheme.colors.textSecondaryColor
110
+
111
+ leftPadding: 12
112
+ rightPadding: 12
113
+ topPadding: 5
114
+ bottomPadding: 7
115
+
116
+ // 动画 / Animation //
117
+ Behavior on implicitHeight { NumberAnimation { duration: Utils.animationSpeed; easing.type: Easing.OutQuint } }
118
+
119
+ // 状态
120
+ states: [
121
+ State {
122
+ name: "disabled"
123
+ when: !enabled
124
+ PropertyChanges { // 禁用时禁止改变属性
125
+ target: root;
126
+ opacity: !editable ? 1 : 0.4
127
+ }
128
+ },
129
+ State {
130
+ name: "pressed&focused"
131
+ when: activeFocus
132
+ PropertyChanges {
133
+ target: background;
134
+ color: Theme.currentTheme.colors.controlInputActiveColor
135
+ }
136
+ },
137
+ State {
138
+ name: "hovered"
139
+ when: hovered
140
+ PropertyChanges {
141
+ target: background;
142
+ color: Theme.currentTheme.colors.controlSecondaryColor
143
+ }
144
+ }
145
+ ]
146
+ }
@@ -2,6 +2,7 @@ import QtQuick 2.15
2
2
  import Qt5Compat.GraphicalEffects
3
3
  import QtQuick.Controls.Basic 2.15
4
4
  import "../../themes"
5
+ import "../../components"
5
6
 
6
7
  TextField {
7
8
  id: root
@@ -13,6 +14,53 @@ TextField {
13
14
  selectByMouse: true
14
15
  enabled: editable
15
16
 
17
+ // Menu
18
+ Menu {
19
+ id: contextMenu
20
+ position: -1
21
+ Action {
22
+ icon.name: "ic_fluent_cut_20_regular"
23
+ text: qsTr("Cut")
24
+ enabled: root.selectedText.length > 0 && root.editable // 选中&可编辑
25
+ shortcut: "Ctrl+X"
26
+ onTriggered: root.cut()
27
+ }
28
+ Action {
29
+ icon.name: "ic_fluent_copy_20_regular"
30
+ text: qsTr("Copy")
31
+ enabled: root.selectedText.length > 0 // 选中内容
32
+ shortcut: "Ctrl+C"
33
+ onTriggered: root.copy()
34
+ }
35
+ Action {
36
+ icon.name: "ic_fluent_clipboard_paste_20_regular"
37
+ text: qsTr("Paste")
38
+ enabled: root.editable
39
+ shortcut: "Ctrl+V"
40
+ onTriggered: root.paste()
41
+ }
42
+ Action {
43
+ icon.name: " "
44
+ text: qsTr("Select All")
45
+ shortcut: "Ctrl+A"
46
+ onTriggered: root.selectAll()
47
+ }
48
+ }
49
+
50
+ MouseArea {
51
+ anchors.fill: parent
52
+ acceptedButtons: Qt.RightButton
53
+ propagateComposedEvents: true
54
+ onPressed: (mouse) => {
55
+ if (mouse.button === Qt.RightButton)
56
+ contextMenu.popup(mouse.scenePosition)
57
+ mouse.accepted = false
58
+ }
59
+
60
+ // 鼠标
61
+ cursorShape: Qt.IBeamCursor
62
+ }
63
+
16
64
  // 背景 / Background //
17
65
  background: Rectangle {
18
66
  id: background
@@ -14,6 +14,7 @@ ScrollView 1.0 ScrollView.qml
14
14
 
15
15
  # Basic Input
16
16
  Button 1.0 BasicInput/Button.qml
17
+ RoundButton 1.0 BasicInput/RoundButton.qml
17
18
  HyperlinkButton 1.0 BasicInput/HyperlinkButton.qml
18
19
  Slider 1.0 BasicInput/Slider.qml
19
20
  Hyperlink 1.0 BasicInput/Hyperlink.qml
@@ -1,6 +1,7 @@
1
1
  import os
2
2
  import json
3
3
  import platform
4
+ import sys
4
5
  from enum import Enum
5
6
 
6
7
 
@@ -22,8 +23,18 @@ def is_windows():
22
23
  return platform.system() == 'Windows'
23
24
 
24
25
 
26
+ def resource_path(relative_path):
27
+ """兼容 PyInstaller 打包和开发环境的路径"""
28
+ if hasattr(sys, '_MEIPASS'):
29
+ return os.path.join(sys._MEIPASS, relative_path)
30
+ return os.path.abspath(relative_path)
31
+
32
+
33
+ rinui_core_path = os.path.abspath(os.path.dirname(__file__)) # RinUI/core 目录
34
+
25
35
  BASE_DIR = os.path.abspath(os.getcwd())
26
36
  PATH = os.path.join(BASE_DIR, "RinUI/config")
37
+ RINUI_PATH = resource_path(os.path.join(rinui_core_path, "../../")) # 使用 resource_path 处理路径
27
38
  DEFAULT_CONFIG = {
28
39
  "language": "zh_CN",
29
40
  "theme": {
@@ -1,18 +1,12 @@
1
1
  import os
2
2
  import sys
3
3
 
4
- from PySide6.QtCore import QCoreApplication, QObject
4
+ from PySide6.QtCore import QCoreApplication, QUrl
5
+ from PySide6.QtGui import QIcon
5
6
  from PySide6.QtWidgets import QApplication, QWidget, QPushButton, QVBoxLayout
6
7
  from PySide6.QtQml import QQmlApplicationEngine
7
8
  from .theme import ThemeManager
8
- from .config import BackdropEffect, is_windows, Theme
9
-
10
-
11
- def resource_path(relative_path):
12
- """兼容 PyInstaller 打包和开发环境的路径"""
13
- if hasattr(sys, '_MEIPASS'):
14
- return os.path.join(sys._MEIPASS, relative_path)
15
- return os.path.abspath(relative_path)
9
+ from .config import BackdropEffect, is_windows, Theme, RINUI_PATH
16
10
 
17
11
 
18
12
  class TestWindow(QWidget):
@@ -29,14 +23,7 @@ class TestWindow(QWidget):
29
23
  self.resize(400, 300)
30
24
 
31
25
 
32
- class RinUIWindow(QObject):
33
- # _instance = None
34
- #
35
- # def __new__(cls, *args, **kwargs): # 单例模式管理
36
- # if cls._instance is None:
37
- # cls._instance = super().__new__(cls)
38
- # return cls._instance
39
-
26
+ class RinUIWindow:
40
27
  def __init__(self, qml_path: str):
41
28
  """
42
29
  创建基于 RinUI 的 QML 应用程序。
@@ -64,8 +51,7 @@ class RinUIWindow(QObject):
64
51
  def _setup_application(self):
65
52
  """Setup"""
66
53
  # RInUI 模块
67
- rinui_path = os.path.abspath(os.path.dirname(__file__)) # RinUI/core 目录
68
- rinui_import_path = resource_path(os.path.join(rinui_path, "../../")) # 使用 resource_path 处理路径
54
+ rinui_import_path = RINUI_PATH
69
55
  print(f"UI Module Path: {rinui_import_path}")
70
56
 
71
57
  if os.path.exists(rinui_import_path):
@@ -89,6 +75,19 @@ class RinUIWindow(QObject):
89
75
  self.theme_manager.set_window(self.root_window)
90
76
  self._apply_windows_effects() if self.autoSetWindowsEffect else None
91
77
 
78
+ def setIcon(self, path: str) -> None:
79
+ """
80
+ 设置应用程序图标。
81
+ :param path: str, 图标路径
82
+ :return:
83
+ """
84
+ app_instance = QApplication.instance()
85
+ if app_instance:
86
+ app_instance.setWindowIcon(QIcon(path)) # 设置应用程序图标
87
+ self.root_window.setProperty('icon', QUrl.fromLocalFile(path))
88
+ else:
89
+ raise RuntimeError("Cannot set icon before QApplication is created.")
90
+
92
91
  def _apply_windows_effects(self):
93
92
  """
94
93
  Apply Windows effects to the window.
@@ -8,6 +8,8 @@ FocusIndicator 1.0 components/FocusIndicator.qml
8
8
 
9
9
  # Basic Input
10
10
  Button 1.0 components/BasicInput/Button.qml
11
+ RoundButton 1.0 components/BasicInput/RoundButton.qml
12
+ PillButton 1.0 components/BasicInput/PillButton.qml
11
13
  DropDownButton 1.0 components/BasicInput/DropDownButton.qml
12
14
  ToggleButton 1.0 components/BasicInput/ToggleButton.qml
13
15
  ToolButton 1.0 components/BasicInput/ToolButton.qml
@@ -26,6 +28,7 @@ PickerView 1.0 components/DateAndTime/PickerView.qml
26
28
  # Dialogs & Flyouts
27
29
  Dialog 1.0 components/DialogsAndFlyouts/Dialog.qml
28
30
  Flyout 1.0 components/DialogsAndFlyouts/Flyout.qml
31
+ TeachingTip 1.0 components/DialogsAndFlyouts/TeachingTip.qml
29
32
 
30
33
  # Layout
31
34
  Expander 1.0 components/Layout/Expander.qml
@@ -36,6 +39,7 @@ SettingItem 1.0 components/Layout/SettingItem.qml
36
39
  # Text
37
40
  Text 1.0 components/Text/Text.qml
38
41
  TextField 1.0 components/Text/TextField.qml
42
+ TextArea 1.0 components/Text/TextArea.qml
39
43
  SpinBox 1.0 components/Text/SpinBox.qml
40
44
  TextInput 1.0 components/Text/TextInput.qml
41
45
 
@@ -57,6 +57,10 @@ Item {
57
57
 
58
58
  onPressed: {
59
59
  clickPos = Qt.point(mouseX, mouseY)
60
+
61
+ if (!(Qt.platform.os !== "windows" || Qt.platform.os !== "winrt") && !Theme.isThemeMgrInitialized()) {
62
+ return // 在win环境使用原生方法拖拽
63
+ }
60
64
  Theme.sendDragWindowEvent(window)
61
65
  }
62
66
  onDoubleClicked: toggleMaximized()
@@ -3,6 +3,7 @@ import QtQuick.Controls 2.15
3
3
  import QtQuick.Layouts 2.15
4
4
  import "../../windows"
5
5
  import "../../themes"
6
+ import "../../utils"
6
7
 
7
8
  Window {
8
9
  id: baseWindow
@@ -11,7 +12,6 @@ Window {
11
12
 
12
13
  color: frameless ? "transparent" : Theme.currentTheme.colors.backgroundColor
13
14
  property bool frameless: false
14
- property alias floatLayer: baseWindow.floatLayer
15
15
  default property alias content: baseWindow.data
16
16
  property int titleBarHeight: Theme.currentTheme.appearance.dialogTitleBarHeight
17
17
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: RinUI
3
- Version: 0.0.9.2
3
+ Version: 0.0.10.1
4
4
  Summary: A Fluent Design-like UI library for Qt Quick (QML) based on PySide6
5
5
  Author-email: RinLit <lintu233_qwq@icloud.com>
6
6
  Classifier: Programming Language :: Python :: 3
@@ -28,7 +28,9 @@ RinUI/components/BasicInput/CheckBox.qml
28
28
  RinUI/components/BasicInput/ComboBox.qml
29
29
  RinUI/components/BasicInput/DropDownButton.qml
30
30
  RinUI/components/BasicInput/Hyperlink.qml
31
+ RinUI/components/BasicInput/PillButton.qml
31
32
  RinUI/components/BasicInput/RadioButton.qml
33
+ RinUI/components/BasicInput/RoundButton.qml
32
34
  RinUI/components/BasicInput/Slider.qml
33
35
  RinUI/components/BasicInput/Switch.qml
34
36
  RinUI/components/BasicInput/ToggleButton.qml
@@ -69,6 +71,7 @@ RinUI/components/StatusAndInfo/Toast.qml
69
71
  RinUI/components/StatusAndInfo/ToolTip.qml
70
72
  RinUI/components/Text/SpinBox.qml
71
73
  RinUI/components/Text/Text.qml
74
+ RinUI/components/Text/TextArea.qml
72
75
  RinUI/components/Text/TextField.qml
73
76
  RinUI/components/Text/TextInput.qml
74
77
  RinUI/config/rin_ui.json
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "RinUI"
7
- version = "0.0.9.2"
7
+ version = "0.0.10.1"
8
8
  authors = [
9
9
  { name = "RinLit", email = "lintu233_qwq@icloud.com" }
10
10
  ]
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes