Skip to content


Subversion checkout URL

You can clone with
Download ZIP


CPButton -setTheme does not adjust frame #662

aparajita opened this Issue · 5 comments

3 participants


When CPButton -setTheme is called, the frame is not adjusted for the min/max size in the theme.

If I create a button in IB, there is no way (in 3.1 at least) to set the bezel to HUD. So I use a HUDButton subclass of CPButton that sets the theme to Aristo-HUD in the initializers. But the height of the frame is not adjusted to the max height specified in the theme and the buttons are not drawn correctly.

I fixed this by overriding CPButton -viewDidChangeTheme. A proposed patch to CPButton.j is here:


I'm not sure if it should auto change the size of the frame. You can call sizeToFit after calling setTheme: to update the frame respecting the new theme values.


Calling setTheme alone causes controls to be improperly drawn. Surely that can't be the intent of setTheme. Shouldn't it respect the min/max frame sizes established by the theme?

If I have to call sizeToFit to make setTheme work correctly, then the code I proposed is equivalent (although I would hoist it to CPControl).

FYI, fonts are also not correctly changed by setTheme. The whole point of themes is to encapsulate bezel (which implies size), font, background and color. Shouldn't calling setTheme modify all of those attributes to conform to the theme?


Milestone: 1.0. Labels: #accepted, #needs-patch, #needs-reduction, AppKit, bug. What's next?

  • This issue needs a volunteer to write and submit code to address it.
  • A minimal test app should be created which demonstrates the concern of this issue in isolation.


@aparajita aparajita closed this

Milestone: 1.0. Labels: #wont-fix, AppKit, bug. What's next? A reviewer or core team member has decided against acting upon this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.