Skip to content

[Feature] Add GUI zoom functionality with scalable interface #14

Description

@tensquaresoftware

Feature Request: GUI Zoom Functionality

Overview

Implement a zoom feature to allow users to scale the entire plugin interface, improving accessibility and adapting to different screen sizes and resolutions.

Proposed Implementation

1. Zoom Control Location

  • Add a zoom ComboBox in the HeaderPanel
  • Position it in a logical location (e.g., top-right corner near other global controls)
  • Use existing ComboBox widget for consistency with current UI design

2. Zoom Levels

Standard zoom levels to implement:

  • 50% (very small)
  • 75% (small)
  • 90% (slightly reduced)
  • 100% (default) - current size
  • 110% (slightly enlarged)
  • 125% (medium)
  • 150% (large)
  • 200% (very large)
  • 300% (extra large)
  • 400% (maximum)

3. Technical Approach

Using JUCE AffineTransform:

// Apply zoom transform to main component (scale from selected zoom level)
auto transform = juce::AffineTransform::scale(zoomLevelScale);
mainComponent.setTransform(transform);

Key considerations:

  • Apply transform to the root GUI component (likely MainComponent)
  • Adjust component bounds to accommodate scaled size
  • Ensure the plugin window resizes appropriately
  • Cache images may need invalidation on zoom change

4. Persistence

  • Store zoom preference in plugin state (APVTS or separate settings)
  • Restore zoom level when plugin is reopened
  • Consider per-instance vs global preference

5. HiDPI/Retina Considerations

  • Ensure zoom works correctly with existing HiDPI support
  • Zoom level (scale) should multiply with display scale factor
  • Test on different display configurations (1x, 2x, 3x scaling)

6. Performance Optimization

  • Invalidate widget caches when zoom changes
  • Trigger full repaint after zoom application
  • Consider debouncing if zoom can be changed rapidly

7. Edge Cases to Handle

  • Minimum window size constraints
  • Maximum window size (especially at 400%)
  • Host window resizing behavior
  • DAW-specific constraints (some hosts limit plugin window sizes)

UI/UX Considerations

  1. Visual Feedback:

    • Show current zoom percentage in ComboBox
    • Possibly add keyboard shortcuts (Cmd/Ctrl +/- for zoom in/out)
  2. Smooth Transitions:

    • Consider animating zoom changes (optional, may be overkill)
    • Ensure no visual glitches during scaling
  3. Accessibility:

    • This feature particularly helps users with vision impairments
    • Larger zoom levels should maintain readability and usability

Testing Checklist

  • Test all zoom levels on macOS (Retina and non-Retina)
  • Test all zoom levels on Windows (different DPI settings)
  • Verify zoom persistence across plugin instances
  • Test in multiple DAWs (Logic Pro, Ableton Live, Reaper)
  • Verify no performance degradation at extreme zoom levels
  • Check that all widgets remain functional when scaled
  • Test edge cases (very small/large window sizes)

Implementation Priority

Medium Priority - Nice-to-have feature that improves accessibility and user experience, but not critical for core functionality.

Related Considerations

  • This feature will work well with the current image caching system
  • May need to adjust cache invalidation logic in widgets
  • Consider adding a "Reset to Default" option (100%)
  • Could add a tooltip explaining the zoom feature

Alternative Approaches

If AffineTransform causes issues:

  • Use Component::setScaleFactor() (JUCE 7+)
  • Manually scale all widget dimensions (not recommended, too complex)
  • Use OpenGL scaling (not applicable since we removed OpenGL)

Notes

  • Current GUI is 1920x1080, so 400% zoom would require significant screen real estate
  • Consider warning users if zoomed size exceeds screen dimensions
  • Some DAWs may override or constrain plugin window sizes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions