Skip to content

Commit 87048c9

Browse files
committed
2 parents 24b3134 + 70496b4 commit 87048c9

File tree

91 files changed

+10994
-1039
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+10994
-1039
lines changed

components/ConnectionHeader.qml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import qs.components
2+
import qs.services
3+
import qs.config
4+
import QtQuick
5+
import QtQuick.Layouts
6+
7+
ColumnLayout {
8+
id: root
9+
10+
required property string icon
11+
required property string title
12+
13+
spacing: Appearance.spacing.normal
14+
Layout.alignment: Qt.AlignHCenter
15+
16+
MaterialIcon {
17+
Layout.alignment: Qt.AlignHCenter
18+
animate: true
19+
text: root.icon
20+
font.pointSize: Appearance.font.size.extraLarge * 3
21+
font.bold: true
22+
}
23+
24+
StyledText {
25+
Layout.alignment: Qt.AlignHCenter
26+
animate: true
27+
text: root.title
28+
font.pointSize: Appearance.font.size.large
29+
font.bold: true
30+
}
31+
}
32+
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import qs.components
2+
import qs.components.effects
3+
import qs.services
4+
import qs.config
5+
import QtQuick
6+
import QtQuick.Layouts
7+
8+
ColumnLayout {
9+
id: root
10+
11+
required property var deviceDetails
12+
13+
spacing: Appearance.spacing.small / 2
14+
15+
StyledText {
16+
text: qsTr("IP Address")
17+
}
18+
19+
StyledText {
20+
text: root.deviceDetails?.ipAddress || qsTr("Not available")
21+
color: Colours.palette.m3outline
22+
font.pointSize: Appearance.font.size.small
23+
}
24+
25+
StyledText {
26+
Layout.topMargin: Appearance.spacing.normal
27+
text: qsTr("Subnet Mask")
28+
}
29+
30+
StyledText {
31+
text: root.deviceDetails?.subnet || qsTr("Not available")
32+
color: Colours.palette.m3outline
33+
font.pointSize: Appearance.font.size.small
34+
}
35+
36+
StyledText {
37+
Layout.topMargin: Appearance.spacing.normal
38+
text: qsTr("Gateway")
39+
}
40+
41+
StyledText {
42+
text: root.deviceDetails?.gateway || qsTr("Not available")
43+
color: Colours.palette.m3outline
44+
font.pointSize: Appearance.font.size.small
45+
}
46+
47+
StyledText {
48+
Layout.topMargin: Appearance.spacing.normal
49+
text: qsTr("DNS Servers")
50+
}
51+
52+
StyledText {
53+
text: (root.deviceDetails && root.deviceDetails.dns && root.deviceDetails.dns.length > 0) ? root.deviceDetails.dns.join(", ") : qsTr("Not available")
54+
color: Colours.palette.m3outline
55+
font.pointSize: Appearance.font.size.small
56+
wrapMode: Text.Wrap
57+
Layout.maximumWidth: parent.width
58+
}
59+
}
60+

components/PropertyRow.qml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import qs.components
2+
import qs.services
3+
import qs.config
4+
import QtQuick
5+
import QtQuick.Layouts
6+
7+
ColumnLayout {
8+
id: root
9+
10+
required property string label
11+
required property string value
12+
property bool showTopMargin: false
13+
14+
spacing: Appearance.spacing.small / 2
15+
16+
StyledText {
17+
Layout.topMargin: root.showTopMargin ? Appearance.spacing.normal : 0
18+
text: root.label
19+
}
20+
21+
StyledText {
22+
text: root.value
23+
color: Colours.palette.m3outline
24+
font.pointSize: Appearance.font.size.small
25+
}
26+
}
27+

components/SectionContainer.qml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import qs.components
2+
import qs.components.effects
3+
import qs.services
4+
import qs.config
5+
import QtQuick
6+
import QtQuick.Layouts
7+
8+
StyledRect {
9+
id: root
10+
11+
default property alias content: contentColumn.data
12+
property real contentSpacing: Appearance.spacing.larger
13+
property bool alignTop: false
14+
15+
Layout.fillWidth: true
16+
implicitHeight: contentColumn.implicitHeight + Appearance.padding.large * 2
17+
18+
radius: Appearance.rounding.normal
19+
color: Colours.transparency.enabled
20+
? Colours.layer(Colours.palette.m3surfaceContainer, 2)
21+
: Colours.palette.m3surfaceContainerHigh
22+
23+
ColumnLayout {
24+
id: contentColumn
25+
26+
anchors.left: parent.left
27+
anchors.right: parent.right
28+
anchors.top: root.alignTop ? parent.top : undefined
29+
anchors.verticalCenter: root.alignTop ? undefined : parent.verticalCenter
30+
anchors.margins: Appearance.padding.large
31+
32+
spacing: root.contentSpacing
33+
}
34+
}
35+

components/SectionHeader.qml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import qs.components
2+
import qs.services
3+
import qs.config
4+
import QtQuick
5+
import QtQuick.Layouts
6+
7+
ColumnLayout {
8+
id: root
9+
10+
required property string title
11+
property string description: ""
12+
13+
spacing: 0
14+
15+
StyledText {
16+
Layout.topMargin: Appearance.spacing.large
17+
text: root.title
18+
font.pointSize: Appearance.font.size.larger
19+
font.weight: 500
20+
}
21+
22+
StyledText {
23+
visible: root.description !== ""
24+
text: root.description
25+
color: Colours.palette.m3outline
26+
}
27+
}
28+

