Add mode name setter
parent
97f4d9bc2d
commit
00ff0e96cd
|
@ -165,7 +165,7 @@ class MainWindow(QtGui.QMainWindow):
|
||||||
|
|
||||||
self._status_label = label = QtGui.QLabel()
|
self._status_label = label = QtGui.QLabel()
|
||||||
label.setStyleSheet(
|
label.setStyleSheet(
|
||||||
f"QLabel {{ color : {hcolor('gunmetal')}; }}"
|
f"QLabel {{ color : {hcolor('papas_special')}; }}"
|
||||||
)
|
)
|
||||||
label.setTextFormat(3) # markdown
|
label.setTextFormat(3) # markdown
|
||||||
label.setFont(_font_small.font)
|
label.setFont(_font_small.font)
|
||||||
|
@ -186,6 +186,8 @@ class MainWindow(QtGui.QMainWindow):
|
||||||
"""Cancel the root actor asap.
|
"""Cancel the root actor asap.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
# TODO: instead kill the root tractor nursery?
|
||||||
|
|
||||||
# raising KBI seems to get intercepted by by Qt so just use the system.
|
# raising KBI seems to get intercepted by by Qt so just use the system.
|
||||||
os.kill(os.getpid(), signal.SIGINT)
|
os.kill(os.getpid(), signal.SIGINT)
|
||||||
|
|
||||||
|
@ -209,10 +211,20 @@ class MainWindow(QtGui.QMainWindow):
|
||||||
|
|
||||||
return self._status_bar
|
return self._status_bar
|
||||||
|
|
||||||
|
def set_mode_name(
|
||||||
|
self,
|
||||||
|
name: str,
|
||||||
|
|
||||||
|
) -> None:
|
||||||
|
|
||||||
|
self.mode_label.setText(f'mode:{name}')
|
||||||
|
|
||||||
def on_focus_change(
|
def on_focus_change(
|
||||||
self,
|
self,
|
||||||
|
|
||||||
old: QtGui.QWidget,
|
old: QtGui.QWidget,
|
||||||
new: QtGui.QWidget,
|
new: QtGui.QWidget,
|
||||||
|
|
||||||
) -> None:
|
) -> None:
|
||||||
|
|
||||||
log.debug(f'widget focus changed from {old} -> {new}')
|
log.debug(f'widget focus changed from {old} -> {new}')
|
||||||
|
@ -220,7 +232,7 @@ class MainWindow(QtGui.QMainWindow):
|
||||||
if new is not None:
|
if new is not None:
|
||||||
# cursor left window?
|
# cursor left window?
|
||||||
name = getattr(new, 'mode_name', '')
|
name = getattr(new, 'mode_name', '')
|
||||||
self.mode_label.setText(name)
|
self.set_mode_name(name)
|
||||||
|
|
||||||
def current_screen(self) -> QtGui.QScreen:
|
def current_screen(self) -> QtGui.QScreen:
|
||||||
"""Get a frickin screen (if we can, gawd).
|
"""Get a frickin screen (if we can, gawd).
|
||||||
|
|
Loading…
Reference in New Issue