mirror of
https://gitlab.com/eql/lqml.git
synced 2025-12-06 02:30:38 -08:00
example 'meshtastic': organize qml files; small revisions
This commit is contained in:
parent
bf912d817a
commit
4b85f7e8e2
18 changed files with 53 additions and 48 deletions
|
|
@ -38,7 +38,7 @@ Rectangle {
|
|||
textFormat: Text.RichText
|
||||
text: "
|
||||
<h3>
|
||||
<img src='../img/radio.png' width=60 height=60>
|
||||
<img src='../../img/radio.png' width=60 height=60>
|
||||
<br>Radios
|
||||
</h3>
|
||||
<p>
|
||||
|
|
@ -46,7 +46,7 @@ If you use more than 1 radio, switch here to the radio you want to use.
|
|||
</p>
|
||||
%1
|
||||
<h3>
|
||||
<img src='../img/group.png' width=60 height=60>
|
||||
<img src='../../img/group.png' width=60 height=60>
|
||||
<br>Group
|
||||
</h3>
|
||||
<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.
|
||||
</p>
|
||||
<h3>
|
||||
<img src='../img/message.png' width=60 height=60>
|
||||
<img src='../../img/message.png' width=60 height=60>
|
||||
<br>Messages
|
||||
</h3>
|
||||
<p>
|
||||
|
|
@ -10,7 +10,7 @@ Rectangle {
|
|||
anchors.centerIn: parent
|
||||
width: 40
|
||||
fillMode: Image.PreserveAspectFit
|
||||
source: "../img/hourglass.png"
|
||||
source: "../../img/hourglass.png"
|
||||
}
|
||||
|
||||
Image {
|
||||
|
|
@ -18,7 +18,7 @@ Rectangle {
|
|||
anchors.centerIn: parent
|
||||
width: hourglass1.width
|
||||
fillMode: Image.PreserveAspectFit
|
||||
source: "../img/hourglass.png"
|
||||
source: "../../img/hourglass.png"
|
||||
opacity: 0
|
||||
}
|
||||
|
||||
|
|
@ -1,6 +1,9 @@
|
|||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import "." as Ext
|
||||
import "../group/" as Grp
|
||||
import "../messages/" as Msg
|
||||
import "../radios/" as Rad
|
||||
|
||||
Item {
|
||||
anchors.fill: parent
|
||||
|
|
@ -20,7 +23,7 @@ Item {
|
|||
|
||||
Ext.MainIcon {
|
||||
objectName: "group_icon"
|
||||
source: "../img/group.png"
|
||||
source: "../../img/group.png"
|
||||
|
||||
Rectangle {
|
||||
objectName: "unread_messages"
|
||||
|
|
@ -30,19 +33,19 @@ Item {
|
|||
anchors.top: parent.top
|
||||
anchors.margins: 7
|
||||
radius: width / 2
|
||||
color: "#ff5f57"
|
||||
color: "#ff4040"
|
||||
visible: false
|
||||
}
|
||||
}
|
||||
|
||||
Ext.MainIcon {
|
||||
objectName: "message_icon"
|
||||
source: "../img/message.png"
|
||||
source: "../../img/message.png"
|
||||
}
|
||||
|
||||
Ext.MainIcon {
|
||||
objectName: "radio_icon"
|
||||
source: "../img/radio.png"
|
||||
source: "../../img/radio.png"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -56,9 +59,9 @@ Item {
|
|||
currentIndex: 1
|
||||
interactive: false
|
||||
|
||||
Ext.Group { id: group }
|
||||
Ext.Messages {}
|
||||
Ext.Radios {}
|
||||
Grp.Group { id: group }
|
||||
Msg.Messages {}
|
||||
Rad.Radios {}
|
||||
|
||||
onCurrentIndexChanged: Lisp.call("app:view-index-changed", currentIndex)
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import "." as Ext
|
||||
import "." as Grp
|
||||
import "../common/" as Com
|
||||
|
||||
Rectangle {
|
||||
id: rect
|
||||
|
|
@ -11,7 +12,7 @@ Rectangle {
|
|||
padding: 9
|
||||
spacing: 9
|
||||
|
||||
Ext.ComboBox {
|
||||
Com.ComboBox {
|
||||
id: modem
|
||||
objectName: "modem"
|
||||
width: 160
|
||||
|
|
@ -156,7 +157,7 @@ Rectangle {
|
|||
anchors.centerIn: parent
|
||||
width: 20
|
||||
height: width
|
||||
source: "../img/broadcast.png"
|
||||
source: "../../img/broadcast.png"
|
||||
visible: (index === 0)
|
||||
}
|
||||
|
||||
|
|
@ -239,7 +240,7 @@ Rectangle {
|
|||
width: 22
|
||||
height: width
|
||||
radius: width / 2
|
||||
color: "#ff5f57"
|
||||
color: "#ff4040"
|
||||
visible: (model.unread > 0)
|
||||
|
||||
Text {
|
||||
|
|
@ -256,7 +257,7 @@ Rectangle {
|
|||
}
|
||||
}
|
||||
|
||||
Ext.Map {
|
||||
Grp.Map {
|
||||
objectName: "map_view"
|
||||
anchors.fill: rect
|
||||
visible: false
|
||||
|
|
@ -24,7 +24,7 @@ Item {
|
|||
id: hand
|
||||
objectName: "add_manual_marker"
|
||||
anchors.top: parent.top
|
||||
icon.source: "../img/hand.png"
|
||||
icon.source: "../../img/hand.png"
|
||||
visible: false
|
||||
|
||||
onClicked: {
|
||||
|
|
@ -43,7 +43,7 @@ Item {
|
|||
Ext.MapButton {
|
||||
objectName: "remove_marker"
|
||||
anchors.top: hand.bottom
|
||||
icon.source: "../img/remove-marker.png"
|
||||
icon.source: "../../img/remove-marker.png"
|
||||
|
||||
onClicked: {
|
||||
markers.itemAt(0).visible = false
|
||||
|
|
@ -16,7 +16,7 @@ Repeater {
|
|||
id: image
|
||||
width: 25
|
||||
height: width
|
||||
source: "../img/marker.png"
|
||||
source: "../../img/marker.png"
|
||||
|
||||
Rectangle {
|
||||
x: -(width - image.width) / 2
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import "." as Ext
|
||||
import "." as Msg
|
||||
|
||||
Rectangle {
|
||||
id: emojis
|
||||
|
|
@ -18,7 +18,7 @@ Rectangle {
|
|||
anchors.fill: parent
|
||||
spacing: 5
|
||||
|
||||
Ext.EmojiView {
|
||||
Msg.EmojiView {
|
||||
objectName: "recent_emojis"
|
||||
height: itemSize + 1
|
||||
ScrollBar.vertical.policy: ScrollBar.AlwaysOff
|
||||
|
|
@ -26,13 +26,13 @@ Rectangle {
|
|||
model: ["🙂","🤣","👍"]
|
||||
}
|
||||
|
||||
Ext.EmojiView {
|
||||
Msg.EmojiView {
|
||||
height: itemSize * 3 + 1
|
||||
|
||||
model: ["😃","😄","😁","😆","😅","😂","🤣","🥲","🥹","😊","😇","🙂","🙃","😉","😌","😍","🥰","😘","😗","😙","😚","😋","😛","😝","😜","🤪","🤨","🧐","🤓","😎","🥸","🤩","🥳","😏","😒","😞","😔","😟","😕","🙁","😣","😖","😫","😩","🥺","😢","😭","😮💨","😤","😠","😡","🤬","🤯","😳","🥵","🥶","😱","😨","😰","😥","😓","🫣","🤗","🫡","🤔","🫢","🤭","🤫","🤥","😶","😶🌫️","😐","😑","😬","🫨","🫠","🙄","😯","😦","😧","😮","😲","🥱","😴","🤤","😪","😵","😵💫","🫥","🤐","🥴","🤢","🤮","🤧","😷","🤒","🤕","🤑","🤠","😈","👿","👹","👺","🤡","💩","👻","💀","👽","👾","🤖","🎃","😺","😸","😹","😻","😼","😽","🙀","😿","😾"]
|
||||
}
|
||||
|
||||
Ext.EmojiView {
|
||||
Msg.EmojiView {
|
||||
height: itemSize * 3 + 1
|
||||
|
||||
model: ["👋","🤚","🖐","✋","🖖","👌","🤌","🤏","🤞","🫰","🤟","🤘","🤙","🫵","🫱","🫲","🫸","🫷","🫳","🫴","👈","👉","👆","🖕","👇","👍","👎","✊","👊","🤛","🤜","👏","🫶","🙌","👐","🤲","🤝","🙏","💅","🤳","💪","🦾","🦵","🦿","🦶","👣","👂","🦻","👃","🫀","🫁","🧠","🦷","🦴","👀","👁","👅","👄","🫦","💋","🩸"]
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import "." as Ext
|
||||
import "." as Msg
|
||||
|
||||
Rectangle {
|
||||
id: main
|
||||
|
|
@ -53,7 +53,7 @@ Rectangle {
|
|||
width: view.fontSize / 2 - 1
|
||||
height: width
|
||||
playing: false
|
||||
source: "../img/semaphore.gif"
|
||||
source: "../../img/semaphore.gif"
|
||||
currentFrame: model.ackState ? parseInt(model.ackState.substr(2), 16) : 0 // see 'qml:hex'
|
||||
visible: model.me
|
||||
}
|
||||
|
|
@ -127,7 +127,7 @@ Rectangle {
|
|||
anchors.centerIn: parent
|
||||
width: 12
|
||||
height: width
|
||||
source: "../img/delete.png"
|
||||
source: "../../img/delete.png"
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
|
|
@ -256,7 +256,7 @@ Rectangle {
|
|||
anchors.rightMargin: 7
|
||||
width: edit.font.pixelSize + 1
|
||||
height: width
|
||||
source: "../img/emoji.png"
|
||||
source: "../../img/emoji.png"
|
||||
opacity: 0.55
|
||||
visible: edit.focus && (Qt.platform.os !== "android") && (Qt.platform.os !== "ios")
|
||||
|
||||
|
|
@ -274,7 +274,7 @@ Rectangle {
|
|||
anchors.margins: 3
|
||||
width: 38
|
||||
height: width
|
||||
source: "../img/send.png"
|
||||
source: "../../img/send.png"
|
||||
visible: edit.focus && !edit.tooLong
|
||||
|
||||
MouseArea {
|
||||
|
|
@ -295,7 +295,7 @@ Rectangle {
|
|||
width: 38
|
||||
height: width
|
||||
opacity: 0.7
|
||||
source: "../img/broadcast.png"
|
||||
source: "../../img/broadcast.png"
|
||||
visible: send.visible && animation.running
|
||||
|
||||
SequentialAnimation {
|
||||
|
|
@ -320,7 +320,7 @@ Rectangle {
|
|||
}
|
||||
}
|
||||
|
||||
Ext.Emojis {
|
||||
Msg.Emojis {
|
||||
id: emojis
|
||||
anchors.bottom: rectEdit.top
|
||||
anchors.bottomMargin: -1
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import "." as Ext
|
||||
import "." as Rad
|
||||
import "../common/" as Com
|
||||
|
||||
Rectangle {
|
||||
id: rect
|
||||
|
|
@ -11,7 +12,7 @@ Rectangle {
|
|||
padding: 9
|
||||
spacing: 9
|
||||
|
||||
Ext.ComboBox {
|
||||
Com.ComboBox {
|
||||
id: region
|
||||
objectName: "region"
|
||||
width: 110
|
||||
|
|
@ -104,7 +105,7 @@ Rectangle {
|
|||
text: model.hwModel
|
||||
}
|
||||
|
||||
Ext.BatteryLevel {
|
||||
Rad.BatteryLevel {
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 14
|
||||
level: model.batteryLevel
|
||||
|
|
@ -2,7 +2,7 @@ import QtQuick 2.15
|
|||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Window 2.15
|
||||
import QtPositioning 5.15
|
||||
import "ext/" as Ext
|
||||
import "ext/common/" as Com
|
||||
import "ext/dialogs/" as Dlg
|
||||
|
||||
Item {
|
||||
|
|
@ -19,33 +19,33 @@ Item {
|
|||
show ? Qt.inputMethod.show() : Qt.inputMethod.hide()
|
||||
}
|
||||
|
||||
Ext.MainView { id: view }
|
||||
Com.MainView { id: view }
|
||||
|
||||
Ext.Menu {
|
||||
Com.Menu {
|
||||
id: menu
|
||||
objectName: "menu"
|
||||
|
||||
function show() { popup(0, headerHeight) }
|
||||
|
||||
Ext.MenuItem {
|
||||
Com.MenuItem {
|
||||
objectName: "help"
|
||||
text: qsTr("Help")
|
||||
onTriggered: help.active ? help.item.enabled = !help.item.enabled : help.active = true
|
||||
}
|
||||
|
||||
Ext.MenuItem {
|
||||
Com.MenuItem {
|
||||
text: qsTr("Channel name...")
|
||||
onTriggered: Lisp.call("lora:edit-channel-name")
|
||||
enabled: (view.currentIndex === 0)
|
||||
}
|
||||
|
||||
Ext.MenuItem {
|
||||
Com.MenuItem {
|
||||
text: qsTr("Update group/nodes")
|
||||
onTriggered: Lisp.call("lora:get-node-config")
|
||||
enabled: (view.currentIndex === 0)
|
||||
}
|
||||
|
||||
Ext.MenuItem {
|
||||
Com.MenuItem {
|
||||
text: qsTr("Message font size...")
|
||||
onTriggered: Lisp.call("msg:font-size-dialog")
|
||||
enabled: (view.currentIndex === 1)
|
||||
|
|
@ -53,7 +53,7 @@ Item {
|
|||
|
||||
MenuSeparator {}
|
||||
|
||||
Ext.MenuItem {
|
||||
Com.MenuItem {
|
||||
objectName: "share_location"
|
||||
text: qsTr("Share my location...")
|
||||
onTriggered: Lisp.call("loc:share-my-location")
|
||||
|
|
@ -61,18 +61,18 @@ Item {
|
|||
|
||||
MenuSeparator {}
|
||||
|
||||
Ext.MenuItem {
|
||||
Com.MenuItem {
|
||||
text: qsTr("Device filter...")
|
||||
onTriggered: Lisp.call("lora:edit-device-filter")
|
||||
enabled: (view.currentIndex === 2)
|
||||
}
|
||||
|
||||
Ext.MenuItem {
|
||||
Com.MenuItem {
|
||||
text: qsTr("Export DB (Lisp)")
|
||||
onTriggered: Lisp.call("db:export-to-list")
|
||||
}
|
||||
|
||||
Ext.MenuItem {
|
||||
Com.MenuItem {
|
||||
text: qsTr("Make backup")
|
||||
onTriggered: Lisp.call("app:make-backup")
|
||||
enabled: !mobile
|
||||
|
|
@ -119,7 +119,7 @@ Item {
|
|||
}
|
||||
}
|
||||
|
||||
Ext.Hourglass { // animation while loading app
|
||||
Com.Hourglass { // animation while loading app
|
||||
id: hourglass
|
||||
}
|
||||
|
||||
|
|
@ -164,7 +164,7 @@ Item {
|
|||
}
|
||||
}
|
||||
|
||||
Ext.Toast {}
|
||||
Com.Toast {}
|
||||
|
||||
Dlg.Dialogs {}
|
||||
|
||||
|
|
@ -173,7 +173,7 @@ Item {
|
|||
y: headerHeight
|
||||
width: parent.width
|
||||
height: parent.height - headerHeight
|
||||
source: "ext/Help.qml"
|
||||
source: "ext/common/Help.qml"
|
||||
active: false
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue