Polish GUI design
This commit is contained in:
@@ -10,7 +10,7 @@ import math
|
||||
from pathlib import Path
|
||||
|
||||
from PyQt6.QtCore import QSignalBlocker
|
||||
from PyQt6.QtWidgets import QCheckBox, QComboBox, QDoubleSpinBox, QSpinBox
|
||||
from PyQt6.QtWidgets import QCheckBox, QComboBox, QDoubleSpinBox, QFormLayout, QLabel, QSpinBox
|
||||
|
||||
from python_app.storage.npz.paths import radar_config_filename_prefix
|
||||
from python_app.gui.antenna_geometry_editor import AntennaGeometryEditor
|
||||
@@ -300,7 +300,18 @@ class ConfigController:
|
||||
def web_schema(self) -> list[dict[str, object]]:
|
||||
schema = []
|
||||
for name, (group, widget) in self._web_widgets(str(self._scalar("_processing_mode"))).items():
|
||||
entry: dict[str, object] = {"name": name, "group": group, "enabled": widget.isEnabled(), "value": _read_widget(widget)}
|
||||
if isinstance(widget, QCheckBox):
|
||||
label = widget.text()
|
||||
else:
|
||||
parent = widget.parentWidget()
|
||||
assert parent is not None
|
||||
form = parent.layout()
|
||||
assert isinstance(form, QFormLayout)
|
||||
caption = form.labelForField(widget)
|
||||
assert isinstance(caption, QLabel)
|
||||
label = caption.text()
|
||||
entry: dict[str, object] = {"name": name, "label": label, "group": group,
|
||||
"enabled": widget.isEnabled(), "value": _read_widget(widget)}
|
||||
if isinstance(widget, QComboBox):
|
||||
entry.update(kind="select", options=[widget.itemText(i) for i in range(widget.count())])
|
||||
elif isinstance(widget, QCheckBox):
|
||||
@@ -370,6 +381,5 @@ class ConfigController:
|
||||
raise
|
||||
|
||||
def mode_summary(self, mode: str) -> str:
|
||||
values = (f"{binding.spec.web}={self._scalar(binding.spec.widget)}"
|
||||
for binding in active_web_fields(mode) if binding.spec.web != "processor_mode")
|
||||
return "(" + ", ".join(values) + ")"
|
||||
return ", ".join(f"{binding.spec.web}={self._scalar(binding.spec.widget)}"
|
||||
for binding in active_web_fields(mode) if binding.spec.web != "processor_mode")
|
||||
|
||||
Reference in New Issue
Block a user