Skip to content

Commit 4fc5f72

Browse files
committed
Improve the device list view, and other UI elements
1 parent 72f5042 commit 4fc5f72

12 files changed

+204
-162
lines changed

assets/assets.qrc

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
<file>icons_material/baseline-chevron_right-24px.svg</file>
6464
<file>icons_material/baseline-check_circle-24px.svg</file>
6565
<file>icons_material/baseline-close-24px.svg</file>
66+
<file>icons_material/baseline-content_copy-24px.svg</file>
6667
<file>icons_material/baseline-help-24px.svg</file>
6768
<file>icons_material/baseline-insert_link-24px.svg</file>
6869
<file>icons_material/baseline-loupe-24px.svg</file>
Loading

qml/PanelDeviceAdvertisement.qml

+34-31
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import QtQuick
22
import QtQuick.Controls
3+
import QtQuick.Layouts
34

45
import ThemeEngine
56
import DeviceUtils
@@ -66,29 +67,54 @@ Flickable {
6667

6768
visible: (selectedDevice && selectedDevice.hasAdvertisement)
6869

69-
Row {
70+
////
71+
72+
RowLayout {
7073
anchors.top: parent.top
7174
anchors.topMargin: 12
7275
anchors.left: parent.left
7376
anchors.leftMargin: 16
77+
anchors.right: parent.right
78+
anchors.rightMargin: 16
79+
7480
height: 32
7581
spacing: 12
7682

7783
Rectangle {
84+
Layout.alignment: Qt.AlignVCenter
7885
width: 16; height: 16; radius: 4;
79-
anchors.verticalCenter: parent.verticalCenter
80-
anchors.verticalCenterOffset: -1
8186
color: Theme.colorGreen
8287
}
8388

8489
Text {
85-
anchors.verticalCenter: parent.verticalCenter
90+
Layout.fillWidth: true
91+
Layout.alignment: Qt.AlignVCenter
8692

8793
text: qsTr("Service data")
8894
textFormat: Text.PlainText
8995
font.pixelSize: Theme.fontSizeContentBig
96+
horizontalAlignment: Text.AlignLeft
97+
elide: Text.ElideRight
9098
color: Theme.colorText
9199
}
100+
101+
Text {
102+
Layout.fillWidth: true
103+
Layout.alignment: Qt.AlignVCenter
104+
105+
text: qsTr("Manufacturer data")
106+
textFormat: Text.PlainText
107+
font.pixelSize: Theme.fontSizeContentBig
108+
horizontalAlignment: Text.AlignRight
109+
elide: Text.ElideRight
110+
color: Theme.colorText
111+
}
112+
113+
Rectangle {
114+
Layout.alignment: Qt.AlignVCenter
115+
width: 16; height: 16; radius: 4;
116+
color: Theme.colorBlue
117+
}
92118
}
93119

94120
////
@@ -122,33 +148,6 @@ Flickable {
122148
}
123149
}
124150

125-
////////
126-
127-
Row {
128-
anchors.top: parent.top
129-
anchors.topMargin: 12
130-
anchors.right: parent.right
131-
anchors.rightMargin: 16
132-
height: 32
133-
spacing: 12
134-
135-
Text {
136-
anchors.verticalCenter: parent.verticalCenter
137-
138-
text: qsTr("Manufacturer data")
139-
textFormat: Text.PlainText
140-
font.pixelSize: Theme.fontSizeContentBig
141-
color: Theme.colorText
142-
}
143-
144-
Rectangle {
145-
width: 16; height: 16; radius: 4;
146-
anchors.verticalCenter: parent.verticalCenter
147-
anchors.verticalCenterOffset: -1
148-
color: Theme.colorBlue
149-
}
150-
}
151-
152151
////
153152

154153
Row {
@@ -179,6 +178,8 @@ Flickable {
179178
}
180179
}
181180
}
181+
182+
////
182183
}
183184

184185
////////
@@ -192,5 +193,7 @@ Flickable {
192193
packet: modelData
193194
}
194195
}
196+
197+
////////
195198
}
196199
}

qml/PanelDeviceInfos.qml

