Commit Graph
4 Commits
Author SHA1 Message Date
David Richardson af2edf6c97 AppKit: Implement window minimize with restore from Windows menu
Order minimized window off screen and keep it in Windows menu for restore. Enable minimize button for miniaturizable windows.

* CPWindow.j:
  - Order window out with attached sheet and visible child windows on miniaturize:; keep first responder and child windows for restore; ignore miniaturize: on minimized window.
  - Restore window, first responder and child windows when window orders front; post CPWindowDidDeminiaturizeNotification after restore.
  - Restore minimized window through makeKeyAndOrderFront: in deminiaturize:.
  - Remove calls to platform window's miniaturize: and deminiaturize:.
  - Minimize through performMiniaturize: only when window can minimize; enable performMiniaturize: and miniaturize: menu items under same condition.

* _CPStandardWindowView.j: Enable minimize button for miniaturizable windows and target window's miniaturize:.

* CPWindowTest.j: Add tests for restore, notification order, first responder restore, performMiniaturize: on non-miniaturizable window, minimize button action and menu validation.

* CPApplicationWindowsMenuTest.j: Add tests for minimized window listed in mixed state and restored from Windows menu.

* DropInCompatibilityTest.j: Replace test for minimize button never enabled with test for minimize button enabled only for miniaturizable windows.
2026-11-08 14:37:23 -06:00
David Richardson af4d9dd9b9 AppKit: Implement window zoom and title bar double-click
Implement Cocoa zoom API on CPWindow and enable zoom button for resizable windows. Zoom window on double-click where drag moves it.

* CPWindow.j:
  - Add zoom:, performZoom: and isZoomed, toggling between standard frame and user frame; treat frame within 4 points of standard frame as zoomed.
  - Add windowWillUseStandardFrame:defaultFrame: and windowShouldZoom:toFrame: to CPWindowDelegate; consult window subclass when delegate lacks them.
  - Take default frame from platform window's usable content frame; keep standard frame within minimum and maximum sizes and usable area.
  - Enable performZoom: and zoom: menu items only when window can zoom.

* _CPStandardWindowView.j: Enable zoom button for resizable windows and target window's zoom:.

* _CPWindowView.j: Call performZoom: on double-click where drag moves window.

* CPWindowTest.j: Add tests for zoom toggling, default frame, delegate refusal, maximum size, missing user frame, window subclass standard frame, performZoom: on fixed-size window, menu validation and title bar double-click.

* DropInCompatibilityTest.j: Add test for zoom button enabled only for resizable windows.
2026-11-08 14:17:08 -06:00
David Richardson d55a620223 AppKit: Move platform window decoration from application state into theme variants
Remove incomplete host-platform OS behaviour API and its platform-specific conditionals. Derive window buttons, title, and title bar layout from window view's own theme, and select platform variants through a private function.

* CPApplication.j: Remove setOSBehavior:, OSBehavior, shouldMimicWindows and the simulatesWindows accessors, with the Info.plist keys and user default they read; set the default theme through _CPThemeVariant.

* CPApplication_Constants.j: Remove the OS behaviour constants, dictionary and notification.

* CPCompatibility.j: Add _CPBrowserOperatingSystem, returning the detected host operating system.

* CPTheme.j: Remove CPThemeStateWindowsPlatform; add _CPThemeVariant, returning the base theme.

* CPWindow.j: Remove the _close call to the window view.

* _CPStandardWindowView.j:
  - Remove the OS behaviour observer, _close and _osBehaviorDidChange:.
  - Place the buttons and title from theme values on every layout, with fixed defaults where a theme supplies none.
  - Read title bar and sheet values from the window view's theme instead of the default theme.

* _CPTitleableWindowView.j: Read title-margin at layout time instead of caching it.
2026-11-08 13:51:36 -06:00
David Richardson 17198938e0 Tests: Add regression test suites for table drawing and drop-in compatibility
Adds targeted test infrastructure and validation checks to protect table drawing hooks and drop-in framework contracts against unintended modifications.

* CPTableViewDrawingTest: Verifies subclass invocation order for drawing steps and ensures application-specified background colors persist across theme-state changes.

* DropInCompatibilityTest: Validates default theme names, window control configurations, pop-up button bezel styles, and table class defaults.

* DropInSnapshot: Encapsulates theme attribute defaults, public API surface, default view construction, and window controls as structured data.

* DropInBaselineGenerator: Provides tooling to capture current framework state as a baseline.

* DropInBaselineTest: Compares framework artifacts against the established baseline, permitting additions while reporting modifications and removals.

* DropInBaseline.json: Introduces the initial compatibility baseline artifact.
2026-10-31 15:58:31 -06:00