example 'meshtastic': organize qml files; small revisions

This commit is contained in:
pls.153 2024-03-05 10:03:14 +01:00
parent bf912d817a
commit 4b85f7e8e2
18 changed files with 53 additions and 48 deletions

View file

@ -38,7 +38,7 @@ Rectangle {
textFormat: Text.RichText textFormat: Text.RichText
text: " text: "
<h3> <h3>
<img src='../img/radio.png' width=60 height=60> <img src='../../img/radio.png' width=60 height=60>
<br>Radios <br>Radios
</h3> </h3>
<p> <p>
@ -46,7 +46,7 @@ If you use more than 1 radio, switch here to the radio you want to use.
</p> </p>
%1 %1
<h3> <h3>
<img src='../img/group.png' width=60 height=60> <img src='../../img/group.png' width=60 height=60>
<br>Group <br>Group
</h3> </h3>
<p> <p>
@ -68,7 +68,7 @@ A tap on the location item on the right shows a map with all known positions of
To set your location manually, see 'hand' button (top right). This will override any eventually received GPS location. To set your location manually, see 'hand' button (top right). This will override any eventually received GPS location.
</p> </p>
<h3> <h3>
<img src='../img/message.png' width=60 height=60> <img src='../../img/message.png' width=60 height=60>
<br>Messages <br>Messages
</h3> </h3>
<p> <p>

View file

@ -10,7 +10,7 @@ Rectangle {
anchors.centerIn: parent anchors.centerIn: parent
width: 40 width: 40
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
source: "../img/hourglass.png" source: "../../img/hourglass.png"
} }
Image { Image {
@ -18,7 +18,7 @@ Rectangle {
anchors.centerIn: parent anchors.centerIn: parent
width: hourglass1.width width: hourglass1.width
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
source: "../img/hourglass.png" source: "../../img/hourglass.png"
opacity: 0 opacity: 0
} }

View file

@ -1,6 +1,9 @@
import QtQuick 2.15 import QtQuick 2.15
import QtQuick.Controls 2.15 import QtQuick.Controls 2.15
import "." as Ext import "." as Ext
import "../group/" as Grp
import "../messages/" as Msg
import "../radios/" as Rad
Item { Item {
anchors.fill: parent anchors.fill: parent
@ -20,7 +23,7 @@ Item {
Ext.MainIcon { Ext.MainIcon {
objectName: "group_icon" objectName: "group_icon"
source: "../img/group.png" source: "../../img/group.png"
Rectangle { Rectangle {
objectName: "unread_messages" objectName: "unread_messages"
@ -30,19 +33,19 @@ Item {
anchors.top: parent.top anchors.top: parent.top
anchors.margins: 7 anchors.margins: 7
radius: width / 2 radius: width / 2
color: "#ff5f57" color: "#ff4040"
visible: false visible: false
} }
} }
Ext.MainIcon { Ext.MainIcon {
objectName: "message_icon" objectName: "message_icon"
source: "../img/message.png" source: "../../img/message.png"
} }
Ext.MainIcon { Ext.MainIcon {
objectName: "radio_icon" objectName: "radio_icon"
source: "../img/radio.png" source: "../../img/radio.png"
} }
} }
} }
@ -56,9 +59,9 @@ Item {
currentIndex: 1 currentIndex: 1
interactive: false interactive: false
Ext.Group { id: group } Grp.Group { id: group }
Ext.Messages {} Msg.Messages {}
Ext.Radios {} Rad.Radios {}
onCurrentIndexChanged: Lisp.call("app:view-index-changed", currentIndex) onCurrentIndexChanged: Lisp.call("app:view-index-changed", currentIndex)
} }

View file