+23-9
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ Flickable {
2727
////////
2828

2929
function resetButtons() {
30-
exportButton.text = qsTr("export available data")
31-
exportButton.primaryColor = Theme.colorGrey
30+
exportButton.reset()
3231
}
3332

3433
////////
@@ -413,12 +412,6 @@ Flickable {
413412
anchors.centerIn: parent
414413
spacing: 12
415414

416-
Flow { // status row
417-
anchors.left: parent.left
418-
anchors.right: parent.right
419-
spacing: 12
420-
}
421-
422415
Flow { // buttons row
423416
anchors.left: parent.left
424417
anchors.right: parent.right
@@ -440,6 +433,11 @@ Flickable {
440433
text: qsTr("export available data")
441434
source: "qrc:/assets/icons_material/baseline-save-24px.svg"
442435

436+
function reset() {
437+
exportButton.text = qsTr("export available data")
438+
exportButton.primaryColor = Theme.colorGrey
439+
}
440+
443441
onClicked: {
444442
// (file selection)
445443
fileDialog.selectedFile = fileDialog.currentFolder +
@@ -481,6 +479,22 @@ Flickable {
481479
}
482480
}
483481
}
482+
/*
483+
Flow { // status row
484+
anchors.left: parent.left
485+
anchors.right: parent.right
486+
spacing: 12
487+
488+
Text {
489+
text: qsTr("%n adv packet(s)", "", selectedDevice.advCount)
490+
color: Theme.colorSubText
491+
}
492+
Text {
493+
text: qsTr("%n service(s)", "", selectedDevice.servicesCount)
494+
color: Theme.colorSubText
495+
}
496+
}
497+
*/
484498
}
485499
}
486500

@@ -600,7 +614,7 @@ Flickable {
600614
height: box3.height + 32
601615
radius: 4
602616

603-
clip: false
617+
clip: true
604618
color: Theme.colorBox
605619
border.width: 2
606620
border.color: Theme.colorBoxBorder

qml/PanelDeviceServices.qml

+4-2
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,14 @@ Item {
6262
anchors.right: parent.right
6363
spacing: 12
6464

65+
property int www: (width > 400) ? ((width - spacing) / 2) : width
66+
6567
ButtonScanMenu {
66-
width: ((parent.width - parent.spacing) / 2)
68+
width: parent.www
6769
}
6870

6971
ButtonWireframeIcon {
70-
width: ((parent.width - parent.spacing) / 2)
72+
width: parent.www
7173

7274
fullColor: true
7375
primaryColor: Theme.colorLightGrey

qml/ScreenAdvertiser.qml

+3-18
Original file line numberDiff line numberDiff line change
@@ -39,28 +39,13 @@ Loader {
3939

4040
////////
4141

42-
Rectangle { // not implemented
42+
FrameBox { // not implemented
4343
width: screenAdvertiser.width * 0.666
44-
height: 128
45-
radius: 4
46-
47-
clip: false
48-
color: Theme.colorBox
49-
border.width: 2
50-
border.color: Theme.colorBoxBorder
51-
52-
Rectangle {
53-
anchors.top: parent.top
54-
anchors.left: parent.left
55-
anchors.bottom: parent.bottom
56-
57-
width: 8
58-
radius: 2
59-
color: Theme.colorPrimary
60-
}
44+
padding: 0
6145

6246
Item {
6347
anchors.left: parent.left
48+
anchors.verticalCenter: parent.verticalCenter
6449
width: 128
6550
height: 128
6651

qml/components.qrc

+3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
<file alias="SliderValueSolid.qml">components_generic/SliderValueSolid.qml</file>
2121
<file alias="ToolTipFlat.qml">components_generic/ToolTipFlat.qml</file>
2222

23+
<file alias="FrameBox.qml">components_generic/FrameBox.qml</file>
24+
<file alias="FrameThemed.qml">components_themed/FrameThemed.qml</file>
25+
2326
<file alias="ButtonThemed.qml">components_themed/ButtonThemed.qml</file>
2427
<file alias="CheckBoxThemed.qml">components_themed/CheckBoxThemed.qml</file>
2528
<file alias="ComboBoxThemed.qml">components_themed/ComboBoxThemed.qml</file>

qml/components/AdvertisementDataWidgetAdvanced.qml

+46-25
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ Rectangle {
4141
////////////////
4242

4343
Text {
44+
id: timebox
4445
anchors.top: parent.top
4546
anchors.right: parent.right
4647
anchors.topMargin: 4
@@ -77,12 +78,17 @@ Rectangle {
7778

7879
////////
7980

80-
Row {
81+
RowLayout {
82+
anchors.left: parent.left
83+
anchors.right: parent.right
84+
anchors.rightMargin: timebox.width
8185
spacing: 12
8286

8387
Text {
8488
id: legendUUID
85-
width: legendWidth
89+
90+
Layout.alignment: Qt.AlignTop | Qt.AlignRight
91+
Layout.preferredWidth: legendWidth
8692

8793
text: qsTr("UUID")
8894
textFormat: Text.PlainText
@@ -91,33 +97,48 @@ Rectangle {
9197
color: Theme.colorSubText
9298
}
9399

94-
Row {
95-
spacing: 2
100+
Flow {
101+
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
102+
Layout.fillWidth: true
103+
spacing: 4
96104

97-
Text {
98-
text: "0x"
99-
textFormat: Text.PlainText
100-
font.pixelSize: Theme.fontSizeContent
101-
color: Theme.colorSubText
102-
}
103-
TextSelectable {
104-
text: packet.advUUIDstr
105-
font.pixelSize: Theme.fontSizeContent
106-
color: Theme.colorText
107-
}
108-
}
109-
}
105+
Row {
106+
spacing: 2
110107

111-
////////
108+
Text {
109+
text: "0x"
110+
textFormat: Text.PlainText
111+
font.pixelSize: Theme.fontSizeContent
112+
color: Theme.colorSubText
113+
}
114+
TextSelectable {
115+
text: packet.advUUIDstr
116+
font.pixelSize: Theme.fontSizeContent
117+
color: Theme.colorText
118+
}
119+
}
112120

113-
TextSelectable {
114-
anchors.left: parent.left
115-
anchors.leftMargin: legendWidth + 12
116-
anchors.right: parent.right
121+
Row {
122+
visible: (packet.advUUIDmanuf.length > 1)
117123

118-
visible: (packet.advUUIDmanuf.length > 1)
119-
text: packet.advUUIDmanuf
120-
color: Theme.colorText
124+
Text {
125+
text: "("
126+
textFormat: Text.PlainText
127+
font.pixelSize: Theme.fontSizeContent
128+
color: Theme.colorSubText
129+
}
130+
TextSelectable {
131+
text: packet.advUUIDmanuf
132+
color: Theme.colorText
133+
}
134+
Text {
135+
text: ")"
136+
textFormat: Text.PlainText
137+
font.pixelSize: Theme.fontSizeContent
138+
color: Theme.colorSubText
139+
}
140+
}
141+
}
121142
}
122143

123144
////////

0 commit comments

Comments
 (0)