diff --git a/CHANGELOG.md b/CHANGELOG.md index 25bb10b..4130d72 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ToDo: + - - remove bg and background support for CTk and CTkToplevel (to be done) - enforce font size in pixel - enforce font to be tuple @@ -13,17 +14,20 @@ ToDo: ## Unreleased - 2022-10-2 ### Added - - added .cget() method to all widgets and windows - - added CTkTextbox with automatic x and y scrollbars, corner_radius, border_width, border_spacing - - added CTkSegmentedButton + - Added CTkTextbox with automatic x and y scrollbars, corner_radius, border_width, border_spacing + - Added CTkSegmentedButton + - Added CTkTabview + - Added .cget() method to all widgets and windows + - Added .bind() and .focus() methods to almost all widgets ### Changed - - changed 'text_font' attribute to 'font' in all widgets - - changed 'dropdown_color' attribute to 'dropdown_fg_color' for combobox, optionmenu - - changed 'orient' attribute of CTkProgressBar and CTkSlider to 'orientation' + - Changed 'text_font' attribute to 'font' in all widgets + - Changed 'dropdown_color' attribute to 'dropdown_fg_color' for combobox, optionmenu + - Changed 'orient' attribute of CTkProgressBar and CTkSlider to 'orientation' + - Width and height attributes of CTkCheckBox, CTkRadioButton, CTkSwitch now describe the outer dimensions of the whole widget. The button/switch size is described by separate attributes like checkbox_width, checkbox_height ### Removed - - removed setter and getter functions like set_text in CTkButton + - Removed setter and getter functions like set_text in CTkButton ### Fixed diff --git a/customtkinter/widgets/ctk_checkbox.py b/customtkinter/widgets/ctk_checkbox.py index dbc6087..49fb665 100644 --- a/customtkinter/widgets/ctk_checkbox.py +++ b/customtkinter/widgets/ctk_checkbox.py @@ -152,19 +152,20 @@ class CTkCheckBox(CTkBaseClass): super().destroy() def _draw(self, no_color_updates=False): - requires_recoloring = self._draw_engine.draw_rounded_rect_with_border(self._apply_widget_scaling(self._checkbox_width), - self._apply_widget_scaling(self._checkbox_height), - self._apply_widget_scaling(self._corner_radius), - self._apply_widget_scaling(self._border_width)) + requires_recoloring_1 = self._draw_engine.draw_rounded_rect_with_border(self._apply_widget_scaling(self._checkbox_width), + self._apply_widget_scaling(self._checkbox_height), + self._apply_widget_scaling(self._corner_radius), + self._apply_widget_scaling(self._border_width)) if self._check_state is True: - self._draw_engine.draw_checkmark(self._apply_widget_scaling(self._checkbox_width), - self._apply_widget_scaling(self._checkbox_height), - self._apply_widget_scaling(self._checkbox_height * 0.58)) + requires_recoloring_2 = self._draw_engine.draw_checkmark(self._apply_widget_scaling(self._checkbox_width), + self._apply_widget_scaling(self._checkbox_height), + self._apply_widget_scaling(self._checkbox_height * 0.58)) else: + requires_recoloring_2 = False self._canvas.delete("checkmark") - if no_color_updates is False or requires_recoloring: + if no_color_updates is False or requires_recoloring_1 or requires_recoloring_2: self._bg_canvas.configure(bg=ThemeManager.single_color(self._bg_color, self._appearance_mode)) self._canvas.configure(bg=ThemeManager.single_color(self._bg_color, self._appearance_mode)) diff --git a/test/manual_integration_tests/test_tabview.py b/test/manual_integration_tests/test_tabview.py index d9c32f6..1e6400d 100644 --- a/test/manual_integration_tests/test_tabview.py +++ b/test/manual_integration_tests/test_tabview.py @@ -16,7 +16,7 @@ tabview_1.delete("tab 42") tabview_1.insert(1, "tab 42") tabview_1.delete("tab 42") -tabview_1.move(0, "tab 3") +tabview_1.move(0, "tab 2") b1 = customtkinter.CTkButton(master=tab_1, text="button tab 1") b1.pack(pady=20)