Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ default_stages:
minimum_pre_commit_version: 2.9.3
repos:
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.19.1
rev: v1.20.2
hooks:
- id: mypy
additional_dependencies: [numpy>=1.23]
exclude: docs
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 25.12.0
rev: 26.3.1
hooks:
- id: black
additional_dependencies: [toml]
Expand Down Expand Up @@ -49,7 +49,7 @@ repos:
hooks:
- id: blacken-docs
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.10
rev: v0.15.12
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down
24 changes: 8 additions & 16 deletions src/napari_spatialdata/_scatterwidgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,14 +251,12 @@ def __init__(self, model: DataModel, color_data: dict[str, Any]):
color_button = ColorButton(color=color)
color_button.setMinimumSize(60, 30)
color_button.setMaximumSize(60, 30)
color_button.setStyleSheet(
"""
color_button.setStyleSheet("""
QPushButton {
background-color: transparent;
border: none;
}
"""
)
""")

self.color_buttons[obj_category] = color_button

Expand Down Expand Up @@ -384,17 +382,15 @@ def __init__(self, viewer: Viewer | None, model: DataModel) -> None:
self.drawing_mode_button = QPushButton(self)
self.drawing_mode_button.setIcon(QIcon(str(Path(__file__).parent / "resources/icons8-polygon-80.png")))
self.drawing_mode_button.setIconSize(QSize(24, 24))
self.drawing_mode_button.setStyleSheet(
f"""
self.drawing_mode_button.setStyleSheet(f"""
QPushButton {{
background-color: transparent;
border: none;
}}
QPushButton:checked {{
border: 1px solid rgb{self.color};
}}
"""
)
""")
self.drawing_mode_button.setCheckable(True)
self.drawing_mode_button.clicked.connect(self.toggle_drawing_mode)
self.drawing_mode_button.setToolTip("Add freehand ROIs.")
Expand All @@ -405,17 +401,15 @@ def __init__(self, viewer: Viewer | None, model: DataModel) -> None:
self.rectangle_mode_button = QPushButton(self)
self.rectangle_mode_button.setIcon(QIcon(str(Path(__file__).parent / "resources/icons8-rectangle-48.png")))
self.rectangle_mode_button.setIconSize(QSize(24, 24))
self.rectangle_mode_button.setStyleSheet(
f"""
self.rectangle_mode_button.setStyleSheet(f"""
QPushButton {{
background-color: transparent;
border: none;
}}
QPushButton:checked {{
border: 1px solid rgb{self.color};
}}
"""
)
""")
self.rectangle_mode_button.setCheckable(True)
self.rectangle_mode_button.clicked.connect(self.toggle_rectangle_mode)
self.rectangle_mode_button.setToolTip("Add rectangular ROIs.")
Expand Down Expand Up @@ -873,14 +867,12 @@ def wrap_discrete_color_widget(self) -> QtWidgets.QGraphicsProxyWidget:
# view.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn)
# sets stle of the vertical slider
view.setStyleSheet(get_current_stylesheet())
view.setStyleSheet(
"""
view.setStyleSheet("""
QGraphicsView {
border: none;
background: rgb(0, 0, 0);
}
"""
)
""")

view.setSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)

Expand Down
4 changes: 1 addition & 3 deletions src/napari_spatialdata/_sdata_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from importlib.metadata import version
from operator import itemgetter
from pathlib import Path
from typing import TYPE_CHECKING, cast
from typing import TYPE_CHECKING

import numpy as np
import shapely
Expand Down Expand Up @@ -219,8 +219,6 @@ def _onClick(self, text: str) -> None:
}:
return

type_ = cast(str, type_)

self.worker_thread.load_data(type_, text, sdata, selected_cs, multi)
if not PROBLEMATIC_NUMPY_MACOS:
self.slider.setVisible(True)
Expand Down
Loading