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
@@ -1,44 +1,44 @@
1
- import QtQuick 2.15
2
- import QtQuick.Controls.Basic 2.15
3
- import "../../themes"
4
- import "../../components"
5
-
6
-
7
- Frame {
8
- id: root
9
- property bool frameless: false
10
- property bool hoverable: true // 悬浮特效
11
- property bool hover: false
12
- property color color: Theme.currentTheme.colors.cardColor
13
- property alias radius: background.radius
14
- property color borderColor: Theme.currentTheme.colors.cardBorderColor
15
- property int borderWidth: Theme.currentTheme.appearance.borderWidth
16
-
17
- clip: true
18
- // leftPadding: 0
19
- // rightPadding: 0
20
- // topPadding: 0
21
- // bottomPadding: 0
22
-
23
- background: Rectangle {
24
- id: background
25
- anchors.fill: parent
26
- radius: Theme.currentTheme.appearance.smallRadius
27
- color: root.color
28
- border.width: borderWidth
29
- border.color: borderColor
30
- opacity: root.hover? 0.7 : 1
31
- visible: !root.frameless
32
-
33
- // mouse area / hover区域
34
- MouseArea {
35
- anchors.fill: parent
36
- hoverEnabled: root.hoverable
37
- onEntered: root.hover = true
38
- onExited: root.hover = false
39
- }
40
-
41
- Behavior on opacity { NumberAnimation { duration: Utils.animationSpeedFaster; easing.type: Easing.OutQuad } }
42
- Behavior on color { ColorAnimation { duration: Utils.appearanceSpeed; easing.type: Easing.OutQuad } }
43
- }
1
+ import QtQuick 2.15
2
+ import QtQuick.Controls.Basic 2.15
3
+ import "../../themes"
4
+ import "../../components"
5
+
6
+
7
+ Frame {
8
+ id: root
9
+ property bool frameless: false
10
+ property bool hoverable: true // 悬浮特效
11
+ property bool hover: false
12
+ property color color: Theme.currentTheme.colors.cardColor
13
+ property alias radius: background.radius
14
+ property color borderColor: Theme.currentTheme.colors.cardBorderColor
15
+ property int borderWidth: Theme.currentTheme.appearance.borderWidth
16
+
17
+ clip: true
18
+ // leftPadding: 0
19
+ // rightPadding: 0
20
+ // topPadding: 0
21
+ // bottomPadding: 0
22
+
23
+ background: Rectangle {
24
+ id: background
25
+ anchors.fill: parent
26
+ radius: Theme.currentTheme.appearance.smallRadius
27
+ color: root.color
28
+ border.width: borderWidth
29
+ border.color: borderColor
30
+ opacity: root.hover? 0.7 : 1
31
+ visible: !root.frameless
32
+
33
+ // mouse area / hover区域
34
+ MouseArea {
35
+ anchors.fill: parent
36
+ hoverEnabled: root.hoverable
37
+ onEntered: root.hover = true
38
+ onExited: root.hover = false
39
+ }
40
+
41
+ Behavior on opacity { NumberAnimation { duration: Utils.animationSpeedFaster; easing.type: Easing.OutQuad } }
42
+ Behavior on color { ColorAnimation { duration: Utils.appearanceSpeed; easing.type: Easing.OutQuad } }
43
+ }
44
44
  }
@@ -1,105 +1,105 @@
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
- ListView {
8
- id: root
9
- property string textRole: "" // 文字role
10
-
11
- property bool keyboardNavigation: false
12
- // 自动检测模型类型
13
- readonly property string modelType: {
14
- if (!model) return "null";
15
- if (Array.isArray(model) && root.textRole) return "array-with-role";
16
- if (Array.isArray(model)) return "array";
17
- if (model instanceof ListModel) return "listmodel";
18
- if (typeof model === "object" && "count" in model) return "listmodel-like";
19
- return "unknown";
20
- }
21
-
22
- clip: true
23
-
24
- // 垂直滚动条 / Vertical ScrollBar //
25
- ScrollBar.vertical: ScrollBar {
26
- id: scrollBar
27
- policy: ScrollBar.AsNeeded
28
- }
29
-
30
- // 交换动画
31
- // move: Transition {
32
- // NumberAnimation { property: "y"; duration: 200 }
33
- // }
34
- // moveDisplaced: Transition {
35
- // NumberAnimation { property: "y"; duration: 200 }
36
- // }
37
-
38
- displaced: Transition {
39
- NumberAnimation {
40
- property: "y"
41
- duration: Utils.animationSpeedMiddle
42
- easing.type: Easing.OutQuint
43
- }
44
- }
45
-
46
- add: Transition {
47
- ParallelAnimation{
48
- NumberAnimation {
49
- property: "opacity"
50
- from: 0
51
- to: 1
52
- duration: Utils.animationSpeed
53
- easing.type: Easing.OutQuint
54
- }
55
- NumberAnimation {
56
- properties: "scale"
57
- from: 0.9
58
- to: 1
59
- duration: Utils.animationSpeed
60
- easing.type: Easing.OutQuint
61
- }
62
- }
63
- }
64
-
65
- // 删除动画
66
- remove: Transition {
67
- ParallelAnimation{
68
- NumberAnimation {
69
- property: "opacity"
70
- from: 1
71
- to: 0
72
- duration: Utils.animationSpeed
73
- easing.type: Easing.OutQuint
74
- }
75
- NumberAnimation {
76
- properties: "scale"
77
- from: 1
78
- to: 0.9
79
- duration: Utils.animationSpeed
80
- easing.type: Easing.OutQuint
81
- }
82
- }
83
- }
84
-
85
- delegate: ListViewDelegate {
86
- middleArea: [
87
- Text {
88
- Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
89
- id: text
90
- typography: Typography.Body
91
- wrapMode: Text.Wrap
92
- text: {
93
- switch (root.modelType) {
94
- case "array": return modelData;
95
- case "array-with-role": return modelData[root.textRole] || modelData || "";
96
- case "listmodel":
97
- case "listmodel-like":
98
- return model[root.textRole] || modelData || "";
99
- default: return "";
100
- }
101
- }
102
- }
103
- ]
104
- }
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
+ ListView {
8
+ id: root
9
+ property string textRole: "" // 文字role
10
+
11
+ property bool keyboardNavigation: false
12
+ // 自动检测模型类型
13
+ readonly property string modelType: {
14
+ if (!model) return "null";
15
+ if (Array.isArray(model) && root.textRole) return "array-with-role";
16
+ if (Array.isArray(model)) return "array";
17
+ if (model instanceof ListModel) return "listmodel";
18
+ if (typeof model === "object" && "count" in model) return "listmodel-like";
19
+ return "unknown";
20
+ }
21
+
22
+ clip: true
23
+
24
+ // 垂直滚动条 / Vertical ScrollBar //
25
+ ScrollBar.vertical: ScrollBar {
26
+ id: scrollBar
27
+ policy: ScrollBar.AsNeeded
28
+ }
29
+
30
+ // 交换动画
31
+ // move: Transition {
32
+ // NumberAnimation { property: "y"; duration: 200 }
33
+ // }
34
+ // moveDisplaced: Transition {
35
+ // NumberAnimation { property: "y"; duration: 200 }
36
+ // }
37
+
38
+ displaced: Transition {
39
+ NumberAnimation {
40
+ property: "y"
41
+ duration: Utils.animationSpeedMiddle
42
+ easing.type: Easing.OutQuint
43
+ }
44
+ }
45
+
46
+ add: Transition {
47
+ ParallelAnimation{
48
+ NumberAnimation {
49
+ property: "opacity"
50
+ from: 0
51
+ to: 1
52
+ duration: Utils.animationSpeed
53
+ easing.type: Easing.OutQuint
54
+ }
55
+ NumberAnimation {
56
+ properties: "scale"
57
+ from: 0.9
58
+ to: 1
59
+ duration: Utils.animationSpeed
60
+ easing.type: Easing.OutQuint
61
+ }
62
+ }
63
+ }
64
+
65
+ // 删除动画
66
+ remove: Transition {
67
+ ParallelAnimation{
68
+ NumberAnimation {
69
+ property: "opacity"
70
+ from: 1
71
+ to: 0
72
+ duration: Utils.animationSpeed
73
+ easing.type: Easing.OutQuint
74
+ }
75
+ NumberAnimation {
76
+ properties: "scale"
77
+ from: 1
78
+ to: 0.9
79
+ duration: Utils.animationSpeed
80
+ easing.type: Easing.OutQuint
81
+ }
82
+ }
83
+ }
84
+
85
+ delegate: ListViewDelegate {
86
+ middleArea: [
87
+ Text {
88
+ Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
89
+ id: text
90
+ typography: Typography.Body
91
+ wrapMode: Text.Wrap
92
+ text: {
93
+ switch (root.modelType) {
94
+ case "array": return modelData;
95
+ case "array-with-role": return modelData[root.textRole] || modelData || "";
96
+ case "listmodel":
97
+ case "listmodel-like":
98
+ return model[root.textRole] || modelData || "";
99
+ default: return "";
100
+ }
101
+ }
102
+ }
103
+ ]
104
+ }
105
105
  }
@@ -1,83 +1,83 @@
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
-
8
- ItemDelegate {
9
- id: delegate
10
- width: ListView.view ? ListView.view.width : 200
11
- height: contents.implicitHeight + 20 // 自适应
12
- highlighted: ListView.isCurrentItem // 当前项高亮
13
- focusPolicy: Qt.StrongFocus
14
-
15
- // accessibility
16
- FocusIndicator {
17
- control: parent
18
- }
19
-
20
- property alias leftArea: leftArea.data
21
- property alias middleArea: middleArea.data
22
- property alias rightArea: rightArea.data
23
- property alias contents: contents.data
24
-
25
- RowLayout {
26
- id: contents
27
- anchors.fill: parent
28
- anchors.leftMargin: 5 + 11
29
- anchors.rightMargin: 5
30
- anchors.topMargin: 3
31
- spacing: 8
32
-
33
- Row {
34
- id: leftArea
35
- }
36
-
37
- ColumnLayout {
38
- id: middleArea
39
- Layout.fillHeight: true
40
- }
41
-
42
- RowLayout {
43
- id: rightArea
44
- spacing: 16
45
- Layout.fillWidth: true
46
- Layout.fillHeight: true
47
- }
48
- }
49
-
50
- background: Rectangle {
51
- id: itemBg
52
- anchors.fill: parent
53
- anchors.leftMargin: 5
54
- anchors.rightMargin: 5
55
- anchors.topMargin: 3
56
- radius: Theme.currentTheme.appearance.buttonRadius
57
- color: pressed
58
- ? Theme.currentTheme.colors.subtleTertiaryColor
59
- : (highlighted || hovered)
60
- ? Theme.currentTheme.colors.subtleSecondaryColor
61
- : Theme.currentTheme.colors.subtleColor
62
-
63
- RowLayout {
64
- anchors.fill: parent
65
- anchors.leftMargin: 11
66
- anchors.rightMargin: 11
67
- anchors.topMargin: 6
68
- anchors.bottomMargin: 8
69
- }
70
-
71
- // 选择指示器
72
- Indicator {
73
- currentItemHeight: delegate.height
74
- visible: highlighted
75
- }
76
-
77
- Behavior on color { ColorAnimation { duration: Utils.appearanceSpeed; easing.type:Easing.InOutQuart } }
78
- }
79
-
80
- onClicked: {
81
- ListView.view.currentIndex = index
82
- }
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
+
8
+ ItemDelegate {
9
+ id: delegate
10
+ width: ListView.view ? ListView.view.width : 200
11
+ height: contents.implicitHeight + 20 // 自适应
12
+ highlighted: ListView.isCurrentItem // 当前项高亮
13
+ focusPolicy: Qt.StrongFocus
14
+
15
+ // accessibility
16
+ FocusIndicator {
17
+ control: parent
18
+ }
19
+
20
+ property alias leftArea: leftArea.data
21
+ property alias middleArea: middleArea.data
22
+ property alias rightArea: rightArea.data
23
+ property alias contents: contents.data
24
+
25
+ RowLayout {
26
+ id: contents
27
+ anchors.fill: parent
28
+ anchors.leftMargin: 5 + 11
29
+ anchors.rightMargin: 5
30
+ anchors.topMargin: 3
31
+ spacing: 8
32
+
33
+ Row {
34
+ id: leftArea
35
+ }
36
+
37
+ ColumnLayout {
38
+ id: middleArea
39
+ Layout.fillHeight: true
40
+ }
41
+
42
+ RowLayout {
43
+ id: rightArea
44
+ spacing: 16
45
+ Layout.fillWidth: true
46
+ Layout.fillHeight: true
47
+ }
48
+ }
49
+
50
+ background: Rectangle {
51
+ id: itemBg
52
+ anchors.fill: parent
53
+ anchors.leftMargin: 5
54
+ anchors.rightMargin: 5
55
+ anchors.topMargin: 3
56
+ radius: Theme.currentTheme.appearance.buttonRadius
57
+ color: pressed
58
+ ? Theme.currentTheme.colors.subtleTertiaryColor
59
+ : (highlighted || hovered)
60
+ ? Theme.currentTheme.colors.subtleSecondaryColor
61
+ : Theme.currentTheme.colors.subtleColor
62
+
63
+ RowLayout {
64
+ anchors.fill: parent
65
+ anchors.leftMargin: 11
66
+ anchors.rightMargin: 11
67
+ anchors.topMargin: 6
68
+ anchors.bottomMargin: 8
69
+ }
70
+
71
+ // 选择指示器
72
+ Indicator {
73
+ currentItemHeight: delegate.height
74
+ visible: highlighted
75
+ }
76
+
77
+ Behavior on color { ColorAnimation { duration: Utils.appearanceSpeed; easing.type:Easing.InOutQuart } }
78
+ }
79
+
80
+ onClicked: {
81
+ ListView.view.currentIndex = index
82
+ }
83
83
  }
@@ -1,73 +1,73 @@
1
- import QtQuick 2.15
2
- import QtQuick.Controls 2.15
3
- import QtQuick.Layouts 2.15
4
- import RinUI
5
-
6
-
7
- // 自定义控件演示 / Custom control demonstration //
8
- Frame {
9
- id: frame
10
- default property alias content: rightContent.data
11
- // property alias showcase: showcaseContainer.data
12
- property string title
13
- property alias icon: icon.icon
14
- property alias source: icon.source
15
- property alias iconSize: icon.size
16
- property string description
17
-
18
- leftPadding: 15
19
- rightPadding: 15
20
- topPadding: 13
21
- bottomPadding: 13
22
- // implicitHeight: 62
23
-
24
- RowLayout {
25
- anchors.fill: parent
26
- spacing: 16
27
-
28
- RowLayout {
29
- id: leftContent
30
- Layout.maximumWidth: parent.width * 0.6
31
- Layout.fillHeight: true
32
- spacing: 16
33
-
34
- IconWidget {
35
- id: icon
36
- size: 20
37
- }
38
- ColumnLayout {
39
- Layout.fillWidth: true
40
- spacing: 0
41
- Text {
42
- id: titleLabel
43
- Layout.fillWidth: true
44
- typography: Typography.Body
45
- text: title
46
- maximumLineCount: 2 // 限制最多两行
47
- elide: Text.ElideRight // 超过限制时用省略号
48
- visible: title.length > 0
49
- }
50
-
51
- Text {
52
- id: discriptionLabel
53
- Layout.fillWidth: true
54
- typography: Typography.Caption
55
- text: description
56
- color: Theme.currentTheme.colors.textSecondaryColor
57
- wrapMode: Text.Wrap // 启用换行
58
- maximumLineCount: 3
59
- elide: Text.ElideRight
60
- visible: description.length > 0
61
- }
62
- }
63
- visible: !(!titleLabel.visible && !discriptionLabel.visible)
64
- }
65
- RowLayout {
66
- id: rightContent
67
- Layout.fillWidth: true
68
- Layout.fillHeight: true
69
- Layout.alignment: Qt.AlignRight
70
- spacing: 16
71
- }
72
- }
1
+ import QtQuick 2.15
2
+ import QtQuick.Controls 2.15
3
+ import QtQuick.Layouts 2.15
4
+ import RinUI
5
+
6
+
7
+ // 自定义控件演示 / Custom control demonstration //
8
+ Frame {
9
+ id: frame
10
+ default property alias content: rightContent.data
11
+ // property alias showcase: showcaseContainer.data
12
+ property string title
13
+ property alias icon: icon.icon
14
+ property alias source: icon.source
15
+ property alias iconSize: icon.size
16
+ property string description
17
+
18
+ leftPadding: 15
19
+ rightPadding: 15
20
+ topPadding: 13
21
+ bottomPadding: 13
22
+ // implicitHeight: 62
23
+
24
+ RowLayout {
25
+ anchors.fill: parent
26
+ spacing: 16
27
+
28
+ RowLayout {
29
+ id: leftContent
30
+ Layout.maximumWidth: parent.width * 0.6
31
+ Layout.fillHeight: true
32
+ spacing: 16
33
+
34
+ IconWidget {
35
+ id: icon
36
+ size: 20
37
+ }
38
+ ColumnLayout {
39
+ Layout.fillWidth: true
40
+ spacing: 0
41
+ Text {
42
+ id: titleLabel
43
+ Layout.fillWidth: true
44
+ typography: Typography.Body
45
+ text: title
46
+ maximumLineCount: 2 // 限制最多两行
47
+ elide: Text.ElideRight // 超过限制时用省略号
48
+ visible: title.length > 0
49
+ }
50
+
51
+ Text {
52
+ id: discriptionLabel
53
+ Layout.fillWidth: true
54
+ typography: Typography.Caption
55
+ text: description
56
+ color: Theme.currentTheme.colors.textSecondaryColor
57
+ wrapMode: Text.Wrap // 启用换行
58
+ maximumLineCount: 3
59
+ elide: Text.ElideRight
60
+ visible: description.length > 0
61
+ }
62
+ }
63
+ visible: !(!titleLabel.visible && !discriptionLabel.visible)
64
+ }
65
+ RowLayout {
66
+ id: rightContent
67
+ Layout.fillWidth: true
68
+ Layout.fillHeight: true
69
+ Layout.alignment: Qt.AlignRight
70
+ spacing: 16
71
+ }
72
+ }
73
73
  }