Skip to content

Commit

Permalink
fix: key navigation of markers. fixes #800 (#801)
Browse files Browse the repository at this point in the history
  • Loading branch information
zarath authored Feb 18, 2025
1 parent 664e5bd commit cc7c91d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
14 changes: 11 additions & 3 deletions debug.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
#!/bin/sh
export PYTHONPATH="src"
python3 -Xfrozen_modules=off -m debugpy --listen 5678 --wait-for-client "$@"
#!/bin/bash
# export PYTHONPATH="src"
export SRC=$(dirname $(realpath $0))/src
uv run python -Xfrozen_modules=off -m debugpy --listen 5678 --wait-for-client -c "
import sys
sys.path.insert(0, \"$SRC\")
import NanoVNASaver.__main__
NanoVNASaver.__main__.main()
"
1 change: 1 addition & 0 deletions src/NanoVNASaver/Charts/Frequency.py
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,7 @@ def copy(self):
return new_chart

def keyPressEvent(self, a0: QtGui.QKeyEvent) -> None:
logger.debug("Key pressed: %s", a0.key())
m = self.getActiveMarker()
if m is not None and a0.modifiers() == Qt.KeyboardModifier.NoModifier:
if a0.key() in [Qt.Key.Key_Down, Qt.Key.Key_Left]:
Expand Down
3 changes: 2 additions & 1 deletion src/NanoVNASaver/Marker/Widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@

class MarkerFrequencyInputWidget(FrequencyInputWidget):
def keyPressEvent(self, a0: QtGui.QKeyEvent) -> None:
logger.debug(f"keyPressEvent: {a0.key()}")
if a0.type() == QtGui.QKeyEvent.Type.KeyPress:
if a0.key() == QtCore.Qt.Key.Key_Up and self.nextFrequency != -1:
a0.accept()
Expand Down Expand Up @@ -113,7 +114,7 @@ def __init__(
if not self.name:
self.name = f"Marker {Marker._instances}"

self.frequencyInput = FrequencyInputWidget()
self.frequencyInput = MarkerFrequencyInputWidget()
self.frequencyInput.setMinimumHeight(20)
self.frequencyInput.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight)
self.frequencyInput.editingFinished.connect(
Expand Down

0 comments on commit cc7c91d

Please sign in to comment.