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.
- {rinui-0.0.9.2/RinUI.egg-info → rinui-0.0.10.1}/PKG-INFO +1 -1
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/__init__.py +1 -1
- rinui-0.0.10.1/RinUI/__pycache__/__init__.cpython-38.pyc +0 -0
- rinui-0.0.10.1/RinUI/components/BasicInput/PillButton.qml +11 -0
- rinui-0.0.10.1/RinUI/components/BasicInput/RoundButton.qml +27 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/MenusAndToolbars/Menu.qml +5 -3
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/MenusAndToolbars/MenuItem.qml +13 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/StatusAndInfo/InfoBar.qml +7 -1
- rinui-0.0.10.1/RinUI/components/Text/TextArea.qml +146 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/Text/TextField.qml +48 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/qmldir +1 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/core/__pycache__/__init__.cpython-38.pyc +0 -0
- rinui-0.0.10.1/RinUI/core/__pycache__/config.cpython-38.pyc +0 -0
- rinui-0.0.10.1/RinUI/core/__pycache__/launcher.cpython-38.pyc +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/core/config.py +11 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/core/launcher.py +18 -19
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/qmldir +4 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/windows/TitleBar.qml +4 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/windows/window/Window.qml +1 -1
- {rinui-0.0.9.2 → rinui-0.0.10.1/RinUI.egg-info}/PKG-INFO +1 -1
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI.egg-info/SOURCES.txt +3 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/pyproject.toml +1 -1
- rinui-0.0.9.2/RinUI/__pycache__/__init__.cpython-38.pyc +0 -0
- rinui-0.0.9.2/RinUI/core/__pycache__/config.cpython-38.pyc +0 -0
- rinui-0.0.9.2/RinUI/core/__pycache__/launcher.cpython-38.pyc +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/LICENSE +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/MANIFEST.in +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/README.md +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/assets/fonts/FluentSystemIcons-Index.js +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/assets/fonts/FluentSystemIcons-Resizable.ttf +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/assets/img/default_app_icon.png +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/Base.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/BasicInput/Button.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/BasicInput/CheckBox.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/BasicInput/ComboBox.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/BasicInput/DropDownButton.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/BasicInput/Hyperlink.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/BasicInput/RadioButton.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/BasicInput/Slider.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/BasicInput/Switch.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/BasicInput/ToggleButton.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/BasicInput/ToolButton.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/ContextMenu.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/DateAndTime/DatePicker.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/DateAndTime/PickerView.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/DateAndTime/TimePicker.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/DialogsAndFlyouts/Dialog.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/DialogsAndFlyouts/DialogButtonBox.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/DialogsAndFlyouts/Flyout.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/DialogsAndFlyouts/Popup.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/FocusIndicator.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/IconWidget.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/Indicator.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/Layout/Expander.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/Layout/SettingExpander.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/Layout/SettingItem.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/ListAndCollections/Clip.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/ListAndCollections/Frame.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/ListAndCollections/ListView.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/ListAndCollections/ListViewDelegate.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/ListAndCollections/SettingCard.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/ListAndCollections/TableView.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/ListAndCollections/TableViewDelegate.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/MenusAndToolbars/MenuBar.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/MenusAndToolbars/MenuItemGroup.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/MenusAndToolbars/MenuSeparator.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/MenusAndToolbars/ToolSeparator.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/Navigation/ErrorPage.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/Navigation/NavigationBar.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/Navigation/NavigationItem.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/Navigation/NavigationSubItem.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/Navigation/NavigationView.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/Navigation/SelectorBar.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/ScrollBar.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/ScrollView.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/Shadow.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/StatusAndInfo/InfoBadge.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/StatusAndInfo/ProgressBar.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/StatusAndInfo/Toast.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/StatusAndInfo/ToolTip.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/Text/SpinBox.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/Text/Text.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/components/Text/TextInput.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/config/rin_ui.json +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/core/__init__.py +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/core/__pycache__/theme.cpython-38.pyc +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/core/theme.py +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/hooks/__init__.py +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/hooks/hook-RinUI.py +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/themes/dark.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/themes/light.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/themes/qmldir +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/themes/theme.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/themes/utils.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/utils/Animation.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/utils/FloatLayer.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/utils/FontIconLoader.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/utils/Position.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/utils/Severity.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/utils/Typography.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/utils/qmldir +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/windows/CtrlBtn.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/windows/FluentPage.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/windows/FluentWindow.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/windows/FluentWindowBase.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/windows/qmldir +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI/windows/window/ApplicationWindow.qml +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI.egg-info/dependency_links.txt +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI.egg-info/entry_points.txt +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI.egg-info/requires.txt +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/RinUI.egg-info/top_level.txt +0 -0
- {rinui-0.0.9.2 → rinui-0.0.10.1}/setup.cfg +0 -0
Binary file
|
@@ -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:
|
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: (
|
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
|
Binary file
|
Binary file
|
Binary file
|
@@ -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,
|
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
|
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
|
-
|
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
|
|
@@ -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
|
Binary file
|
Binary file
|
Binary file
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|