RinUI 0.0.10.1__py3-none-any.whl → 0.1.0__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.
- RinUI/__init__.py +1 -1
- RinUI/__pycache__/__init__.cpython-38.pyc +0 -0
- RinUI/assets/img/default_app_icon.png +0 -0
- RinUI/components/BasicInput/Button.qml +1 -2
- RinUI/components/ContextMenu.qml +1 -1
- RinUI/components/DialogsAndFlyouts/Flyout.qml +10 -67
- RinUI/components/Media/Avatar.qml +83 -0
- RinUI/components/MenusAndToolbars/TextInputMenu.qml +38 -0
- RinUI/components/Navigation/Segmented.qml +17 -0
- RinUI/components/Navigation/SegmentedItem.qml +108 -0
- RinUI/components/Navigation/SelectorBar.qml +3 -48
- RinUI/components/Navigation/SelectorBarItem.qml +89 -0
- RinUI/components/Text/TextArea.qml +1 -29
- RinUI/components/Text/TextField.qml +1 -29
- RinUI/components/Text/TextInput.qml +19 -0
- RinUI/components/qmldir +4 -0
- RinUI/core/__init__.py +2 -1
- RinUI/core/__pycache__/__init__.cpython-38.pyc +0 -0
- RinUI/core/__pycache__/config.cpython-38.pyc +0 -0
- RinUI/core/__pycache__/launcher.cpython-38.pyc +0 -0
- RinUI/core/__pycache__/theme.cpython-38.pyc +0 -0
- RinUI/core/__pycache__/translator.cpython-38.pyc +0 -0
- RinUI/core/config.py +11 -2
- RinUI/core/launcher.py +24 -37
- RinUI/core/theme.py +17 -20
- RinUI/core/translator.py +25 -0
- RinUI/languages/en_US.qm +1 -0
- RinUI/languages/en_US.ts +201 -0
- RinUI/languages/zh_CN.qm +0 -0
- RinUI/languages/zh_CN.ts +204 -0
- RinUI/qmldir +8 -0
- RinUI/themes/dark.qml +9 -0
- RinUI/themes/light.qml +10 -1
- RinUI/themes/theme.qml +39 -15
- RinUI/themes/utils.qml +4 -0
- RinUI/windows/FluentWindow.qml +0 -1
- RinUI/windows/FluentWindowBase.qml +0 -1
- RinUI/windows/TitleBar.qml +2 -2
- {rinui-0.0.10.1.data → rinui-0.1.0.data}/data/README.md +5 -1
- {rinui-0.0.10.1.dist-info → rinui-0.1.0.dist-info}/METADATA +6 -2
- {rinui-0.0.10.1.dist-info → rinui-0.1.0.dist-info}/RECORD +46 -35
- {rinui-0.0.10.1.data → rinui-0.1.0.data}/data/LICENSE +0 -0
- {rinui-0.0.10.1.dist-info → rinui-0.1.0.dist-info}/LICENSE +0 -0
- {rinui-0.0.10.1.dist-info → rinui-0.1.0.dist-info}/WHEEL +0 -0
- {rinui-0.0.10.1.dist-info → rinui-0.1.0.dist-info}/entry_points.txt +0 -0
- {rinui-0.0.10.1.dist-info → rinui-0.1.0.dist-info}/top_level.txt +0 -0
RinUI/__init__.py
CHANGED
Binary file
|
Binary file
|
@@ -82,10 +82,9 @@ Button {
|
|
82
82
|
anchors.centerIn: parent
|
83
83
|
IconWidget {
|
84
84
|
id: iconWidget
|
85
|
-
size: icon || source ? text.font.pixelSize * 1.
|
85
|
+
size: icon || source ? text.font.pixelSize * 1.3 : 0 // 图标大小 / Icon Size
|
86
86
|
icon: root.icon.name
|
87
87
|
source: root.icon.source
|
88
|
-
height: parent.height
|
89
88
|
y: 0.25
|
90
89
|
color: icon.color ? icon.color : highlighted ? flat ?
|
91
90
|
enabled ? Theme.currentTheme.colors.textAccentColor : Theme.currentTheme.colors.textColor :
|
RinUI/components/ContextMenu.qml
CHANGED
@@ -7,62 +7,29 @@ import "../../components"
|
|
7
7
|
|
8
8
|
Popup {
|
9
9
|
id: flyout
|
10
|
-
property
|
10
|
+
property alias text: flyoutText.text // 弹出文本内容
|
11
11
|
property alias buttonBox: buttonLayout.data // 按钮列表
|
12
|
-
property
|
13
|
-
property real maximumWidth: 350 // 最大宽度
|
12
|
+
default property alias content: customContent.data // 弹出内容
|
14
13
|
|
15
14
|
position: Position.Top
|
16
15
|
|
17
16
|
padding: 16
|
18
17
|
|
19
|
-
// 坐标
|
20
|
-
|
21
18
|
contentItem: ColumnLayout {
|
22
19
|
spacing: 0
|
23
20
|
|
24
|
-
|
25
|
-
id:
|
21
|
+
ColumnLayout {
|
22
|
+
id: customContent
|
23
|
+
spacing: 8
|
26
24
|
Layout.fillWidth: true
|
27
|
-
Layout.maximumWidth: maximumWidth
|
28
|
-
Layout.margins: -flyout.padding + 2
|
29
|
-
Layout.bottomMargin: 0
|
30
|
-
Layout.preferredHeight: width * (sourceSize.height / sourceSize.width)
|
31
|
-
fillMode: Image.PreserveAspectCrop
|
32
|
-
source: flyout.image
|
33
|
-
visible: flyout.image !== ""
|
34
|
-
|
35
|
-
layer.enabled: true
|
36
|
-
layer.smooth: true
|
37
|
-
layer.effect: OpacityMask {
|
38
|
-
maskSource: Rectangle {
|
39
|
-
width: flyoutImg.width
|
40
|
-
height: flyoutImg.height
|
41
|
-
radius: background.radius
|
42
|
-
color: "black"
|
43
25
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
}
|
26
|
+
Text {
|
27
|
+
id: flyoutText
|
28
|
+
Layout.fillWidth: true
|
29
|
+
typography: Typography.Body
|
30
|
+
visible: text.length > 0
|
50
31
|
}
|
51
32
|
}
|
52
|
-
}
|
53
|
-
|
54
|
-
Item {
|
55
|
-
height: 16
|
56
|
-
visible: flyoutImg.visible
|
57
|
-
}
|
58
|
-
|
59
|
-
Text {
|
60
|
-
id: flyoutText
|
61
|
-
Layout.fillWidth: true
|
62
|
-
Layout.maximumWidth: maximumWidth
|
63
|
-
typography: Typography.Body
|
64
|
-
text: flyout.text
|
65
|
-
}
|
66
33
|
|
67
34
|
Item {
|
68
35
|
height: 16
|
@@ -76,30 +43,6 @@ Popup {
|
|
76
43
|
}
|
77
44
|
}
|
78
45
|
|
79
|
-
// background: Rectangle {
|
80
|
-
// id: background
|
81
|
-
// anchors.fill: parent
|
82
|
-
// anchors.horizontalCenter: parent.horizontalCenter
|
83
|
-
// y: -6
|
84
|
-
//
|
85
|
-
// radius: Theme.currentTheme.appearance.windowRadius
|
86
|
-
// color: Theme.currentTheme.colors.backgroundAcrylicColor
|
87
|
-
// border.color: Theme.currentTheme.colors.flyoutBorderColor
|
88
|
-
//
|
89
|
-
// Behavior on color {
|
90
|
-
// ColorAnimation {
|
91
|
-
// duration: Utils.appearanceSpeed
|
92
|
-
// easing.type: Easing.OutQuart
|
93
|
-
// }
|
94
|
-
// }
|
95
|
-
//
|
96
|
-
// layer.enabled: true
|
97
|
-
// layer.effect: Shadow {
|
98
|
-
// style: "flyout"
|
99
|
-
// source: background
|
100
|
-
// }
|
101
|
-
// }
|
102
|
-
|
103
46
|
// 动画 / Animation //
|
104
47
|
enter: Transition {
|
105
48
|
ParallelAnimation {
|
@@ -0,0 +1,83 @@
|
|
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
|
+
Item {
|
9
|
+
id: root
|
10
|
+
property int size: 96
|
11
|
+
property string source: ""
|
12
|
+
property string text
|
13
|
+
property alias icon: icon.icon
|
14
|
+
|
15
|
+
implicitWidth: size
|
16
|
+
implicitHeight: size
|
17
|
+
opacity: enabled ? 1 : 0.4
|
18
|
+
|
19
|
+
Rectangle {
|
20
|
+
id: background
|
21
|
+
anchors.fill: parent
|
22
|
+
color: Theme.currentTheme.colors.controlQuaternaryColor
|
23
|
+
border.color: Theme.currentTheme.colors.cardBorderColor
|
24
|
+
radius: size / 2
|
25
|
+
|
26
|
+
// 图标
|
27
|
+
IconWidget {
|
28
|
+
id: icon
|
29
|
+
anchors.centerIn: parent
|
30
|
+
icon: "ic_fluent_person_20_regular"
|
31
|
+
size: root.size * 0.5
|
32
|
+
source: root.source
|
33
|
+
|
34
|
+
visible: root.source === "" && root.text === ""
|
35
|
+
}
|
36
|
+
|
37
|
+
// 文本
|
38
|
+
Text {
|
39
|
+
id: textLabel
|
40
|
+
anchors.centerIn: parent
|
41
|
+
font.pixelSize: size * 0.41
|
42
|
+
font.bold: true
|
43
|
+
text: {
|
44
|
+
let text_list = root.text.split(" ")
|
45
|
+
let result = ""
|
46
|
+
for (let i = 0; i < text_list.length; i++) {
|
47
|
+
if (text_list[i] !== "" && (i === 0 || i === text_list.length - 1)) {
|
48
|
+
result += text_list[i][0]
|
49
|
+
}
|
50
|
+
}
|
51
|
+
return result
|
52
|
+
}
|
53
|
+
visible: root.source === "" && root.text !== ""
|
54
|
+
}
|
55
|
+
}
|
56
|
+
|
57
|
+
Image {
|
58
|
+
id: image
|
59
|
+
source: root.source
|
60
|
+
anchors.fill: parent
|
61
|
+
fillMode: Image.PreserveAspectCrop
|
62
|
+
smooth: true
|
63
|
+
clip: true
|
64
|
+
}
|
65
|
+
|
66
|
+
// 遮罩
|
67
|
+
layer.enabled: true
|
68
|
+
layer.effect: OpacityMask {
|
69
|
+
maskSource: Rectangle {
|
70
|
+
width: root.width
|
71
|
+
height: root.height
|
72
|
+
radius: background.radius
|
73
|
+
}
|
74
|
+
}
|
75
|
+
|
76
|
+
// 动画
|
77
|
+
Behavior on opacity {
|
78
|
+
NumberAnimation {
|
79
|
+
duration: Utils.appearanceSpeed
|
80
|
+
easing.type: Easing.InOutQuint
|
81
|
+
}
|
82
|
+
}
|
83
|
+
}
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import QtQuick 2.15
|
2
|
+
import QtQuick.Controls 2.15
|
3
|
+
import "../../themes"
|
4
|
+
import "../../components"
|
5
|
+
|
6
|
+
|
7
|
+
// Menu
|
8
|
+
Menu {
|
9
|
+
id: contextMenu
|
10
|
+
position: -1
|
11
|
+
Action {
|
12
|
+
icon.name: "ic_fluent_cut_20_regular"
|
13
|
+
text: qsTr("Cut")
|
14
|
+
enabled: root.selectedText.length > 0 && root.editable // 选中&可编辑
|
15
|
+
shortcut: "Ctrl+X"
|
16
|
+
onTriggered: root.cut()
|
17
|
+
}
|
18
|
+
Action {
|
19
|
+
icon.name: "ic_fluent_copy_20_regular"
|
20
|
+
text: qsTr("Copy")
|
21
|
+
enabled: root.selectedText.length > 0 // 选中内容
|
22
|
+
shortcut: "Ctrl+C"
|
23
|
+
onTriggered: root.copy()
|
24
|
+
}
|
25
|
+
Action {
|
26
|
+
icon.name: "ic_fluent_clipboard_paste_20_regular"
|
27
|
+
text: qsTr("Paste")
|
28
|
+
enabled: root.editable
|
29
|
+
shortcut: "Ctrl+V"
|
30
|
+
onTriggered: root.paste()
|
31
|
+
}
|
32
|
+
Action {
|
33
|
+
icon.name: " "
|
34
|
+
text: qsTr("Select All")
|
35
|
+
shortcut: "Ctrl+A"
|
36
|
+
onTriggered: root.selectAll()
|
37
|
+
}
|
38
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import QtQuick 2.15
|
2
|
+
import QtQuick.Controls 2.15
|
3
|
+
import QtQuick.Layouts 2.15
|
4
|
+
import "../../components"
|
5
|
+
import "../../themes"
|
6
|
+
|
7
|
+
TabBar {
|
8
|
+
id: root
|
9
|
+
implicitWidth: contentWidth
|
10
|
+
|
11
|
+
background: Rectangle {
|
12
|
+
border.width: Theme.currentTheme.appearance.borderWidth // 边框宽度 / Border Width
|
13
|
+
border.color: Theme.currentTheme.colors.controlBorderColor
|
14
|
+
radius: Theme.currentTheme.appearance.buttonRadius
|
15
|
+
color: Theme.currentTheme.colors.controlAltSecondaryColor
|
16
|
+
}
|
17
|
+
}
|
@@ -0,0 +1,108 @@
|
|
1
|
+
import QtQuick 2.15
|
2
|
+
import QtQuick.Controls 2.15
|
3
|
+
import QtQuick.Layouts 2.15
|
4
|
+
import Qt5Compat.GraphicalEffects
|
5
|
+
import "../../components"
|
6
|
+
import "../../themes"
|
7
|
+
|
8
|
+
TabButton {
|
9
|
+
id: root
|
10
|
+
|
11
|
+
implicitWidth: Math.max(row.implicitWidth + 26 , 40)
|
12
|
+
implicitHeight: 32
|
13
|
+
|
14
|
+
background: Rectangle {
|
15
|
+
id: background
|
16
|
+
anchors.centerIn: parent
|
17
|
+
width: checked ? parent.width : parent.width - 4*2
|
18
|
+
height: checked ? parent.height : parent.height - 3*2
|
19
|
+
|
20
|
+
color: checked ? Theme.currentTheme.colors.controlFillColor :
|
21
|
+
hovered ? Theme.currentTheme.colors.subtleSecondaryColor : Theme.currentTheme.colors.subtleColor
|
22
|
+
radius: Theme.currentTheme.appearance.smallRadius
|
23
|
+
|
24
|
+
border.width: Theme.currentTheme.appearance.borderWidth // 边框宽度 / Border Width
|
25
|
+
border.color: checked ? Theme.currentTheme.colors.controlBorderColor : "transparent"
|
26
|
+
|
27
|
+
Behavior on scale {
|
28
|
+
NumberAnimation {
|
29
|
+
duration: Utils.animationSpeed
|
30
|
+
easing.type: Easing.OutQuart
|
31
|
+
}
|
32
|
+
}
|
33
|
+
}
|
34
|
+
|
35
|
+
Behavior on opacity {
|
36
|
+
NumberAnimation {
|
37
|
+
duration: Utils.animationSpeed
|
38
|
+
easing.type: Easing.InOutQuint
|
39
|
+
}
|
40
|
+
}
|
41
|
+
|
42
|
+
contentItem: Item {
|
43
|
+
clip: true
|
44
|
+
anchors.fill: parent
|
45
|
+
|
46
|
+
Row {
|
47
|
+
id: row
|
48
|
+
spacing: 8
|
49
|
+
anchors.centerIn: parent
|
50
|
+
IconWidget {
|
51
|
+
id: iconWidget
|
52
|
+
size: icon || source ? text.font.pixelSize * 1.3 : 0 // 图标大小 / Icon Size
|
53
|
+
icon: root.icon.name
|
54
|
+
source: root.icon.source
|
55
|
+
y: 0.25
|
56
|
+
}
|
57
|
+
|
58
|
+
Text {
|
59
|
+
id: text
|
60
|
+
typography: Typography.Body
|
61
|
+
text: root.text
|
62
|
+
color: Theme.currentTheme.colors.textColor
|
63
|
+
}
|
64
|
+
}
|
65
|
+
|
66
|
+
Indicator {
|
67
|
+
anchors {
|
68
|
+
bottom: parent.bottom
|
69
|
+
bottomMargin: Theme.currentTheme.appearance.borderWidth
|
70
|
+
horizontalCenter: parent.horizontalCenter
|
71
|
+
}
|
72
|
+
visible: root.checked
|
73
|
+
orientation: Qt.Horizontal
|
74
|
+
}
|
75
|
+
}
|
76
|
+
|
77
|
+
// 状态变化
|
78
|
+
states: [
|
79
|
+
State {
|
80
|
+
name: "disabled"
|
81
|
+
when: !enabled
|
82
|
+
PropertyChanges {
|
83
|
+
target: root
|
84
|
+
opacity: 0.65
|
85
|
+
}
|
86
|
+
},
|
87
|
+
State {
|
88
|
+
name: "pressed"
|
89
|
+
when: pressed
|
90
|
+
PropertyChanges {
|
91
|
+
target: root;
|
92
|
+
opacity: 0.67
|
93
|
+
}
|
94
|
+
PropertyChanges {
|
95
|
+
target: background;
|
96
|
+
scale: 0.95
|
97
|
+
}
|
98
|
+
},
|
99
|
+
State {
|
100
|
+
name: "hovered"
|
101
|
+
when: hovered
|
102
|
+
PropertyChanges {
|
103
|
+
target: root;
|
104
|
+
opacity: 0.875
|
105
|
+
}
|
106
|
+
}
|
107
|
+
]
|
108
|
+
}
|
@@ -5,54 +5,9 @@ import "../../components"
|
|
5
5
|
import "../../themes"
|
6
6
|
|
7
7
|
|
8
|
-
|
8
|
+
TabBar {
|
9
9
|
id: root
|
10
|
-
|
11
|
-
property int currentIndex: -1
|
12
|
-
property bool enabled: true
|
13
|
-
// 自动检测模型类型
|
14
|
-
readonly property string modelType: {
|
15
|
-
if (!model) return "null";
|
16
|
-
if (Array.isArray(model) && typeof model[0] === "object") return "array-with-role";
|
17
|
-
if (Array.isArray(model)) return "array";
|
18
|
-
if (model instanceof ListModel) return "listmodel";
|
19
|
-
if (typeof model === "object" && "count" in model) return "listmodel-like";
|
20
|
-
return "unknown";
|
21
|
-
}
|
10
|
+
implicitWidth: contentWidth
|
22
11
|
|
23
|
-
|
24
|
-
spacing: 0
|
25
|
-
|
26
|
-
Repeater {
|
27
|
-
model: root.model
|
28
|
-
delegate: Button {
|
29
|
-
Layout.fillWidth: true
|
30
|
-
Layout.fillHeight: true
|
31
|
-
Layout.preferredHeight: 40
|
32
|
-
flat: true
|
33
|
-
|
34
|
-
background: Item {}
|
35
|
-
|
36
|
-
text: {
|
37
|
-
switch (root.modelType) {
|
38
|
-
case "array": return modelData;
|
39
|
-
case "array-with-role": return modelData["text"] || modelData || "";
|
40
|
-
case "listmodel":
|
41
|
-
case "listmodel-like":
|
42
|
-
return model["text"] || modelData || "";
|
43
|
-
default: return "";
|
44
|
-
}
|
45
|
-
}
|
46
|
-
icon.name: root.modelType === "array-with-role" ? modelData["icon"] : ""
|
47
|
-
icon.source: root.modelType === "array-with-role" ? modelData["source"] : ""
|
48
|
-
|
49
|
-
onClicked: root.currentIndex = index
|
50
|
-
enabled: root.enabled
|
51
|
-
|
52
|
-
Indicator {
|
53
|
-
orientation: Qt.Horizontal
|
54
|
-
visible: index === root.currentIndex
|
55
|
-
}
|
56
|
-
}
|
57
|
-
}
|
12
|
+
background: Item {}
|
58
13
|
}
|
@@ -0,0 +1,89 @@
|
|
1
|
+
import QtQuick 2.15
|
2
|
+
import QtQuick.Controls 2.15
|
3
|
+
import QtQuick.Layouts 2.15
|
4
|
+
import Qt5Compat.GraphicalEffects
|
5
|
+
import "../../components"
|
6
|
+
import "../../themes"
|
7
|
+
|
8
|
+
TabButton {
|
9
|
+
id: root
|
10
|
+
|
11
|
+
implicitWidth: Math.max(row.implicitWidth + 26 , 40)
|
12
|
+
implicitHeight: 32
|
13
|
+
|
14
|
+
background: Item {}
|
15
|
+
|
16
|
+
Behavior on opacity {
|
17
|
+
NumberAnimation {
|
18
|
+
duration: Utils.animationSpeed
|
19
|
+
easing.type: Easing.InOutQuint
|
20
|
+
}
|
21
|
+
}
|
22
|
+
|
23
|
+
contentItem: Item {
|
24
|
+
clip: true
|
25
|
+
anchors.fill: parent
|
26
|
+
|
27
|
+
Row {
|
28
|
+
id: row
|
29
|
+
spacing: 8
|
30
|
+
anchors.centerIn: parent
|
31
|
+
IconWidget {
|
32
|
+
id: iconWidget
|
33
|
+
size: icon || source ? text.font.pixelSize * 1.3 : 0 // 图标大小 / Icon Size
|
34
|
+
icon: root.icon.name
|
35
|
+
source: root.icon.source
|
36
|
+
y: 0.25
|
37
|
+
}
|
38
|
+
|
39
|
+
Text {
|
40
|
+
id: text
|
41
|
+
typography: Typography.Body
|
42
|
+
text: root.text
|
43
|
+
color: Theme.currentTheme.colors.textColor
|
44
|
+
}
|
45
|
+
}
|
46
|
+
|
47
|
+
Indicator {
|
48
|
+
anchors {
|
49
|
+
bottom: parent.bottom
|
50
|
+
bottomMargin: Theme.currentTheme.appearance.borderWidth
|
51
|
+
horizontalCenter: parent.horizontalCenter
|
52
|
+
}
|
53
|
+
visible: root.checked
|
54
|
+
orientation: Qt.Horizontal
|
55
|
+
}
|
56
|
+
}
|
57
|
+
|
58
|
+
// 状态变化
|
59
|
+
states: [
|
60
|
+
State {
|
61
|
+
name: "disabled"
|
62
|
+
when: !enabled
|
63
|
+
PropertyChanges {
|
64
|
+
target: root
|
65
|
+
opacity: 0.65
|
66
|
+
}
|
67
|
+
},
|
68
|
+
State {
|
69
|
+
name: "pressed"
|
70
|
+
when: pressed
|
71
|
+
PropertyChanges {
|
72
|
+
target: root;
|
73
|
+
opacity: 0.67
|
74
|
+
}
|
75
|
+
PropertyChanges {
|
76
|
+
target: background;
|
77
|
+
scale: 0.95
|
78
|
+
}
|
79
|
+
},
|
80
|
+
State {
|
81
|
+
name: "hovered"
|
82
|
+
when: hovered
|
83
|
+
PropertyChanges {
|
84
|
+
target: root;
|
85
|
+
opacity: 0.875
|
86
|
+
}
|
87
|
+
}
|
88
|
+
]
|
89
|
+
}
|
@@ -15,36 +15,8 @@ TextArea {
|
|
15
15
|
enabled: editable
|
16
16
|
|
17
17
|
// Menu
|
18
|
-
|
18
|
+
TextInputMenu {
|
19
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
20
|
}
|
49
21
|
|
50
22
|
MouseArea {
|
@@ -15,36 +15,8 @@ TextField {
|
|
15
15
|
enabled: editable
|
16
16
|
|
17
17
|
// Menu
|
18
|
-
|
18
|
+
TextInputMenu {
|
19
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
20
|
}
|
49
21
|
|
50
22
|
MouseArea {
|
@@ -13,6 +13,25 @@ TextInput {
|
|
13
13
|
color: Theme.currentTheme.colors.textColor
|
14
14
|
selectionColor: Theme.currentTheme.colors.primaryColor
|
15
15
|
|
16
|
+
// Menu
|
17
|
+
TextInputMenu {
|
18
|
+
id: contextMenu
|
19
|
+
}
|
20
|
+
|
21
|
+
MouseArea {
|
22
|
+
anchors.fill: parent
|
23
|
+
acceptedButtons: Qt.RightButton
|
24
|
+
propagateComposedEvents: true
|
25
|
+
onPressed: (mouse) => {
|
26
|
+
if (mouse.button === Qt.RightButton)
|
27
|
+
contextMenu.popup(mouse.scenePosition)
|
28
|
+
mouse.accepted = false
|
29
|
+
}
|
30
|
+
|
31
|
+
// 鼠标
|
32
|
+
cursorShape: Qt.IBeamCursor
|
33
|
+
}
|
34
|
+
|
16
35
|
font.pixelSize: {
|
17
36
|
switch (typography) {
|
18
37
|
case Typography.Display: return Theme.currentTheme.typography.displaySize;
|
RinUI/components/qmldir
CHANGED
@@ -22,6 +22,9 @@ ToolButton 1.0 BasicInput/ToolButton.qml
|
|
22
22
|
Switch 1.0 BasicInput/Switch.qml
|
23
23
|
RadioButton 1.0 BasicInput/RadioButton.qml
|
24
24
|
|
25
|
+
# Media
|
26
|
+
Avatar 1.0 Media/Avatar.qml
|
27
|
+
|
25
28
|
# Date & Time
|
26
29
|
PickerView 1.0 DateAndTime/PickerView.qml
|
27
30
|
# TimePicker 1.0 DateAndTime/TimePicker.qml
|
@@ -47,6 +50,7 @@ Text 1.0 Text/Text.qml
|
|
47
50
|
|
48
51
|
# Menus & Toolbars
|
49
52
|
Menu 1.0 MenusAndToolbars/Menu.qml
|
53
|
+
TextInputMenu 1.0 MenusAndToolbars/TextInputMenu.qml
|
50
54
|
MenuItem 1.0 MenusAndToolbars/MenuItem.qml
|
51
55
|
MenuItemGroup 1.0 MenusAndToolbars/MenuItemGroup.qml
|
52
56
|
MenuSeparator 1.0 MenusAndToolbars/MenuSeparator.qml
|
RinUI/core/__init__.py
CHANGED
@@ -1,3 +1,4 @@
|
|
1
1
|
from .theme import ThemeManager
|
2
2
|
from .launcher import RinUIWindow
|
3
|
-
from .config import DEFAULT_CONFIG,
|
3
|
+
from .config import DEFAULT_CONFIG, RinConfig, PATH, Theme, BackdropEffect, ConfigManager
|
4
|
+
from .translator import RinUITranslator
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|