RinUI 0.0.9__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 (102) hide show
  1. RinUI/__init__.py +4 -0
  2. RinUI/__pycache__/__init__.cpython-38.pyc +0 -0
  3. RinUI/assets/fonts/FluentSystemIcons-Index.js +5256 -0
  4. RinUI/assets/fonts/FluentSystemIcons-Resizable.ttf +0 -0
  5. RinUI/assets/img/default_app_icon.png +0 -0
  6. RinUI/components/Base.qml +79 -0
  7. RinUI/components/BasicInput/Button.qml +148 -0
  8. RinUI/components/BasicInput/CheckBox.qml +99 -0
  9. RinUI/components/BasicInput/ComboBox.qml +160 -0
  10. RinUI/components/BasicInput/DropDownButton.qml +21 -0
  11. RinUI/components/BasicInput/Hyperlink.qml +18 -0
  12. RinUI/components/BasicInput/RadioButton.qml +95 -0
  13. RinUI/components/BasicInput/Slider.qml +212 -0
  14. RinUI/components/BasicInput/Switch.qml +102 -0
  15. RinUI/components/BasicInput/ToggleButton.qml +11 -0
  16. RinUI/components/BasicInput/ToolButton.qml +31 -0
  17. RinUI/components/ContextMenu.qml +184 -0
  18. RinUI/components/DateAndTime/PickerView.qml +217 -0
  19. RinUI/components/DateAndTime/TimePicker.qml +115 -0
  20. RinUI/components/DialogsAndFlyouts/Dialog.qml +106 -0
  21. RinUI/components/DialogsAndFlyouts/DialogButtonBox.qml +47 -0
  22. RinUI/components/DialogsAndFlyouts/Flyout.qml +144 -0
  23. RinUI/components/DialogsAndFlyouts/Popup.qml +106 -0
  24. RinUI/components/FocusIndicator.qml +33 -0
  25. RinUI/components/IconWidget.qml +52 -0
  26. RinUI/components/Indicator.qml +90 -0
  27. RinUI/components/Layout/Expander.qml +160 -0
  28. RinUI/components/Layout/SettingExpander.qml +67 -0
  29. RinUI/components/Layout/SettingItem.qml +71 -0
  30. RinUI/components/ListAndCollections/Clip.qml +22 -0
  31. RinUI/components/ListAndCollections/Frame.qml +44 -0
  32. RinUI/components/ListAndCollections/ListView.qml +105 -0
  33. RinUI/components/ListAndCollections/ListViewDelegate.qml +83 -0
  34. RinUI/components/ListAndCollections/SettingCard.qml +73 -0
  35. RinUI/components/ListAndCollections/TableView.qml +82 -0
  36. RinUI/components/ListAndCollections/TableViewDelegate.qml +89 -0
  37. RinUI/components/MenusAndToolbars/Menu.qml +149 -0
  38. RinUI/components/MenusAndToolbars/MenuBar.qml +43 -0
  39. RinUI/components/MenusAndToolbars/MenuItem.qml +119 -0
  40. RinUI/components/MenusAndToolbars/MenuItemGroup.qml +43 -0
  41. RinUI/components/MenusAndToolbars/MenuSeparator.qml +14 -0
  42. RinUI/components/MenusAndToolbars/ToolSeparator.qml +17 -0
  43. RinUI/components/Navigation/ErrorPage.qml +48 -0
  44. RinUI/components/Navigation/NavigationBar.qml +179 -0
  45. RinUI/components/Navigation/NavigationItem.qml +193 -0
  46. RinUI/components/Navigation/NavigationSubItem.qml +103 -0
  47. RinUI/components/Navigation/NavigationView.qml +210 -0
  48. RinUI/components/Navigation/SelectorBar.qml +58 -0
  49. RinUI/components/ScrollBar.qml +163 -0
  50. RinUI/components/ScrollView.qml +13 -0
  51. RinUI/components/Shadow.qml +48 -0
  52. RinUI/components/StatusAndInfo/InfoBadge.qml +78 -0
  53. RinUI/components/StatusAndInfo/InfoBar.qml +246 -0
  54. RinUI/components/StatusAndInfo/ProgressBar.qml +127 -0
  55. RinUI/components/StatusAndInfo/Toast.qml +237 -0
  56. RinUI/components/StatusAndInfo/ToolTip.qml +93 -0
  57. RinUI/components/Text/SpinBox.qml +134 -0
  58. RinUI/components/Text/Text.qml +44 -0
  59. RinUI/components/Text/TextField.qml +94 -0
  60. RinUI/components/Text/TextInput.qml +29 -0
  61. RinUI/components/Utils/Blur.qml +42 -0
  62. RinUI/components/qmldir +76 -0
  63. RinUI/config/rin_ui.json +8 -0
  64. RinUI/core/__init__.py +3 -0
  65. RinUI/core/__pycache__/__init__.cpython-38.pyc +0 -0
  66. RinUI/core/__pycache__/config.cpython-38.pyc +0 -0
  67. RinUI/core/__pycache__/launcher.cpython-38.pyc +0 -0
  68. RinUI/core/__pycache__/theme.cpython-38.pyc +0 -0
  69. RinUI/core/config.py +109 -0
  70. RinUI/core/launcher.py +144 -0
  71. RinUI/core/theme.py +342 -0
  72. RinUI/hooks/__init__.py +3 -0
  73. RinUI/hooks/hook-RinUI.py +3 -0
  74. RinUI/qmldir +92 -0
  75. RinUI/themes/dark.qml +137 -0
  76. RinUI/themes/light.qml +137 -0
  77. RinUI/themes/qmldir +7 -0
  78. RinUI/themes/theme.qml +126 -0
  79. RinUI/themes/utils.qml +28 -0
  80. RinUI/utils/Animation.qml +12 -0
  81. RinUI/utils/FloatLayer.qml +123 -0
  82. RinUI/utils/FontIconLoader.qml +14 -0
  83. RinUI/utils/Position.qml +19 -0
  84. RinUI/utils/Severity.qml +13 -0
  85. RinUI/utils/Typography.qml +17 -0
  86. RinUI/utils/qmldir +5 -0
  87. RinUI/windows/CtrlBtn.qml +119 -0
  88. RinUI/windows/FluentPage.qml +92 -0
  89. RinUI/windows/FluentWindow.qml +32 -0
  90. RinUI/windows/FluentWindowBase.qml +157 -0
  91. RinUI/windows/TitleBar.qml +132 -0
  92. RinUI/windows/qmldir +8 -0
  93. RinUI/windows/window/ApplicationWindow.qml +9 -0
  94. RinUI/windows/window/Window.qml +112 -0
  95. rinui-0.0.9.data/data/LICENSE +21 -0
  96. rinui-0.0.9.data/data/README.md +90 -0
  97. rinui-0.0.9.dist-info/LICENSE +21 -0
  98. rinui-0.0.9.dist-info/METADATA +105 -0
  99. rinui-0.0.9.dist-info/RECORD +102 -0
  100. rinui-0.0.9.dist-info/WHEEL +5 -0
  101. rinui-0.0.9.dist-info/entry_points.txt +2 -0
  102. rinui-0.0.9.dist-info/top_level.txt +1 -0