components/StateLayer.qml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ MouseArea {
66
id: root
77

88
property bool disabled
9+
property bool showHoverBackground: true
910
property color color: Colours.palette.m3onSurface
1011
property real radius: parent?.radius ?? 0
1112
property alias rect: hoverLayer
@@ -75,7 +76,7 @@ MouseArea {
7576

7677
anchors.fill: parent
7778

78-
color: Qt.alpha(root.color, root.disabled ? 0 : root.pressed ? 0.1 : root.containsMouse ? 0.08 : 0)
79+
color: Qt.alpha(root.color, root.disabled ? 0 : root.pressed ? 0.12 : (root.showHoverBackground && root.containsMouse) ? 0.08 : 0)
7980
radius: root.radius
8081

8182
StyledRect {
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
import ".."
2+
import qs.components
3+
import qs.components.effects
4+
import qs.services
5+
import qs.config
6+
import QtQuick
7+
import QtQuick.Layouts
8+
9+
ColumnLayout {
10+
id: root
11+
12+
required property string title
13+
property string description: ""
14+
property bool expanded: false
15+
property bool showBackground: false
16+
property bool nested: false
17+
18+
signal toggleRequested
19+
20+
spacing: Appearance.spacing.small
21+
Layout.fillWidth: true
22+
23+
Item {
24+
id: sectionHeaderItem
25+
Layout.fillWidth: true
26+
Layout.preferredHeight: Math.max(titleRow.implicitHeight + Appearance.padding.normal * 2, 48)
27+
28+
RowLayout {
29+
id: titleRow
30+
anchors.left: parent.left
31+
anchors.right: parent.right
32+
anchors.verticalCenter: parent.verticalCenter
33+
anchors.leftMargin: Appearance.padding.normal
34+
anchors.rightMargin: Appearance.padding.normal
35+
spacing: Appearance.spacing.normal
36+
37+
StyledText {
38+
text: root.title
39+
font.pointSize: Appearance.font.size.larger
40+
font.weight: 500
41+
}
42+
43+
Item {
44+
Layout.fillWidth: true
45+
}
46+
47+
MaterialIcon {
48+
text: "expand_more"
49+
rotation: root.expanded ? 180 : 0
50+
color: Colours.palette.m3onSurfaceVariant
51+
font.pointSize: Appearance.font.size.normal
52+
Behavior on rotation {
53+
Anim {
54+
duration: Appearance.anim.durations.small
55+
easing.bezierCurve: Appearance.anim.curves.standard
56+
}
57+
}
58+
}
59+
}
60+
61+
StateLayer {
62+
anchors.fill: parent
63+
color: Colours.palette.m3onSurface
64+
radius: Appearance.rounding.normal
65+
showHoverBackground: false
66+
function onClicked(): void {
67+
root.toggleRequested();
68+
root.expanded = !root.expanded;
69+
}
70+
}
71+
}
72+
73+
default property alias content: contentColumn.data
74+
75+
Item {
76+
id: contentWrapper
77+
Layout.fillWidth: true
78+
Layout.preferredHeight: root.expanded ? (contentColumn.implicitHeight + Appearance.spacing.small * 2) : 0
79+
clip: true
80+
81+
Behavior on Layout.preferredHeight {
82+
Anim {
83+
easing.bezierCurve: Appearance.anim.curves.standard
84+
}
85+
}
86+
87+
StyledRect {
88+
id: backgroundRect
89+
anchors.fill: parent
90+
radius: Appearance.rounding.normal
91+
color: Colours.transparency.enabled
92+
? Colours.layer(Colours.palette.m3surfaceContainer, root.nested ? 3 : 2)
93+
: (root.nested ? Colours.palette.m3surfaceContainerHigh : Colours.palette.m3surfaceContainer)
94+
opacity: root.showBackground && root.expanded ? 1.0 : 0.0
95+
visible: root.showBackground
96+
97+
Behavior on opacity {
98+
Anim {
99+
easing.bezierCurve: Appearance.anim.curves.standard
100+
}
101+
}
102+
}
103+
104+
ColumnLayout {
105+
id: contentColumn
106+
anchors.left: parent.left
107+
anchors.right: parent.right
108+
y: Appearance.spacing.small
109+
anchors.leftMargin: Appearance.padding.normal
110+
anchors.rightMargin: Appearance.padding.normal
111+
anchors.bottomMargin: Appearance.spacing.small
112+
spacing: Appearance.spacing.small
113+
opacity: root.expanded ? 1.0 : 0.0
114+
115+
Behavior on opacity {
116+
Anim {
117+
easing.bezierCurve: Appearance.anim.curves.standard
118+
}
119+
}
120+
121+
StyledText {
122+
id: descriptionText
123+
Layout.fillWidth: true
124+
Layout.topMargin: root.description !== "" ? Appearance.spacing.smaller : 0
125+
Layout.bottomMargin: root.description !== "" ? Appearance.spacing.small : 0
126+
visible: root.description !== ""
127+
text: root.description
128+
color: Colours.palette.m3onSurfaceVariant
129+
font.pointSize: Appearance.font.size.small
130+
wrapMode: Text.Wrap
131+
}
132+
}
133+
}
134+
}
135+

0 commit comments

Comments
 (0)