Skip to content

Commit 6bc4f97

Browse files
committed
Merge branch 'main' into releasing-fix
2 parents 15313c9 + dbc3ce2 commit 6bc4f97

6 files changed

Lines changed: 257 additions & 197 deletions

File tree

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Fixed
11+
12+
- Dependency audit: pin ``uv>=0.11.15`` (GHSA-4gg8-gxpx-9rph).
13+
14+
## [0.4.0] - 2026-06-01
15+
16+
### Changed
17+
18+
- Step 1 clinical preset buttons scroll horizontally when they do not fit on one row.
19+
20+
### Fixed
21+
22+
- Wizard window: title-bar maximize and resize on steps 1+ (step 0 stays compact).
23+
- Step 1 initial settings: vertical scrollbar in its own column; no overlap with electrode canvases.
24+
25+
## [0.4.0b2] - 2026-05-21
26+
1027
### Added
1128

1229
- Read the Docs: dark outer page background (matching the sidebar); browser tab

constraints-briefcase.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ numpy==2.4.4
2929
# pandas
3030
packaging==26.2
3131
# via matplotlib
32-
pandas==3.0.2
32+
pandas==3.0.3
3333
# via dbs-annotator
3434
pillow==12.2.0
3535
# via matplotlib
36-
pydantic==2.13.3
36+
pydantic==2.13.4
3737
# via dbs-annotator
38-
pydantic-core==2.46.3
38+
pydantic-core==2.46.4
3939
# via pydantic
4040
pyparsing==3.3.2
4141
# via matplotlib