@@ -0,0 +1,106 @@
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
+ Popup {
9
+ id: popup
10
+ property int position: Position.Bottom
11
+ property real posX: {
12
+ switch (position) {
13
+ case Position.Top:
14
+ case Position.Bottom:
15
+ return (parent.width - popup.width) / 2
16
+ case Position.Left:
17
+ return - popup.width - 5
18
+ case Position.Right:
19
+ return parent.width + 5
20
+ default:
21
+ return (parent.width - popup.width) / 2
22
+ }
23
+ }
24
+
25
+ property real posY: {
26
+ switch (position) {
27
+ case Position.Top:
28
+ return -popup.height - 5
29
+ case Position.Bottom:
30
+ return parent.height + 5
31
+ case Position.Left:
32
+ case Position.Center:
33
+ case Position.Right:
34
+ return (parent.height - popup.height) / 2
35
+ default:
36
+ return -popup.height + 5 // 默认顶部
37
+ }
38
+ }
39
+
40
+ background: Rectangle {
41
+ id: background
42
+ anchors.fill: parent
43
+ y: -6
44
+
45
+ radius: Theme.currentTheme.appearance.windowRadius
46
+ color: Theme.currentTheme.colors.backgroundAcrylicColor
47
+ border.color: Theme.currentTheme.colors.flyoutBorderColor
48
+
49
+ Behavior on color {
50
+ ColorAnimation {
51
+ duration: Utils.appearanceSpeed
52
+ easing.type: Easing.OutQuart
53
+ }
54
+ }
55
+
56
+ layer.enabled: true
57
+ layer.effect: Shadow {
58
+ style: "flyout"
59
+ source: background
60
+ }
61
+ }
62
+
63
+ // 动画 / Animation //
64
+ enter: Transition {
65
+ ParallelAnimation {
66
+ NumberAnimation {
67
+ target: popup
68
+ property: "opacity"
69
+ from: 0
70
+ to: 1
71
+ duration: Utils.appearanceSpeed
72
+ easing.type: Easing.OutQuint
73
+ }
74
+ NumberAnimation {
75
+ target: popup
76
+ property: "y"
77
+ from: posY + (position !== Position.Center
78
+ ? (position === Position.Top ? 15 : position === Position.Bottom ? -15 : 0) : 0)
79
+ to: posY
80
+ duration: Utils.animationSpeedMiddle * 1.25
81
+ easing.type: Easing.OutQuint
82
+ }
83
+ NumberAnimation {
84
+ target: popup
85
+ property: "x"
86
+ from: posX + (position !== Position.Center
87
+ ? (position === Position.Left ? 15 : position === Position.Right ? -15 : 0) : 0)
88
+ to: posX
89
+ duration: Utils.animationSpeedMiddle * 1.25
90
+ easing.type: Easing.OutQuint
91
+ }
92
+ }
93
+ }
94
+ exit: Transition {
95
+ ParallelAnimation {
96
+ NumberAnimation {
97
+ target: popup
98
+ property: "opacity"
99
+ from: 1
100
+ to: 0
101
+ duration: Utils.animationSpeed
102
+ easing.type: Easing.OutQuint
103
+ }
104
+ }
105
+ }
106
+ }
@@ -0,0 +1,33 @@
1
+ import QtQuick 2.15
2
+ import "../themes"
3
+
4
+ Item {
5
+ id: root
6
+ anchors.fill: parent
7
+ z: 9999
8
+
9
+ required property Item control
10
+ property real radius: Theme.currentTheme.appearance.buttonRadius
11
+
12
+ visible: control.activeFocus &&
13
+ (control.focusReason === Qt.TabFocusReason ||
14
+ control.focusReason === Qt.BacktabFocusReason)
15
+
16
+ Rectangle {
17
+ anchors.fill: parent
18
+ anchors.margins: -(2 + 1) + Theme.currentTheme.appearance.borderWidth
19
+ color: "transparent"
20
+ border.width: 2
21
+ border.color: Theme.currentTheme.colors.focusBorderOuter
22
+ radius: root.radius
23
+
24
+ // inner
25
+ Rectangle {
26
+ anchors.fill: parent
27
+ anchors.margins: parent.border.width
28
+ radius: root.radius
29
+ color: "transparent"
30
+ border.color: Theme.currentTheme.colors.focusBorderInner
31
+ }
32
+ }
33
+ }
@@ -0,0 +1,52 @@
1
+ import QtQuick 2.15
2
+ import "../components"
3
+ import "../themes"
4
+ import "../utils"
5
+ // import "../assets/fonts/FluentSystemIcons-Index.js" as Icons
6
+
7
+
8
+ Item {
9
+ id: root
10
+ property string icon: "" // 字体图标(如 "\uf103")
11
+ property string source: "" // 图片路径(如 "icons/image.png")
12
+ property alias color: text.color
13
+ // property string fontSource: Qt.resolvedUrl("../assets/fonts/" + Theme.currentTheme.typography.fontIcon)
14
+ // property string fontSource: Qt.resolvedUrl("../assets/fonts/FluentSystemIcons-Resizable.ttf") // 字体图标路径
15
+
16
+ property int size: 16
17
+
18
+ // 计算是否是字体图标
19
+ property bool isUnicode: icon.length === 1 // 判断是否为单字符(字体图标通常是单个字符)
20
+ property bool isFontIcon: source === "" // 判断是否为字体图标
21
+
22
+ // 匹配尺寸
23
+ implicitWidth: size
24
+ implicitHeight: size
25
+
26
+ // 主题切换动画
27
+ Behavior on color {
28
+ ColorAnimation {
29
+ duration: 250
30
+ easing.type: Easing.OutQuart
31
+ }
32
+ }
33
+
34
+ Text {
35
+ id: text
36
+ anchors.centerIn: parent
37
+ // text: isFontIcon ? icon : "" // 仅当 `icon` 是单字符时显示
38
+ text: isUnicode ? icon : String.fromCharCode(Utils.fontIconIndex[icon]) // 显示 FluentSystemIcons 字体图标
39
+ font.family: Utils.iconFontFamily
40
+ font.pixelSize: size
41
+ }
42
+
43
+ Image {
44
+ id: iconImage
45
+ anchors.centerIn: parent
46
+ source: root.source // 仅当 `icon` 不是字体图标时加载图片
47
+ width: size
48
+ height: size
49
+ mipmap: true
50
+ fillMode: Image.PreserveAspectFit // 适配图片大小
51
+ }
52
+ }
@@ -0,0 +1,90 @@
1
+ import QtQuick 2.15
2
+ import QtQuick.Controls 2.15
3
+ import "../themes"
4
+
5
+
6
+ Rectangle {
7
+ id: indicator
8
+
9
+ property int currentItemHeight: 38
10
+ property var orientation: Qt.Vertical
11
+
12
+ implicitWidth: orientation === Qt.Horizontal? 16 : 3
13
+ implicitHeight: orientation === Qt.Horizontal? 3 : currentItemHeight - 23
14
+ radius: 10
15
+ color: Theme.currentTheme.colors.primaryColor
16
+
17
+ y: orientation === Qt.Horizontal? parent.height - height : (parent.height - height) / 2
18
+ x: orientation === Qt.Horizontal? (parent.width - width) / 2 : 0
19
+
20
+ onVisibleChanged: {
21
+ if (visible) {
22
+ enterAnimation.start()
23
+ }
24
+ }
25
+
26
+ // 动画 / Animation //
27
+ ParallelAnimation {
28
+ id: enterAnimation
29
+ PropertyAnimation {
30
+ target: indicator
31
+ property: "opacity"
32
+ from: 0.0
33
+ to: 1.0
34
+ duration: Utils.animationSpeed
35
+ easing.type: Easing.OutQuad
36
+ }
37
+ ScriptAction {
38
+ script: {
39
+ if (indicator.orientation === Qt.Horizontal) {
40
+ enterAnimationHorizontal.start()
41
+ } else {
42
+ enterAnimationVertical.start()
43
+ }
44
+ }
45
+ }
46
+ }
47
+ // 垂直方向动画group // Vertical Animation
48
+ ParallelAnimation {
49
+ id: enterAnimationVertical
50
+ PropertyAnimation {
51
+ target: indicator
52
+ property: "height"
53
+ from: 0
54
+ to: indicator.implicitHeight
55
+ duration: Utils.animationSpeedMiddle
56
+ easing.type: Easing.OutQuint
57
+ }
58
+
59
+ PropertyAnimation {
60
+ target: indicator
61
+ property: "y"
62
+ from: parent.height / 2
63
+ to: (parent.height - indicator.implicitHeight) / 2
64
+ duration: Utils.animationSpeedMiddle
65
+ easing.type: Easing.OutQuint
66
+ }
67
+ }
68
+
69
+ // 垂直方向动画group // Vertical Animation
70
+ ParallelAnimation {
71
+ id: enterAnimationHorizontal
72
+ PropertyAnimation {
73
+ target: indicator
74
+ property: "width"
75
+ from: 0
76
+ to: indicator.implicitWidth
77
+ duration: Utils.animationSpeedMiddle
78
+ easing.type: Easing.OutQuint
79
+ }
80
+
81
+ PropertyAnimation {
82
+ target: indicator
83
+ property: "x"
84
+ from: parent.width / 2
85
+ to: (parent.width - indicator.implicitWidth) / 2
86
+ duration: Utils.animationSpeedMiddle
87
+ easing.type: Easing.OutQuint
88
+ }
89
+ }
90
+ }
@@ -0,0 +1,160 @@
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
+
9
+ // expander
10
+ Item {
11
+ id: root
12
+ property bool enabled: true
13
+ property bool expanded: false
14
+ property alias headerHeight: header.height
15
+ property alias contentHeight: content.height
16
+ property alias contentPadding: content.padding
17
+ property alias contentSpacing: contentLayout.spacing
18
+ enum ExpandDirection { Up, Down }
19
+ property var expandDirection: Expander.Down
20
+ readonly property bool directionUp: root.expandDirection === Expander.Up
21
+ property real radius: Theme.currentTheme.appearance.windowRadius
22
+
23
+ property alias header: headerCustom.data
24
+ property string text: "Expander"
25
+ default property alias contentData: contentLayout.data
26
+
27
+ implicitWidth: Math.max(
28
+ headerLayout.implicitWidth + 5 * 2,
29
+ contentLayout.implicitWidth + contentPadding * 2,
30
+ headerCustom.implicitWidth + 20 + expandBtn.width
31
+ )
32
+ implicitHeight: headerHeight + (content.height - 2) * expanded
33
+
34
+ // 拦截交互
35
+ MouseArea {
36
+ z: 999
37
+ anchors.fill: parent
38
+ enabled: !root.enabled
39
+ hoverEnabled: false
40
+ preventStealing: true
41
+ onClicked: {} // 防止穿透
42
+ }
43
+
44
+ // 主体
45
+ Clip {
46
+ id: header
47
+ enabled: root.enabled
48
+ y: directionUp ? content.height * expanded : 0
49
+ width: parent.width
50
+ height: Math.max(
51
+ headerCustom.implicitHeight + 5 * 2,
52
+ headerLayout.implicitHeight + 5 * 2,
53
+ 48
54
+ )
55
+ radius: 0
56
+
57
+ RowLayout {
58
+ id: headerCustom
59
+ anchors.fill: parent
60
+ anchors.margins: 5
61
+ anchors.leftMargin: 15
62
+ anchors.rightMargin: 5 + expandBtn.width
63
+ }
64
+
65
+ RowLayout {
66
+ id: headerLayout
67
+ anchors.fill: parent
68
+ anchors.margins: 5
69
+ anchors.leftMargin: 15
70
+ spacing: 0
71
+ Text {
72
+ Layout.fillWidth: true
73
+ text: root.text
74
+ opacity: headerCustom.children.length === 0
75
+ }
76
+ // 展开按钮
77
+ ToolButton {
78
+ id: expandBtn
79
+ focusPolicy: Qt.NoFocus
80
+ Layout.preferredWidth: 40
81
+ Layout.preferredHeight: 40
82
+ hoverable: false
83
+ size: 14
84
+ icon.name: directionUp ? "ic_fluent_chevron_up_20_filled" : "ic_fluent_chevron_down_20_filled"
85
+
86
+ // 展开动画
87
+ transform: Rotation {
88
+ angle: !expanded ? 0 : 180 ; origin.x: 40/2; origin.y: 40/2
89
+ Behavior on angle { NumberAnimation { duration: Utils.animationSpeed; easing.type: Easing.OutQuint } }
90
+ }
91
+ opacity: 0.7
92
+
93
+ onClicked: expanded =!expanded
94
+ }
95
+ }
96
+
97
+ onClicked: expanded =!expanded
98
+
99
+ Behavior on y {
100
+ NumberAnimation { duration: Utils.animationSpeed; easing.type: Easing.OutQuint }
101
+ }
102
+ }
103
+
104
+ // content
105
+ Item {
106
+ id: contentContainer
107
+ width: parent.width
108
+ height: directionUp
109
+ ? expanded ? content.height : 0
110
+ : content.height
111
+ clip: true
112
+ y: directionUp ? 0 : header.height
113
+ z: -1 // 置底
114
+
115
+ Frame {
116
+ id: content
117
+ padding: 7
118
+ width: parent.width
119
+ y: expanded
120
+ ? directionUp ? 2 : - 2
121
+ : directionUp ? height : - height
122
+ radius: 0
123
+ opacity: root.enabled ? 1 : 0.65
124
+
125
+ color: Theme.currentTheme.colors.cardSecondaryColor
126
+ // 内容区域 - 布局
127
+ ColumnLayout {
128
+ id: contentLayout
129
+ anchors.fill: parent
130
+ }
131
+
132
+ Behavior on y {
133
+ NumberAnimation { duration: Utils.animationSpeed; easing.type: Easing.OutQuint }
134
+ }
135
+
136
+ Behavior on opacity {
137
+ NumberAnimation { duration: Utils.appearanceSpeed; easing.type: Easing.OutQuint }
138
+ }
139
+ }
140
+
141
+ Behavior on height {
142
+ NumberAnimation { duration: Utils.animationSpeed; easing.type: Easing.OutQuint }
143
+ }
144
+ }
145
+
146
+ // 动画
147
+ Behavior on implicitHeight {
148
+ NumberAnimation { duration: Utils.animationSpeed; easing.type: Easing.OutQuint }
149
+ }
150
+
151
+ // 圆角裁切
152
+ layer.enabled: true
153
+ layer.effect: OpacityMask {
154
+ maskSource: Rectangle {
155
+ width: root.width
156
+ height: root.height
157
+ radius: root.radius
158
+ }
159
+ }
160
+ }
@@ -0,0 +1,67 @@
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
+
9
+ // expander
10
+ Expander {
11
+ id: root
12
+ property alias content: rightContent.data
13
+ // property alias showcase: showcaseContainer.data
14
+ property string title: "Title"
15
+ property alias icon: icon.icon
16
+ property alias source: icon.source
17
+ property alias iconSize: icon.size
18
+ property string description: "A description of the setting"
19
+
20
+ contentPadding: 0
21
+ contentSpacing: 0
22
+
23
+ header: RowLayout {
24
+ Layout.margins: 13
25
+ Layout.leftMargin: 0
26
+ spacing: 16
27
+
28
+ RowLayout {
29
+ id: leftContent
30
+ Layout.maximumWidth: parent.width * 0.6
31
+ spacing: 16
32
+
33
+ IconWidget {
34
+ id: icon
35
+ size: 20
36
+ }
37
+ Column {
38
+ Layout.fillWidth: true
39
+ spacing: 0
40
+ Text {
41
+ width: parent.width
42
+ typography: Typography.Body
43
+ text: title
44
+ maximumLineCount: 2 // 限制最多两行
45
+ elide: Text.ElideRight // 超过限制时用省略号
46
+ }
47
+
48
+ Text {
49
+ width: parent.width
50
+ typography: Typography.Caption
51
+ text: description
52
+ color: Theme.currentTheme.colors.textSecondaryColor
53
+ wrapMode: Text.Wrap // 启用换行
54
+ maximumLineCount: 3
55
+ elide: Text.ElideRight
56
+ }
57
+ }
58
+ }
59
+ RowLayout {
60
+ id: rightContent
61
+ Layout.fillHeight: true
62
+ Item { Layout.fillWidth: true }
63
+ Layout.alignment: Qt.AlignRight
64
+ spacing: 16
65
+ }
66
+ }
67
+ }
@@ -0,0 +1,71 @@
1
+ import QtQuick 2.15
2
+ import QtQuick.Controls 2.15
3
+ import QtQuick.Layouts 2.15
4
+ import RinUI
5
+
6
+
7
+ Frame {
8
+ id: frame
9
+ default property alias content: rightContent.data
10
+ // property alias showcase: showcaseContainer.data
11
+ property string title
12
+ property string description
13
+
14
+ leftPadding: 15 + 35
15
+ rightPadding: 15
16
+ topPadding: 13
17
+ bottomPadding: 13
18
+ // implicitHeight: 62
19
+ Layout.fillWidth: true
20
+
21
+ background: Rectangle {
22
+ anchors.bottom: parent.bottom
23
+ width: parent.width
24
+ height: 1
25
+ color: Theme.currentTheme.colors.dividerBorderColor
26
+ }
27
+
28
+ RowLayout {
29
+ anchors.fill: parent
30
+ spacing: 16
31
+
32
+ RowLayout {
33
+ id: leftContent
34
+ Layout.maximumWidth: parent.width * 0.6
35
+ Layout.fillHeight: true
36
+ spacing: 16
37
+
38
+ Column {
39
+ Layout.fillWidth: true
40
+ spacing: 0
41
+ Text {
42
+ id: titleLabel
43
+ width: parent.width
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
+ width: parent.width
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.alignment: Qt.AlignRight
68
+ spacing: 16
69
+ }
70
+ }
71
+ }
@@ -0,0 +1,22 @@
1
+ import QtQuick 2.15
2
+ import QtQuick.Controls 2.15
3
+ import QtQuick.Layouts 2.15
4
+ import RinUI
5
+
6
+
7
+ Button {
8
+ id: root
9
+ property alias color: background.color
10
+ property alias radius: background.radius
11
+ property alias borderColor: background.borderColor
12
+ property alias borderWidth: background.borderWidth
13
+
14
+ background: Frame {
15
+ id: background
16
+ anchors.fill: parent
17
+ color: root.backgroundColor
18
+ opacity: 1
19
+ }
20
+
21
+ contentItem: Item {}
22
+ }
@@ -0,0 +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
+ }
44
+ }