@ -1,6 +1,7 @@
import QtQuick 2.15 import QtQuick 2.15
import QtQuick.Controls 2.15 import QtQuick.Controls 2.15
import "." as Ext import "." as Grp
import "../common/" as Com
Rectangle { Rectangle {
id: rect id: rect
@ -11,7 +12,7 @@ Rectangle {
padding: 9 padding: 9
spacing: 9 spacing: 9
Ext.ComboBox { Com.ComboBox {
id: modem id: modem
objectName: "modem" objectName: "modem"
width: 160 width: 160
@ -156,7 +157,7 @@ Rectangle {
anchors.centerIn: parent anchors.centerIn: parent
width: 20 width: 20
height: width height: width
source: "../img/broadcast.png" source: "../../img/broadcast.png"
visible: (index === 0) visible: (index === 0)
} }
@ -239,7 +240,7 @@ Rectangle {
width: 22 width: 22
height: width height: width
radius: width / 2 radius: width / 2
color: "#ff5f57" color: "#ff4040"
visible: (model.unread > 0) visible: (model.unread > 0)
Text { Text {
@ -256,7 +257,7 @@ Rectangle {
} }
} }
Ext.Map { Grp.Map {
objectName: "map_view" objectName: "map_view"
anchors.fill: rect anchors.fill: rect
visible: false visible: false

View file

@ -24,7 +24,7 @@ Item {
id: hand id: hand
objectName: "add_manual_marker" objectName: "add_manual_marker"
anchors.top: parent.top anchors.top: parent.top
icon.source: "../img/hand.png" icon.source: "../../img/hand.png"
visible: false visible: false
onClicked: { onClicked: {
@ -43,7 +43,7 @@ Item {
Ext.MapButton { Ext.MapButton {
objectName: "remove_marker" objectName: "remove_marker"
anchors.top: hand.bottom anchors.top: hand.bottom
icon.source: "../img/remove-marker.png" icon.source: "../../img/remove-marker.png"
onClicked: { onClicked: {
markers.itemAt(0).visible = false markers.itemAt(0).visible = false

View file

@ -16,7 +16,7 @@ Repeater {
id: image id: image
width: 25 width: 25
height: width height: width
source: "../img/marker.png" source: "../../img/marker.png"
Rectangle { Rectangle {
x: -(width - image.width) / 2 x: -(width - image.width) / 2

View file

@ -1,6 +1,6 @@
import QtQuick 2.15 import QtQuick 2.15
import QtQuick.Controls 2.15 import QtQuick.Controls 2.15
import "." as Ext import "." as Msg
Rectangle { Rectangle {
id: emojis id: emojis
@ -18,7 +18,7 @@ Rectangle {
anchors.fill: parent anchors.fill: parent
spacing: 5 spacing: 5
Ext.EmojiView { Msg.EmojiView {
objectName: "recent_emojis" objectName: "recent_emojis"
height: itemSize + 1 height: itemSize + 1
ScrollBar.vertical.policy: ScrollBar.AlwaysOff ScrollBar.vertical.policy: ScrollBar.AlwaysOff
@ -26,13 +26,13 @@ Rectangle {
model: ["🙂","🤣","👍"] model: ["🙂","🤣","👍"]
} }
Ext.EmojiView { Msg.EmojiView {
height: itemSize * 3 + 1 height: itemSize * 3 + 1
model: ["😃","😄","😁","😆","😅","😂","🤣","🥲","🥹","😊","😇","🙂","🙃","😉","😌","😍","🥰","😘","😗","😙","😚","😋","😛","😝","😜","🤪","🤨","🧐","🤓","😎","🥸","🤩","🥳","😏","😒","😞","😔","😟","😕","🙁","😣","😖","😫","😩","🥺","😢","😭","😮‍💨","😤","😠","😡","🤬","🤯","😳","🥵","🥶","😱","😨","😰","😥","😓","🫣","🤗","🫡","🤔","🫢","🤭","🤫","🤥","😶","😶‍🌫️","😐","😑","😬","🫨","🫠","🙄","😯","😦","😧","😮","😲","🥱","😴","🤤","😪","😵","😵‍💫","🫥","🤐","🥴","🤢","🤮","🤧","😷","🤒","🤕","🤑","🤠","😈","👿","👹","👺","🤡","💩","👻","💀","👽","👾","🤖","🎃","😺","😸","😹","😻","😼","😽","🙀","😿","😾"] model: ["😃","😄","😁","😆","😅","😂","🤣","🥲","🥹","😊","😇","🙂","🙃","😉","😌","😍","🥰","😘","😗","😙","😚","😋","😛","😝","😜","🤪","🤨","🧐","🤓","😎","🥸","🤩","🥳","😏","😒","😞","😔","😟","😕","🙁","😣","😖","😫","😩","🥺","😢","😭","😮‍💨","😤","😠","😡","🤬","🤯","😳","🥵","🥶","😱","😨","😰","😥","😓","🫣","🤗","🫡","🤔","🫢","🤭","🤫","🤥","😶","😶‍🌫️","😐","😑","😬","🫨","🫠","🙄","😯","😦","😧","😮","😲","🥱","😴","🤤","😪","😵","😵‍💫","🫥","🤐","🥴","🤢","🤮","🤧","😷","🤒","🤕","🤑","🤠","😈","👿","👹","👺","🤡","💩","👻","💀","👽","👾","🤖","🎃","😺","😸","😹","😻","😼","😽","🙀","😿","😾"]
} }
Ext.EmojiView { Msg.EmojiView {
height: itemSize * 3 + 1 height: itemSize * 3 + 1
model: ["👋","🤚","🖐","✋","🖖","👌","🤌","🤏","🤞","🫰","🤟","🤘","🤙","🫵","🫱","🫲","🫸","🫷","🫳","🫴","👈","👉","👆","🖕","👇","👍","👎","✊","👊","🤛","🤜","👏","🫶","🙌","👐","🤲","🤝","🙏","💅","🤳","💪","🦾","🦵","🦿","🦶","👣","👂","🦻","👃","🫀","🫁","🧠","🦷","🦴","👀","👁","👅","👄","🫦","💋","🩸"] model: ["👋","🤚","🖐","✋","🖖","👌","🤌","🤏","🤞","🫰","🤟","🤘","🤙","🫵","🫱","🫲","🫸","🫷","🫳","🫴","👈","👉","👆","🖕","👇","👍","👎","✊","👊","🤛","🤜","👏","🫶","🙌","👐","🤲","🤝","🙏","💅","🤳","💪","🦾","🦵","🦿","🦶","👣","👂","🦻","👃","🫀","🫁","🧠","🦷","🦴","👀","👁","👅","👄","🫦","💋","🩸"]

View file

@ -1,6 +1,6 @@
import QtQuick 2.15 import QtQuick 2.15
import QtQuick.Controls 2.15 import QtQuick.Controls 2.15
import "." as Ext import "." as Msg
Rectangle { Rectangle {
id: main id: main
@ -53,7 +53,7 @@ Rectangle {
width: view.fontSize / 2 - 1 width: view.fontSize / 2 - 1
height: width height: width
playing: false playing: false
source: "../img/semaphore.gif" source: "../../img/semaphore.gif"
currentFrame: model.ackState ? parseInt(model.ackState.substr(2), 16) : 0 // see 'qml:hex' currentFrame: model.ackState ? parseInt(model.ackState.substr(2), 16) : 0 // see 'qml:hex'
visible: model.me visible: model.me
} }
@ -127,7 +127,7 @@ Rectangle {
anchors.centerIn: parent anchors.centerIn: parent
width: 12 width: 12
height: width height: width
source: "../img/delete.png" source: "../../img/delete.png"
} }
MouseArea { MouseArea {
@ -256,7 +256,7 @@ Rectangle {
anchors.rightMargin: 7 anchors.rightMargin: 7
width: edit.font.pixelSize + 1 width: edit.font.pixelSize + 1
height: width height: width
source: "../img/emoji.png" source: "../../img/emoji.png"
opacity: 0.55 opacity: 0.55
visible: edit.focus && (Qt.platform.os !== "android") && (Qt.platform.os !== "ios") visible: edit.focus && (Qt.platform.os !== "android") && (Qt.platform.os !== "ios")
@ -274,7 +274,7 @@ Rectangle {
anchors.margins: 3 anchors.margins: 3
width: 38 width: 38
height: width height: width
source: "../img/send.png" source: "../../img/send.png"
visible: edit.focus && !edit.tooLong visible: edit.focus && !edit.tooLong
MouseArea { MouseArea {
@ -295,7 +295,7 @@ Rectangle {
width: 38 width: 38
height: width height: width
opacity: 0.7 opacity: 0.7
source: "../img/broadcast.png" source: "../../img/broadcast.png"
visible: send.visible && animation.running visible: send.visible && animation.running
SequentialAnimation { SequentialAnimation {
@ -320,7 +320,7 @@ Rectangle {
} }
} }
Ext.Emojis { Msg.Emojis {
id: emojis id: emojis
anchors.bottom: rectEdit.top anchors.bottom: rectEdit.top
anchors.bottomMargin: -1 anchors.bottomMargin: -1

View file

@ -1,6 +1,7 @@
import QtQuick 2.15 import QtQuick 2.15
import QtQuick.Controls 2.15 import QtQuick.Controls 2.15
import "." as Ext import "." as Rad
import "../common/" as Com
Rectangle { Rectangle {
id: rect id: rect
@ -11,7 +12,7 @@ Rectangle {
padding: 9 padding: 9
spacing: 9 spacing: 9
Ext.ComboBox { Com.ComboBox {
id: region id: region
objectName: "region" objectName: "region"
width: 110 width: 110
@ -104,7 +105,7 @@ Rectangle {
text: model.hwModel text: model.hwModel
} }
Ext.BatteryLevel { Rad.BatteryLevel {
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: 14 anchors.rightMargin: 14
level: model.batteryLevel level: model.batteryLevel

View file

@ -2,7 +2,7 @@ import QtQuick 2.15
import QtQuick.Controls 2.15 import QtQuick.Controls 2.15
import QtQuick.Window 2.15 import QtQuick.Window 2.15
import QtPositioning 5.15 import QtPositioning 5.15
import "ext/" as Ext import "ext/common/" as Com
import "ext/dialogs/" as Dlg import "ext/dialogs/" as Dlg
Item { Item {
@ -19,33 +19,33 @@ Item {
show ? Qt.inputMethod.show() : Qt.inputMethod.hide() show ? Qt.inputMethod.show() : Qt.inputMethod.hide()
} }
Ext.MainView { id: view } Com.MainView { id: view }
Ext.Menu { Com.Menu {
id: menu id: menu
objectName: "menu" objectName: "menu"
function show() { popup(0, headerHeight) } function show() { popup(0, headerHeight) }
Ext.MenuItem { Com.MenuItem {
objectName: "help" objectName: "help"
text: qsTr("Help") text: qsTr("Help")
onTriggered: help.active ? help.item.enabled = !help.item.enabled : help.active = true onTriggered: help.active ? help.item.enabled = !help.item.enabled : help.active = true
} }
Ext.MenuItem { Com.MenuItem {
text: qsTr("Channel name...") text: qsTr("Channel name...")
onTriggered: Lisp.call("lora:edit-channel-name") onTriggered: Lisp.call("lora:edit-channel-name")
enabled: (view.currentIndex === 0) enabled: (view.currentIndex === 0)
} }
Ext.MenuItem { Com.MenuItem {
text: qsTr("Update group/nodes") text: qsTr("Update group/nodes")
onTriggered: Lisp.call("lora:get-node-config") onTriggered: Lisp.call("lora:get-node-config")
enabled: (view.currentIndex === 0) enabled: (view.currentIndex === 0)
} }
Ext.MenuItem { Com.MenuItem {
text: qsTr("Message font size...") text: qsTr("Message font size...")
onTriggered: Lisp.call("msg:font-size-dialog") onTriggered: Lisp.call("msg:font-size-dialog")
enabled: (view.currentIndex === 1) enabled: (view.currentIndex === 1)
@ -53,7 +53,7 @@ Item {
MenuSeparator {} MenuSeparator {}
Ext.MenuItem { Com.MenuItem {
objectName: "share_location" objectName: "share_location"
text: qsTr("Share my location...") text: qsTr("Share my location...")
onTriggered: Lisp.call("loc:share-my-location") onTriggered: Lisp.call("loc:share-my-location")
@ -61,18 +61,18 @@ Item {
MenuSeparator {} MenuSeparator {}
Ext.MenuItem { Com.MenuItem {
text: qsTr("Device filter...") text: qsTr("Device filter...")
onTriggered: Lisp.call("lora:edit-device-filter") onTriggered: Lisp.call("lora:edit-device-filter")
enabled: (view.currentIndex === 2) enabled: (view.currentIndex === 2)
} }
Ext.MenuItem { Com.MenuItem {
text: qsTr("Export DB (Lisp)") text: qsTr("Export DB (Lisp)")
onTriggered: Lisp.call("db:export-to-list") onTriggered: Lisp.call("db:export-to-list")
} }
Ext.MenuItem { Com.MenuItem {
text: qsTr("Make backup") text: qsTr("Make backup")
onTriggered: Lisp.call("app:make-backup") onTriggered: Lisp.call("app:make-backup")
enabled: !mobile enabled: !mobile
@ -119,7 +119,7 @@ Item {
} }
} }
Ext.Hourglass { // animation while loading app Com.Hourglass { // animation while loading app
id: hourglass id: hourglass
} }
@ -164,7 +164,7 @@ Item {
} }
} }
Ext.Toast {} Com.Toast {}
Dlg.Dialogs {} Dlg.Dialogs {}
@ -173,7 +173,7 @@ Item {
y: headerHeight y: headerHeight
width: parent.width width: parent.width
height: parent.height - headerHeight height: parent.height - headerHeight
source: "ext/Help.qml" source: "ext/common/Help.qml"
active: false active: false
} }