diff --git a/MANIFEST.in b/MANIFEST.in index e3ecce0..fdaa0f0 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -3,6 +3,7 @@ include README.md include .napari-hub/DESCRIPTION.md include .napari-hub/config.yml include brainrender_napari/napari.yaml +include brainrender_napari/resources/brainglobe.png exclude .pre-commit-config.yaml recursive-exclude * __pycache__ diff --git a/brainrender_napari/brainrender_widget.py b/brainrender_napari/brainrender_widget.py index 138afd6..b2e8348 100644 --- a/brainrender_napari/brainrender_widget.py +++ b/brainrender_napari/brainrender_widget.py @@ -20,6 +20,7 @@ from brainrender_napari.napari_atlas_representation import ( NapariAtlasRepresentation, ) +from brainrender_napari.utils.brainglobe_logo import header_widget from brainrender_napari.widgets.atlas_table_view import AtlasTableView from brainrender_napari.widgets.structure_view import StructureView @@ -39,6 +40,7 @@ def __init__(self, napari_viewer: Viewer): self._viewer = napari_viewer self.setLayout(QVBoxLayout()) + self.layout().addWidget(header_widget()) # create widgets self.atlas_table_view = AtlasTableView(parent=self) diff --git a/brainrender_napari/resources/brainglobe.png b/brainrender_napari/resources/brainglobe.png new file mode 100644 index 0000000..427bdab Binary files /dev/null and b/brainrender_napari/resources/brainglobe.png differ diff --git a/brainrender_napari/utils/__init__.py b/brainrender_napari/utils/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/brainrender_napari/utils/brainglobe_logo.py b/brainrender_napari/utils/brainglobe_logo.py new file mode 100644 index 0000000..9705303 --- /dev/null +++ b/brainrender_napari/utils/brainglobe_logo.py @@ -0,0 +1,44 @@ +from importlib.resources import files + +from qtpy.QtWidgets import QGroupBox, QHBoxLayout, QLabel, QWidget + +brainglobe_logo = files("brainrender_napari").joinpath( + "resources/brainglobe.png" +) + +_logo_html = f""" +
brainrender
+<\h1> +""" + +_docs_links_html = """ +Atlas visualisation
+ + + + +For help, hover the cursor over the atlases/regions. + +""" # noqa: E501 + + +def _docs_links_widget(): + docs_links_widget = QLabel(_docs_links_html) + docs_links_widget.setOpenExternalLinks(True) + return docs_links_widget + + +def _logo_widget(): + return QLabel(_logo_html) + + +def header_widget(parent: QWidget = None): + box = QGroupBox(parent) + box.setFlat(True) + box.setLayout(QHBoxLayout()) + box.layout().addWidget(_logo_widget()) + box.layout().addWidget(_docs_links_widget()) + return box