Skip to content

Add switchable Dark/Light themes & fix NumPy segmentation fault (#410)#416

Open
l7on3n wants to merge 3 commits into
tlecomte:masterfrom
l7on3n:master
Open

Add switchable Dark/Light themes & fix NumPy segmentation fault (#410)#416
l7on3n wants to merge 3 commits into
tlecomte:masterfrom
l7on3n:master

Conversation

@l7on3n
Copy link
Copy Markdown

@l7on3n l7on3n commented Jun 6, 2026

Description
This PR adds support for dynamic theming (Dark/Light/System) across the PyQt and QML interfaces. It also fixes some type handling issues in the audio filter decimation logic that were causing crashes on newer Python/NumPy environments, and introduces uv for dependency locking.

Theme Changes

  • Added an Appearance dropdown in Settings to toggle between Light, Dark, and System themes (persisted via QSettings).
  • Intercepts the selected theme and forces the "Fusion" style for dark mode, building a custom QPalette.
  • Added reactive properties to MainWindowViewModel (window_color, text_color, etc.) that mirror the active PyQt palette.
  • Updated FritureMainWindow.qml, Dock.qml, and ControlBar.qml to bind to the ViewModel palette instead of SystemPalette so the QML widgets stay in sync with the main window.

Filter / NumPy Fixes

  • Explicitly cast arrays (forward, feedback, x_dec, zis) to float64 in octave_filter_bank_decimation before passing them to Cython (pyx_lfilter) to prevent segfaults.
  • Swapped a float division for integer division (N / 2 -> N // 2) in filter_design.py to fix TypeError exceptions on newer NumPy versions.
  • Regenerated coefficients in generated_filters.py to match the updated float configs.

Development / Infrastructure

  • Added uv.lock for faster local dev using uv.

To Test

  1. Go to Settings -> Appearance and toggle the themes. Check that the QML docks and control bar update correctly alongside the main PyQt window.
  2. Run the app with an active audio input to verify the filter banks run without throwing a TypeError or segfaulting.

Fixes #410 segmentation fault

Faturrahman Ilhami Dema added 3 commits June 6, 2026 12:23
- Added dynamic theming (Dark/Light/System) support.
- Fixed NumPy type handling in audio filters to prevent crashes.
- Regenerated filter coefficients and updated UI settings.
- Added uv.lock and theme test scripts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

20587 segmentation fault (core dumped) friture

1 participant