Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

edit-panel: make title bold, change name of group boxes #94

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 16 additions & 9 deletions tscat_gui/edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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:
Expand All @@ -272,7 +273,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] = {}
Expand Down Expand Up @@ -306,10 +309,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()
Expand Down Expand Up @@ -394,6 +399,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)]
Expand Down
Loading