From f1cfa14750fc9ced8cbc3f83d80dc4efcb5844d6 Mon Sep 17 00:00:00 2001 From: Antoine Mercadal Date: Thu, 28 Aug 2014 17:26:22 -0700 Subject: [PATCH] FIXED: buttons in CPButtonBar were never removed from the CPButtonBar Previsouly, layoutSubview was layouting the visible buttons, but it was not removing them from the buttonbar --- AppKit/CPButtonBar.j | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/AppKit/CPButtonBar.j b/AppKit/CPButtonBar.j index f271aa34e..f655796b5 100644 --- a/AppKit/CPButtonBar.j +++ b/AppKit/CPButtonBar.j @@ -218,8 +218,14 @@ count = [buttonsNotHidden count]; while (count--) - if ([buttonsNotHidden[count] isHidden]) - [buttonsNotHidden removeObject:buttonsNotHidden[count]]; + { + var button = buttonsNotHidden[count]; + + [button removeFromSuperview]; + + if ([button isHidden]) + [buttonsNotHidden removeObject:button]; + } var currentButtonOffset = _resizeControlIsLeftAligned ? CGRectGetMaxX([self bounds]) + 1 : -1, bounds = [self bounds],