fixed checkbox size bug when rescaling

This commit is contained in:
Tom Schimansky 2022-07-18 13:02:39 +02:00
parent 3bee19f8ce
commit 36702326fa
2 changed files with 3 additions and 2 deletions

View File

@ -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()

View File

@ -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")