pyproject.toml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ classifiers = [
2323
dependencies = [
2424
"certifi>=2024.0.0",
2525
"tzdata>=2026.2",
26-
"pandas>=2.1",
26+
"pandas>=3.0.3",
2727
"python-docx>=1.1",
2828
"docx2pdf>=0.1.8",
29-
"pydantic>=2.13.3",
29+
"pydantic>=2.13.4",
3030
"pyside6>=6.11.0",
3131
"matplotlib>=3.10.9",
3232
"packaging>=26.2",
@@ -42,12 +42,13 @@ dev = [
4242
"ruff>=0.1.0",
4343
"pre-commit>=3.6",
4444
"pre-commit-uv>=4.2.1",
45-
"ty>=0.0.29",
45+
"uv>=0.11.15",
46+
"ty>=0.0.35",
4647
"pandas-stubs>=3.0.0.260204",
4748
"pyside6-stubs>=6.7.3.0",
4849
"towncrier>=24.8.0",
4950
]
50-
build = ["briefcase>=0.3.26"]
51+
build = ["briefcase>=0.4.2"]
5152
docs = [
5253
"sphinx>=9.0.4",
5354
"sphinx-rtd-theme>=3.1.0",
@@ -192,7 +193,7 @@ showcontent = true
192193
project_name = "DBSAnnotator"
193194
bundle = "ch.wysscenter.dbsannotator"
194195
# Briefcase requires a static version here even when [project] uses dynamic version
195-
version = "0.4.0b1"
196+
version = "0.4.0"
196197
license = { file = "LICENSE" }
197198
# Windows per-user install dir is %LOCALAPPDATA%\<author>\<formal_name>; must match
198199
# FS_ORG_NAME in dbs_annotator.config (Qt user data / lab convention).

src/dbs_annotator/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
clinical data during Deep Brain Stimulation programming sessions.
66
"""
77

8-
__version__ = "0.4.0b1"
8+
__version__ = "0.4.0"
99
__app_name__ = "DBS Annotator"
1010

1111
from .config import APP_LEAD_AUTHOR

src/dbs_annotator/views/wizard_window.py

Lines changed: 55 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,6 @@ def _setup_window(self) -> None:
182182
self.setGeometry(x, y, width, height)
183183
self.setMinimumSize(WINDOW_MIN_SIZE["width"], WINDOW_MIN_SIZE["height"])
184184

185-
# Make window resizable
186-
self.setWindowFlag(Qt.WindowType.WindowMaximizeButtonHint, True)
187-
188185
# Set smaller size for step 0 (mode selection)
189186
self._update_window_size_for_step0()
190187

@@ -866,49 +863,81 @@ def _update_window_size_for_step0(self) -> None:
866863
self.setGeometry(x, y, compact_width, compact_height)
867864
self.setMinimumSize(compact_width, compact_height)
868865
self.setMaximumSize(compact_width, compact_height)
866+
self._refresh_title_bar_maximize(enabled=False)
869867

870-
def _update_window_size_for_main_workflow(self) -> None:
871-
"""Restore normal window size for main workflow (steps 1+)."""
872-
# Restore normal size policies and remove fixed constraints from step0
873-
if hasattr(self, "stack"):
874-
self.stack.setSizePolicy(
875-
QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum
876-
)
877-
self.stack.setMaximumWidth(16777215) # Remove fixed width
878-
self.stack.setMaximumHeight(16777215) # Remove fixed height
868+
def _refresh_title_bar_maximize(self, *, enabled: bool) -> None:
869+
"""
870+
Enable or disable the native title-bar maximize button.
871+
872+
On Windows, fixed min/max sizing (step 0) removes WS_MAXIMIZEBOX from the
873+
native frame; ``setWindowFlag`` alone does not restore it — the frame must
874+
be recreated with ``setWindowFlags`` and ``show()``.
875+
876+
All standard title-bar hints must be set explicitly; otherwise Windows may
877+
drop the close or maximize button when the frame is recreated.
878+
"""
879+
flags = (
880+
Qt.WindowType.Window
881+
| Qt.WindowType.WindowTitleHint
882+
| Qt.WindowType.WindowSystemMenuHint
883+
| Qt.WindowType.WindowMinimizeButtonHint
884+
| Qt.WindowType.WindowCloseButtonHint
885+
)
886+
if enabled:
887+
flags |= Qt.WindowType.WindowMaximizeButtonHint
888+
889+
geometry = self.geometry()
890+
visible = self.isVisible()
891+
self.setWindowFlags(flags)
892+
if visible:
893+
self.setGeometry(geometry)
894+
self.show()
895+
896+
def _release_stack_size_constraints(self) -> None:
897+
"""Remove fixed sizes left over from step 0 so content can grow with the window."""
898+
if not hasattr(self, "stack"):
899+
return
900+
self.stack.setSizePolicy(
901+
QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum
902+
)
903+
self.stack.setMinimumWidth(0)
904+
self.stack.setMinimumHeight(0)
905+
self.stack.setMaximumWidth(16777215)
906+
self.stack.setMaximumHeight(16777215)
879907
if hasattr(self, "stack_scroll_area"):
880908
self.stack_scroll_area.setSizePolicy(
881909
QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Expanding
882910
)
883911

884-
# Get original normal size
912+
def _update_window_size_for_main_workflow(self) -> None:
913+
"""Restore normal window size for main workflow (steps 1+)."""
914+
self._release_stack_size_constraints()
915+
885916
screen = self.app.primaryScreen()
886917
rect = screen.availableGeometry()
887918
screen_width = rect.width()
888919
screen_height = rect.height()
889920

890-
# Calculate desired window size with ratio
921+
min_width = min(WINDOW_MIN_SIZE["width"], screen_width)
922+
min_height = min(WINDOW_MIN_SIZE["height"], screen_height)
923+
891924
desired_width = int(screen_width * WINDOW_SIZE_RATIO["width"])
892925
desired_height = int(screen_height * WINDOW_SIZE_RATIO["height"])
926+
width = max(desired_width, min_width)
927+
height = max(desired_height, min_height)
893928

894-
# Apply minimum size constraints
895-
width = max(desired_width, WINDOW_MIN_SIZE["width"])
896-
height = max(desired_height, WINDOW_MIN_SIZE["height"])
897-
898-
# Center the normal window
899929
x = int((screen_width - width) / 2)
900930
y = int((screen_height - height) / 2)
901931

902-
# Reset constraints first to avoid min/max conflicts
932+
# Reset constraints first to avoid min/max conflicts from step 0
903933
self.setMinimumSize(1, 1)
904-
self.setMaximumSize(16777215, 16777215) # Qt max size
934+
self.setMaximumSize(16777215, 16777215)
905935

906-
# Apply new geometry and constraints (allow full maximization)
907936
self.setGeometry(x, y, width, height)
908-
self.setMinimumSize(WINDOW_MIN_SIZE["width"], WINDOW_MIN_SIZE["height"])
909-
self.setMaximumSize(
910-
screen_width, screen_height
911-
) # Allow full screen maximization
937+
self.setMinimumSize(min_width, min_height)
938+
# No practical max cap — lets the title-bar maximize button work on Windows
939+
self.setMaximumSize(16777215, 16777215)
940+
self._refresh_title_bar_maximize(enabled=True)
912941

913942
self._clamp_to_screen()
914943

0 commit comments

Comments
 (0)