From ccc6007bab702ba22ecd5b28faf2935f10102426 Mon Sep 17 00:00:00 2001 From: Martin Carlberg Date: Tue, 23 Nov 2021 13:42:36 +0100 Subject: [PATCH] Fixed: Bezel state instance variable _bezelState must remove current state when changing to a new state (#3001) If the bezel state was changed and some attribute was set like an "image". The image would not be found as there were two states active and it would not match. --- AppKit/CPButton.j | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/AppKit/CPButton.j b/AppKit/CPButton.j index e3d9b7bdc..7853d1d5d 100644 --- a/AppKit/CPButton.j +++ b/AppKit/CPButton.j @@ -973,7 +973,11 @@ CPButtonImageOffset = 3.0; _bezelStyle = aBezelStyle; if (_bezelState && newState) + { + if (currentState) + _bezelState =_bezelState.without(currentState); _bezelState = _bezelState.and(newState); + } else _bezelState = newState || CPThemeStateNormal;