From 97372e8ad2494f9569c4fef6af2b79ed8492cfff Mon Sep 17 00:00:00 2001 From: yumoqing Date: Sat, 18 Apr 2020 22:47:11 +0800 Subject: [PATCH] bugfix --- kivyblocks/stylebehavior.py | 39 ------------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 kivyblocks/stylebehavior.py diff --git a/kivyblocks/stylebehavior.py b/kivyblocks/stylebehavior.py deleted file mode 100644 index e4c7aea..0000000 --- a/kivyblocks/stylebehavior.py +++ /dev/null @@ -1,39 +0,0 @@ -from kivy.graphics import Color, Rectangle -from kivy.logger import logging - -from kivyblocks.colorcalc import toArrayColor - -from appPublic.jsonConfig import getConfig - -from .color_definitions import getColors, getSelectedColors -from .color_definitions import getInfoColors, getErrorColors - -class StyleBehavior(object): - def __init__(self,level=0): - config = getConfig() - style = config.style - self.style_level = level - self.selected_flag = False - logging.info('Tree : style=%s,level=%d',style, level) - c1, c2 = getColors(style,level) - self.text_color, self.bg_color = toArrayColor(c1),toArrayColor(c2) - c1, c2 = getSelectedColors(style,level) - self.s_text_color,self.s_bg_color = toArrayColor(c1), toArrayColor(c2) - self.bind(size=self.setBGColor,pos=self.setBGColor) - - def setBGColor(self,o=None,v=None): - c = self.bg_color - if self.selected_flag: - c = self.s_bg_color - # logging.info('selected=%s,color=%s',str(self.selected_flag),str(c)) - with self.canvas.before: - Color(*c) - Rectangle(pos=self.pos,size=self.size) - - def selected(self): - self.selected_flag = True - self.setBGColor() - - def unselected(self): - self.selected_flag = False - self.setBGColor()