Only show pos nav on non-zero size

history_view
Tyler Goodlet 2022-09-19 16:05:18 -04:00
parent 7c6d12d982
commit c0d490ed63
2 changed files with 14 additions and 5 deletions

View File

@ -141,7 +141,7 @@ class LineEditor(Struct):
except KeyError: except KeyError:
# when the current cursor doesn't have said line # when the current cursor doesn't have said line
# registered (probably means that user held order mode # registered (probably means that user held order mode
# key while panning to another vieww) then we just # key while panning to another view) then we just
# ignore the remove error. # ignore the remove error.
pass pass
line.delete() line.delete()

View File

@ -217,8 +217,17 @@ async def handle_viewmode_kb_inputs(
if order_keys_pressed: if order_keys_pressed:
# show the pp size label # TODO: it seems like maybe the composition should be
order_mode.current_pp.nav.show() # reversed here? Like, maybe we should have the nav have
# access to the pos state and then make encapsulated logic
# that shows the right stuff on screen instead or order mode
# and position-related abstractions doing this?
# show the pp size label only if there is
# a non-zero pos existing
tracker = order_mode.current_pp
if tracker.live_pp.size:
tracker.nav.show()
# TODO: show pp config mini-params in status bar widget # TODO: show pp config mini-params in status bar widget
# mode.pp_config.show() # mode.pp_config.show()
@ -259,8 +268,8 @@ async def handle_viewmode_kb_inputs(
Qt.Key_S in pressed or Qt.Key_S in pressed or
order_keys_pressed or order_keys_pressed or
Qt.Key_O in pressed Qt.Key_O in pressed
) and )
key in NUMBER_LINE and key in NUMBER_LINE
): ):
# hot key to set order slots size. # hot key to set order slots size.
# change edit field to current number line value, # change edit field to current number line value,