From 9d99df6d2303a3a8cf7cc9b8eb551efab0ed3003 Mon Sep 17 00:00:00 2001 From: cxykevin Date: Mon, 29 Apr 2024 21:10:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dplain=E7=9A=84=E5=9B=BE?= =?UTF-8?q?=E6=A0=87bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debug.py | 2 ++ magictk/button.py | 8 ++++---- magictk/color_tmpl.py | 4 ++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/debug.py b/debug.py index 3d6bcd8..d88efd1 100644 --- a/debug.py +++ b/debug.py @@ -73,6 +73,8 @@ if __name__ == "__main__": func=lambda s: print("Icon Btn 1"), iconname="apple", iconsize=16, w=32).pack(side='left') magictk.ButtonFill(frame4, color_type="primary", func=lambda s: print("Icon Btn 2"), iconname="apple", iconsize=16, w=32).pack(side='left') + magictk.ButtonLight(frame4, + func=lambda s: print("Icon Btn 3"), iconname="apple", iconsize=16, w=32).pack(side='left') frame4.pack() frame6 = magictk.Frame(win) diff --git a/magictk/button.py b/magictk/button.py index 49e2ab6..f0ff044 100644 --- a/magictk/button.py +++ b/magictk/button.py @@ -305,11 +305,11 @@ class ButtonFill(Button): py = y+x_n+1 lcolor = j g_color = color_tmpl.mix_color( - "#FFFFFF", self.color[self._color_bd], int((1-lcolor/255)*1000)/1000) + self._color_text, self.color[self._color_bd], int((1-lcolor/255)*1000)/1000) f_color = color_tmpl.mix_color( - "#FFFFFF", self.color[self._color_fg1], int((1-lcolor/255)*1000)/1000) + self._color_text, self.color[self._color_fg1], int((1-lcolor/255)*1000)/1000) h_color = color_tmpl.mix_color( - "#FFFFFF", self.color[self._color_fg2], int((1-lcolor/255)*1000)/1000) + self._color_text, self.color[self._color_fg2], int((1-lcolor/255)*1000)/1000) obj = self.canvas.create_rectangle( px, py, px, py, width=0, fill=g_color) @@ -386,7 +386,7 @@ class ButtonFill(Button): x_n += 1 y_n += 1 - def __init__(self, master=None, root_anim=None, color_type="primary", w=80, h=30, text="Button", func=lambda s: print("Press"), color_list: dict = None, _dis_color=None, iconname="", iconsize=24): + def __init__(self, master=None, root_anim=None, color_type="plain", w=80, h=30, text="Button", func=lambda s: print("Press"), color_list: dict = None, _dis_color=None, iconname="", iconsize=24): if (_dis_color is None): self._color_bd = color_type self._color_bg = color_type diff --git a/magictk/color_tmpl.py b/magictk/color_tmpl.py index bd40e89..e5f08da 100644 --- a/magictk/color_tmpl.py +++ b/magictk/color_tmpl.py @@ -27,6 +27,10 @@ default_color = { "info_light3": "#B1B3B8", "info_dark": "#73767A", "plain": "#606266", + "plain_light": "#C6E2FF", + "plain_light2": "#ECF5FF", + "plain_light3": "#79BBFF", + "plain_dark": "#337ECC", "primary_text": "#303133", "regular_text": "#606266", "secondary_text": "#909399",