Commit Graph
3 Commits
Author SHA1 Message Date
David Richardson f62ea9b27e CPButtonBar: Preserve theme values for keys absent from archive
-initWithCoder: decoded bordered buttons, separator, transparency, and
automatic resize control using -decodeBoolForKey:, which returns NO
when a key is missing.

A CPButtonBar placed in Interface Builder as a
custom view contains none of these keys in its archive, clearing the
theme's values.

Each attribute now uses the archived value when the key
is present and falls back to the theme's value otherwise.
2026-12-03 16:48:42 -06:00
David Richardson e498fb5758 AppKit: Stop CPButtonBar from setting an autoresizing mask in -initWithFrame:
-[CPButtonBar initWithFrame:] set the autoresizing mask to
CPViewWidthSizable | CPViewMinYMargin, which pinned the bar to the
bottom of its superview.

Positioning a view in its superview belongs to the caller: an NSView created in code has no autoresizing mask, and a CIB sets it from the archive. Remove the assignment in -[CPButtonBar initWithFrame:] and add -[CPButtonBarTest testAButtonBarMadeInCodeHasNoAutoresizingMask].
2026-11-30 16:15:52 -06:00
David Richardson 5db5adac04 Tests: Add CPButtonBar regression tests
Protects the add, remove and action controls placed below table and outline views by verifying that a button bar supplies usable buttons independently of the active theme.

* CPButtonBarTest: Verifies the standard size of the plus, minus and
  action popup buttons; button placement within the bar, order and
  shared borders; closure of the gap left by a hidden button; right
  edge alignment of right buttons; and acceptance of application
  buttons.
2026-10-31 19:50:31 -06:00