Skip to content

Commit

Permalink
fix batch, move stop button, add search and filter term show, fix aut…
Browse files Browse the repository at this point in the history
…oscroll, add missing guide cursors
  • Loading branch information
nomionz committed Mar 18, 2024
1 parent 1132416 commit 5bfdd39
Show file tree
Hide file tree
Showing 11 changed files with 65 additions and 44 deletions.
Binary file modified resources/icons/undo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/deviceInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public slots:

while (!in.atEnd()) {
this->sendCommand(in.readLine());
QThread::msleep(150);
QThread::msleep(200);
}
_file.close();
}
Expand Down
3 changes: 1 addition & 2 deletions views/AppNotification.qml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ Item {
}

onVisibleChanged: {
if (visible)
timer.running = true
timer.running = visible
}
}
}
1 change: 1 addition & 0 deletions views/BluetoothPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Item {

Connections {
target: toolPanel

function onDisconnectClicked() {
loadingIndicator.open()
bluetooth.disconnect()
Expand Down
2 changes: 0 additions & 2 deletions views/BluetoothWelcome.qml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ Item {
}

function onConnectClicked() {

console.log("Connect clicked")
if (!_root.isBtOn())
return

Expand Down
12 changes: 5 additions & 7 deletions views/BtDeviceInfo.qml
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,16 @@ Item {
}

function chooseIcon(rssi) {
let res = AppSettings.signalIcon

if (rssi <= -90)
res = AppSettings.weakSignalIcon
return AppSettings.weakSignalIcon
else if (rssi <= -67)
res = AppSettings.okaySignalIcon
return AppSettings.okaySignalIcon
else if (rssi <= -55)
res = AppSettings.goodSignalIcon
return AppSettings.goodSignalIcon
else if (rssi <= -30)
res = AppSettings.bestSignalIcon
return AppSettings.bestSignalIcon

return res
return AppSettings.signalIcon
}

MouseArea {
Expand Down
25 changes: 12 additions & 13 deletions views/DeviceLog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Rectangle {
if (pattern === "")
return

if (textView.mode === "search") {
if (textView.mode === "Search") {
textView.searchFor(pattern)
textView.deselectOnPress = false
textView.nextMatch()
Expand Down Expand Up @@ -119,17 +119,15 @@ Rectangle {

TextView {
id: textView
property string mode: "search"

height: parent.height - placeholderText.height - textInput.height - 20
property string mode: "Search"

anchors {
left: parent.left
right: parent.right
top: placeholderText.bottom
topMargin: 5
topMargin: 3
bottom: textInput.top
bottomMargin: 10
bottomMargin: 5
}

Keys.onPressed: function (event) {
Expand All @@ -156,7 +154,7 @@ Rectangle {
}

Rectangle {
id: stopMessage
id: guideMessage

visible: !textInput.visible

Expand All @@ -172,8 +170,7 @@ Rectangle {
color: Material.background

TextLabel {
id: guideMessage
textValue: "Click STOP to stop " + textView.mode + "ing"
textValue: textView.mode + "ing for: " + textView.searchTerm
bindFocusTo: true
}
}
Expand All @@ -194,7 +191,7 @@ Rectangle {
}
leftPadding: 40 // so the text not overlaps with the search icon

placeholderText: textView.mode === "search" ? "Type to search..." : "Type to filter..."
placeholderText: textView.mode === "Search" ? "Type to search..." : "Type to filter..."

background: Rectangle {
implicitHeight: Material.textFieldHeight
Expand Down Expand Up @@ -254,6 +251,7 @@ Rectangle {
height: parent.height
width: 40
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
_root.filterOrSearch()
}
Expand All @@ -265,13 +263,14 @@ Rectangle {
height: parent.height
width: parent.leftPadding
hoverEnabled: true
cursorShape: Qt.PointingHandCursor

onClicked: {
if (textView.mode === "search") {
textView.mode = "filter"
if (textView.mode === "Search") {
textView.mode = "Filter"
modeImage.source = AppSettings.filterIcon
} else {
textView.mode = "search"
textView.mode = "Search"
modeImage.source = AppSettings.searchIcon
}
}
Expand Down
7 changes: 3 additions & 4 deletions views/InteractiveShell.qml
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,13 @@ Rectangle {

TextView {
id: textView

anchors {
left: parent.left
right: parent.right
top: placeholderText.bottom
topMargin: 5
topMargin: 3
bottom: textInput.top
bottomMargin: 10
bottomMargin: 5
}

Connections {
Expand Down Expand Up @@ -114,7 +113,6 @@ Rectangle {

height: 45
anchors {
// topMargin: 10
bottom: parent.bottom
bottomMargin: 2
right: parent.right
Expand Down Expand Up @@ -178,6 +176,7 @@ Rectangle {
MouseArea {
id: mouseArea
anchors.right: parent.right
cursorShape: Qt.PointingHandCursor
height: parent.height
width: 40
hoverEnabled: true
Expand Down
25 changes: 24 additions & 1 deletion views/SideButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Rectangle {
}

Column {
visible: _root.iconSource !== ""
anchors.centerIn: parent
spacing: 5

Expand Down Expand Up @@ -77,14 +78,36 @@ Rectangle {
}
}

// if no icon then center text
Text {
id: textItemCenter
anchors.centerIn: parent
visible: _root.textContent !== "" && _root.iconSource === ""
text: _root.textContent
font.family: labelFont.name
font.pixelSize: 12
property color textColor: AppSettings.whiteColor
color: textColor
width: parent.width
horizontalAlignment: Text.AlignHCenter

// text color transition animation on click detected in MouseArea
Behavior on textColor {
ColorAnimation {
duration: 200
easing.type: Easing.InOutQuad
}
}
}

Rectangle {
id: leftBorder
visible: _root.checked
width: 3
height: 0
anchors.bottom: _root.bottom

color: Material.accent

Behavior on height {
PropertyAnimation {
duration: 350
Expand Down
8 changes: 6 additions & 2 deletions views/TextView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ Item {
property alias listView: view
property bool deselectOnPress: true
property bool searching: false
property string searchTerm: ""

signal newItemArrived
signal scrollDetected
signal noMatchesFound
signal matchesFound

function scrollToBottom() {
view.positionViewAtEnd()
Qt.callLater(view.positionViewAtEnd)
}

function togglePause() {
Expand All @@ -42,6 +43,7 @@ Item {
}

function searchFor(term) {
searchTerm = term
view.searchTermLength = term.length
messagesModel.searchAndHighlight(term)
searching = true
Expand Down Expand Up @@ -83,6 +85,7 @@ Item {

function filterFor(term) {
messagesModel.filterFor(term)
searchTerm = term
}

// Shortcuts for manual scrolling
Expand Down Expand Up @@ -124,6 +127,7 @@ Item {
noMatchesFound()
searching = false
view.searchTermLength = 0
searchTerm = ""
}
}
}
Expand Down Expand Up @@ -173,7 +177,7 @@ Item {
}

if (view.autoScroll) {
view.positionViewAtEnd()
_root.scrollToBottom()
}

newItemArrived()
Expand Down
24 changes: 12 additions & 12 deletions views/ToolPanel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -180,17 +180,6 @@ Rectangle {
}
}

ToolButton {
id: undo
iconSource: AppSettings.undoIcon
textContent: "STOP"
borderHighlight: true
visibleOnInit: false
onButtonClicked: {
undoClicked()
}
}

ToolButton {
id: browse
iconSource: AppSettings.folderIcon
Expand Down Expand Up @@ -264,7 +253,7 @@ Rectangle {
textContent: "BATCH"
iconSource: AppSettings.batchIcon
onButtonClicked: {
buttonClicked()
batchCliClicked()
}
}

Expand Down Expand Up @@ -330,6 +319,17 @@ Rectangle {
}
}

ToolButton {
id: undo
height: logFile.height / 2
textContent: "STOP"
borderHighlight: true
visibleOnInit: false
onButtonClicked: {
undoClicked()
}
}

ToolButton {
id: down
visibleOnInit: false
Expand Down

0 comments on commit 5bfdd39

Please sign in to comment.