Skip to content

Fix configuration window close behavior and preview display issues#6

Open
Devil-Cong wants to merge 3 commits into
valeriyvan:masterfrom
Devil-Cong:master
Open

Fix configuration window close behavior and preview display issues#6
Devil-Cong wants to merge 3 commits into
valeriyvan:masterfrom
Devil-Cong:master

Conversation

@Devil-Cong
Copy link
Copy Markdown

Changes

This PR fixes several issues with the configuration window and preview mode:

Fixed Issues

  1. Configuration window not closing properly in System Preferences

    • The OK button now correctly closes the sheet window using endSheet() when displayed in System Preferences
    • Falls back to close() for standalone window mode
  2. No way to reopen configuration window in Preview app

    • Added showPreferences: action in AppDelegate
    • Connected Preferences menu item (Cmd+,) to reopen the configuration window
  3. Font size display issue on Preview app startup

    • Added viewDidMoveToWindow() to ensure font size is calculated after the view has proper bounds
  4. Motivation level changes not taking effect immediately

    • Added didSet observer to motivationLevel property to trigger label update

Files Changed

  • Motivation/ConfigureSheetController.swift
  • Preview/AppDelegate.swift
  • Preview/MainMenu.xib
  • Motivation/AgeView.swift

Testing

Tested on macOS 15.7.3 with both:

  • System Preferences screen saver settings
  • Preview.app for development

All issues are resolved and working as expected.

- Fixed configuration window not closing properly when clicking OK button in System Preferences
- Added Preferences menu item in Preview app to reopen configuration window
- Fixed font size initialization issue in Preview mode
- Fixed motivation level changes not taking effect immediately in Preview mode
… motivation level

- Override startAnimation to reload preferences when animation begins
- Add defaults synchronization when accessing birthday components
- Add defaults synchronization when accessing motivation level
- Update birthday information on animation start to reflect current settings
- Maintain legacy screen saver compatibility with preference reloading
- Reduced animation frame rate from 30 FPS to 5 FPS
- Added comments explaining the performance optimization
- Changed animationTimeInterval from 1/30 to 1/5 for better CPU efficiency
- Maintained sufficient update frequency for age display with 9 decimal places
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.

1 participant