From 36702326fa83638f6bfff65935bb259b96fa9137 Mon Sep 17 00:00:00 2001 From: Tom Schimansky Date: Mon, 18 Jul 2022 13:02:39 +0200 Subject: [PATCH] fixed checkbox size bug when rescaling --- customtkinter/widgets/ctk_checkbox.py | 1 + test/manual_integration_tests/complex_example_new.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/customtkinter/widgets/ctk_checkbox.py b/customtkinter/widgets/ctk_checkbox.py index 981eea3..787f1e6 100644 --- a/customtkinter/widgets/ctk_checkbox.py +++ b/customtkinter/widgets/ctk_checkbox.py @@ -118,6 +118,7 @@ class CTkCheckBox(CTkBaseClass): self.grid_columnconfigure(1, weight=0, minsize=self.apply_widget_scaling(6)) self.text_label.configure(font=self.apply_font_scaling(self.text_font)) + self.canvas.delete("checkmark") self.bg_canvas.configure(width=self.apply_widget_scaling(self._desired_width), height=self.apply_widget_scaling(self._desired_height)) self.canvas.configure(width=self.apply_widget_scaling(self._desired_width), height=self.apply_widget_scaling(self._desired_height)) self.draw() diff --git a/test/manual_integration_tests/complex_example_new.py b/test/manual_integration_tests/complex_example_new.py index 20064b3..5899aa4 100644 --- a/test/manual_integration_tests/complex_example_new.py +++ b/test/manual_integration_tests/complex_example_new.py @@ -39,7 +39,7 @@ class App(customtkinter.CTk): self.appearance_mode_optionemenu.grid(row=6, column=0, padx=20, pady=(10, 10)) self.scaling_label = customtkinter.CTkLabel(self.sidebar_frame, text="Widget Scaling:", anchor="w") self.scaling_label.grid(row=7, column=0, padx=20, pady=(10, 0)) - self.scaling_optionemenu = customtkinter.CTkOptionMenu(self.sidebar_frame, values=["90%", "100%", "110%"], + self.scaling_optionemenu = customtkinter.CTkOptionMenu(self.sidebar_frame, values=["80%", "90%", "100%", "110%", "120%"], command=self.change_scaling) self.scaling_optionemenu.grid(row=8, column=0, padx=20, pady=(10, 20)) @@ -120,7 +120,7 @@ class App(customtkinter.CTk): self.optionmenu_1.set("CTkOptionmenu") self.combobox_1.set("CTkComboBox") self.textbox.insert("1.0", - "CTkTextbox\n\nLorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.", ) + "CTkTextbox\n\nLorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.", ) #self.textbox.tag_add("headline", "1.0", "1.end") #self.textbox.tag_config("headline", foreground="red")