CustomTkinter
CustomTkinter copied to clipboard
Key misspell in themes' jsons (Scrollbar).
Hello Tom, there is probably a minor issue in some keys for the Scrollbar themes jsons, for instance (dark-blue.json):
"CTkScrollbar": { "corner_radius": 1000, "border_spacing": 4, "fg_color": "transparent", "button_color": ["gray55", "gray41"], "button_hover_color": ["gray40", "gray53"] },
here I think that "button_color" and "button_hover_color" should be replaced by "scrollbar_color" and "scrollbar_hover_color", which are used as indices in the source code in ctk_scrollbar.py. Without such names, a KeyError exception is raised.
Thanks for your work and have a nice day!
Hi, I changed the attributes of the scrollbar from scrollbar_color to button_color to match the naming convention of the switch and the slider, so for version 5.0.0 this theme files are correct and should work fine.
But then shouldn't indexing in lines 52 and 53 in ctk_scrollbar.py be changed from
self._button_color = ThemeManager.theme["CTkScrollbar"]["scrollbar_color"]... self._button_hover_color = ThemeManager.theme["CTkScrollbar"]["scrollbar_hover_color"]...
to
self._button_color = ThemeManager.theme["CTkScrollbar"]["button_color"]... self._button_hover_color = ThemeManager.theme["CTkScrollbar"]["button_hover_color"]...
?
Without doing so, I keep getting a KeyError (maybe I'm doing something wrong).
You are right, the dict keys in ctk_scrollbar.py were indeed wrong. I never tested the scrollbar on its own, just int he textbox. I fixed it now, a new version will be uploaded soon.
Fixed now with version 5.0.2.