RinUI 0.0.10.1__tar.gz → 0.1.0__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.10.1/RinUI.egg-info → rinui-0.1.0}/PKG-INFO +6 -2
- {rinui-0.0.10.1 → rinui-0.1.0}/README.md +5 -1
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/__init__.py +1 -1
- rinui-0.1.0/RinUI/__pycache__/__init__.cpython-38.pyc +0 -0
- rinui-0.1.0/RinUI/assets/img/default_app_icon.png +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/BasicInput/Button.qml +1 -2
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/ContextMenu.qml +1 -1
- rinui-0.1.0/RinUI/components/DialogsAndFlyouts/Flyout.qml +87 -0
- rinui-0.1.0/RinUI/components/Media/Avatar.qml +83 -0
- rinui-0.1.0/RinUI/components/MenusAndToolbars/TextInputMenu.qml +38 -0
- rinui-0.1.0/RinUI/components/Navigation/Segmented.qml +17 -0
- rinui-0.1.0/RinUI/components/Navigation/SegmentedItem.qml +108 -0
- rinui-0.1.0/RinUI/components/Navigation/SelectorBar.qml +13 -0
- rinui-0.1.0/RinUI/components/Navigation/SelectorBarItem.qml +89 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/Text/TextArea.qml +1 -29
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/Text/TextField.qml +1 -29
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/Text/TextInput.qml +19 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/qmldir +4 -0
- rinui-0.1.0/RinUI/core/__init__.py +4 -0
- rinui-0.1.0/RinUI/core/__pycache__/__init__.cpython-38.pyc +0 -0
- rinui-0.1.0/RinUI/core/__pycache__/config.cpython-38.pyc +0 -0
- rinui-0.1.0/RinUI/core/__pycache__/launcher.cpython-38.pyc +0 -0
- rinui-0.1.0/RinUI/core/__pycache__/theme.cpython-38.pyc +0 -0
- rinui-0.1.0/RinUI/core/__pycache__/translator.cpython-38.pyc +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/core/config.py +11 -2
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/core/launcher.py +24 -37
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/core/theme.py +17 -20
- rinui-0.1.0/RinUI/core/translator.py +25 -0
- rinui-0.1.0/RinUI/languages/en_US.qm +1 -0
- rinui-0.1.0/RinUI/languages/en_US.ts +201 -0
- rinui-0.1.0/RinUI/languages/zh_CN.qm +0 -0
- rinui-0.1.0/RinUI/languages/zh_CN.ts +204 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/qmldir +8 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/themes/dark.qml +9 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/themes/light.qml +10 -1
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/themes/theme.qml +39 -15
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/themes/utils.qml +4 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/windows/FluentWindow.qml +0 -1
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/windows/FluentWindowBase.qml +0 -1
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/windows/TitleBar.qml +2 -2
- {rinui-0.0.10.1 → rinui-0.1.0/RinUI.egg-info}/PKG-INFO +6 -2
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI.egg-info/SOURCES.txt +12 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/pyproject.toml +2 -2
- rinui-0.0.10.1/RinUI/__pycache__/__init__.cpython-38.pyc +0 -0
- rinui-0.0.10.1/RinUI/assets/img/default_app_icon.png +0 -0
- rinui-0.0.10.1/RinUI/components/DialogsAndFlyouts/Flyout.qml +0 -144
- rinui-0.0.10.1/RinUI/components/Navigation/SelectorBar.qml +0 -58
- rinui-0.0.10.1/RinUI/core/__init__.py +0 -3
- 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.10.1/RinUI/core/__pycache__/theme.cpython-38.pyc +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/LICENSE +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/MANIFEST.in +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/assets/fonts/FluentSystemIcons-Index.js +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/assets/fonts/FluentSystemIcons-Resizable.ttf +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/Base.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/BasicInput/CheckBox.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/BasicInput/ComboBox.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/BasicInput/DropDownButton.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/BasicInput/Hyperlink.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/BasicInput/PillButton.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/BasicInput/RadioButton.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/BasicInput/RoundButton.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/BasicInput/Slider.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/BasicInput/Switch.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/BasicInput/ToggleButton.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/BasicInput/ToolButton.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/DateAndTime/DatePicker.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/DateAndTime/PickerView.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/DateAndTime/TimePicker.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/DialogsAndFlyouts/Dialog.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/DialogsAndFlyouts/DialogButtonBox.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/DialogsAndFlyouts/Popup.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/FocusIndicator.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/IconWidget.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/Indicator.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/Layout/Expander.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/Layout/SettingExpander.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/Layout/SettingItem.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/ListAndCollections/Clip.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/ListAndCollections/Frame.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/ListAndCollections/ListView.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/ListAndCollections/ListViewDelegate.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/ListAndCollections/SettingCard.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/ListAndCollections/TableView.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/ListAndCollections/TableViewDelegate.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/MenusAndToolbars/Menu.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/MenusAndToolbars/MenuBar.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/MenusAndToolbars/MenuItem.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/MenusAndToolbars/MenuItemGroup.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/MenusAndToolbars/MenuSeparator.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/MenusAndToolbars/ToolSeparator.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/Navigation/ErrorPage.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/Navigation/NavigationBar.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/Navigation/NavigationItem.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/Navigation/NavigationSubItem.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/Navigation/NavigationView.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/ScrollBar.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/ScrollView.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/Shadow.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/StatusAndInfo/InfoBadge.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/StatusAndInfo/InfoBar.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/StatusAndInfo/ProgressBar.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/StatusAndInfo/Toast.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/StatusAndInfo/ToolTip.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/Text/SpinBox.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/components/Text/Text.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/config/rin_ui.json +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/hooks/__init__.py +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/hooks/hook-RinUI.py +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/themes/qmldir +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/utils/Animation.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/utils/FloatLayer.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/utils/FontIconLoader.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/utils/Position.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/utils/Severity.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/utils/Typography.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/utils/qmldir +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/windows/CtrlBtn.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/windows/FluentPage.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/windows/qmldir +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/windows/window/ApplicationWindow.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI/windows/window/Window.qml +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI.egg-info/dependency_links.txt +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI.egg-info/entry_points.txt +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI.egg-info/requires.txt +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/RinUI.egg-info/top_level.txt +0 -0
- {rinui-0.0.10.1 → rinui-0.1.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: RinUI
|
3
|
-
Version: 0.0
|
3
|
+
Version: 0.1.0
|
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
|
@@ -14,6 +14,7 @@ Requires-Dist: darkdetect~=0.8.0
|
|
14
14
|
Requires-Dist: pywin32>=306; sys_platform == "win32"
|
15
15
|
|
16
16
|
<div align="center">
|
17
|
+
<img src="docs/img/logo.png" alt="RinUI Logo" width="18%">
|
17
18
|
<h1>RinUI</h1>
|
18
19
|
<p>A Fluent Design-like UI library for Qt Quick (QML)</p>
|
19
20
|
|
@@ -35,7 +36,8 @@ With simple configuration, you can quickly develop elegant UI interfaces in the
|
|
35
36
|
* Elegant Fluent Design controls (WIP)
|
36
37
|
* Dark and light mode, automatic switching
|
37
38
|
* Compatible with original QML control names
|
38
|
-
*
|
39
|
+
* i18n Internationalization
|
40
|
+
* Multi-programming language support (WIP)
|
39
41
|
* Theme system (WIP)
|
40
42
|
* Development documentation, [preview](https://ui.rinlit.cn/) now. (WIP)
|
41
43
|
|
@@ -51,6 +53,8 @@ With simple configuration, you can quickly develop elegant UI interfaces in the
|
|
51
53
|

|
52
54
|
</details>
|
53
55
|
|
56
|
+
> The image in the banner comes from Pixiv, PID: [125975786](https://www.pixiv.net/artworks/125975786)
|
57
|
+
|
54
58
|
## 🪄 Usage
|
55
59
|
|
56
60
|
You can install RinUI via pip:
|
@@ -1,4 +1,5 @@
|
|
1
1
|
<div align="center">
|
2
|
+
<img src="docs/img/logo.png" alt="RinUI Logo" width="18%">
|
2
3
|
<h1>RinUI</h1>
|
3
4
|
<p>A Fluent Design-like UI library for Qt Quick (QML)</p>
|
4
5
|
|
@@ -20,7 +21,8 @@ With simple configuration, you can quickly develop elegant UI interfaces in the
|
|
20
21
|
* Elegant Fluent Design controls (WIP)
|
21
22
|
* Dark and light mode, automatic switching
|
22
23
|
* Compatible with original QML control names
|
23
|
-
*
|
24
|
+
* i18n Internationalization
|
25
|
+
* Multi-programming language support (WIP)
|
24
26
|
* Theme system (WIP)
|
25
27
|
* Development documentation, [preview](https://ui.rinlit.cn/) now. (WIP)
|
26
28
|
|
@@ -36,6 +38,8 @@ With simple configuration, you can quickly develop elegant UI interfaces in the
|
|
36
38
|

|
37
39
|
</details>
|
38
40
|
|
41
|
+
> The image in the banner comes from Pixiv, PID: [125975786](https://www.pixiv.net/artworks/125975786)
|
42
|
+
|
39
43
|
## 🪄 Usage
|
40
44
|
|
41
45
|
You can install RinUI via pip:
|
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 :
|
@@ -0,0 +1,87 @@
|
|
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: flyout
|
10
|
+
property alias text: flyoutText.text // 弹出文本内容
|
11
|
+
property alias buttonBox: buttonLayout.data // 按钮列表
|
12
|
+
default property alias content: customContent.data // 弹出内容
|
13
|
+
|
14
|
+
position: Position.Top
|
15
|
+
|
16
|
+
padding: 16
|
17
|
+
|
18
|
+
contentItem: ColumnLayout {
|
19
|
+
spacing: 0
|
20
|
+
|
21
|
+
ColumnLayout {
|
22
|
+
id: customContent
|
23
|
+
spacing: 8
|
24
|
+
Layout.fillWidth: true
|
25
|
+
|
26
|
+
Text {
|
27
|
+
id: flyoutText
|
28
|
+
Layout.fillWidth: true
|
29
|
+
typography: Typography.Body
|
30
|
+
visible: text.length > 0
|
31
|
+
}
|
32
|
+
}
|
33
|
+
|
34
|
+
Item {
|
35
|
+
height: 16
|
36
|
+
visible: buttonLayout.children.length > 0
|
37
|
+
}
|
38
|
+
|
39
|
+
RowLayout {
|
40
|
+
Layout.fillWidth: true
|
41
|
+
id: buttonLayout
|
42
|
+
spacing: 8
|
43
|
+
}
|
44
|
+
}
|
45
|
+
|
46
|
+
// 动画 / Animation //
|
47
|
+
enter: Transition {
|
48
|
+
ParallelAnimation {
|
49
|
+
NumberAnimation {
|
50
|
+
target: flyout
|
51
|
+
property: "opacity"
|
52
|
+
from: 0
|
53
|
+
to: 1
|
54
|
+
duration: Utils.appearanceSpeed
|
55
|
+
easing.type: Easing.OutQuint
|
56
|
+
}
|
57
|
+
NumberAnimation {
|
58
|
+
target: flyout
|
59
|
+
property: "y"
|
60
|
+
from: posY + (position === Position.Top ? 15 : position === Position.Bottom ? -15 : 0)
|
61
|
+
to: posY
|
62
|
+
duration: Utils.animationSpeedMiddle * 1.25
|
63
|
+
easing.type: Easing.OutQuint
|
64
|
+
}
|
65
|
+
NumberAnimation {
|
66
|
+
target: flyout
|
67
|
+
property: "x"
|
68
|
+
from: posX + (position === Position.Left ? 15 : position === Position.Right ? -15 : 0)
|
69
|
+
to: posX
|
70
|
+
duration: Utils.animationSpeedMiddle * 1.25
|
71
|
+
easing.type: Easing.OutQuint
|
72
|
+
}
|
73
|
+
}
|
74
|
+
}
|
75
|
+
exit: Transition {
|
76
|
+
ParallelAnimation {
|
77
|
+
NumberAnimation {
|
78
|
+
target: flyout
|
79
|
+
property: "opacity"
|
80
|
+
from: 1
|
81
|
+
to: 0
|
82
|
+
duration: Utils.animationSpeed
|
83
|
+
easing.type: Easing.OutQuint
|
84
|
+
}
|
85
|
+
}
|
86
|
+
}
|
87
|
+
}
|
@@ -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
|
+
}
|
@@ -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;
|
@@ -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
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|