From 79b1f2eb549b865409562f0b7a278a4f6850f825 Mon Sep 17 00:00:00 2001 From: Patrick Boettcher
Date: Tue, 28 May 2024 16:31:15 +0200 Subject: [PATCH 1/2] edit-panel: make title bold, change name of group boxes Fixes #52 --- tscat_gui/edit.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tscat_gui/edit.py b/tscat_gui/edit.py index 763ee11..dbf92e2 100644 --- a/tscat_gui/edit.py +++ b/tscat_gui/edit.py @@ -272,7 +272,9 @@ class FixedAttributesGroupBox(AttributesGroupBox): def __init__(self, state: AppState, parent: Optional[QtWidgets.QWidget] = None): - super().__init__("Global", state, parent) + super().__init__("", state, parent) + + self.setStyleSheet("QGroupBox { font-weight: bold; }") def setup(self, entities: List[Union[tscat._Catalogue, tscat._Event]]) -> None: values: Dict[str, Any] = {} @@ -306,10 +308,12 @@ def create_label(self, text: str) -> EditableLabel: # type: ignore def __init__(self, state: AppState, parent: Optional[QtWidgets.QWidget] = None) -> None: - super().__init__("Custom", state, parent) + super().__init__("Custom fields", state, parent) self.all_attribute_names: List[str] = [] + self.setStyleSheet("QGroupBox { font-weight: bold; }") + def setup(self, entities: List[Union[tscat._Catalogue, tscat._Event]]) -> None: if len(entities) > 1: self.hide() @@ -394,6 +398,8 @@ def __init__(self, parent: Optional[QtWidgets.QWidget] = None): super().__init__("Catalogue(s) information", state, parent) + self.setStyleSheet("QGroupBox { font-weight: bold; }") + def setup(self, entities: List[Union[tscat._Catalogue, tscat._Event]]) -> None: catalogues = [entity for entity in entities if isinstance(entity, tscat._Catalogue)] From 3667284b131c14c016b3103541fae87e44638c76 Mon Sep 17 00:00:00 2001 From: Patrick Boettcher
Date: Tue, 28 May 2024 17:14:57 +0200 Subject: [PATCH 2/2] hide UUID field --- tscat_gui/edit.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tscat_gui/edit.py b/tscat_gui/edit.py index dbf92e2..3b4321d 100644 --- a/tscat_gui/edit.py +++ b/tscat_gui/edit.py @@ -219,6 +219,11 @@ def setup_values(self, values: Dict): self.values = values self.attribute_name_labels = {} for row, attr in enumerate(values.keys()): + + # special case for UUIDs - hide uuid-attribute + if attr == 'uuid': + continue + label = self.create_label(attr) self._layout.addWidget(label, row, 0) @@ -244,13 +249,9 @@ def setup_values(self, values: Dict): widget = cls(value, parent=self) - # special case for UUIDs - read-only - if attr == 'uuid': - widget.setEnabled(False) - else: - # the editingFinished-signal is not seen by mypy coming from PySide6 - widget.editingFinished.connect( # type: ignore - functools.partial(self._edit_finished_on_widget, widget, attr)) # type: ignore + # the editingFinished-signal is not seen by mypy coming from PySide6 + widget.editingFinished.connect( # type: ignore + functools.partial(self._edit_finished_on_widget, widget, attr)) # type: ignore self._layout.addWidget(widget, row, 1) def _edit_finished_on_widget(self, w: QtWidgets.QWidget, a: str) -> None: