From 29bdc3293d2eafa63a0382ef9750712c912128ac Mon Sep 17 00:00:00 2001 From: yumoqing Date: Fri, 4 Dec 2020 23:24:22 +0800 Subject: [PATCH] bugfix --- kivyblocks/bgcolorbehavior.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kivyblocks/bgcolorbehavior.py b/kivyblocks/bgcolorbehavior.py index 1f22352..1765408 100644 --- a/kivyblocks/bgcolorbehavior.py +++ b/kivyblocks/bgcolorbehavior.py @@ -73,6 +73,8 @@ class BGColorBehavior(object): def selected(self): if self.useOwnColor: + if self.bgcolor == self.selected_bgcolor: + return self.bgcolor = self.selected_bgcolor self.color = self.fgcolor = self.selected_fgcolor self.on_bgcolor() @@ -81,6 +83,8 @@ class BGColorBehavior(object): def unselected(self): if self.useOwnColor: + if self.bgcolor == self.normal_bgcolor: + return self.bgcolor = self.normal_bgcolor self.color = self.fgcolor = self.normal_fgcolor self.on_bgcolor()