CustomTkinter icon indicating copy to clipboard operation
CustomTkinter copied to clipboard

Key misspell in themes' jsons (Scrollbar).

Open herr-schmidt opened this issue 3 years ago • 3 comments

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!

herr-schmidt avatar Dec 01 '22 09:12 herr-schmidt

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.

TomSchimansky avatar Dec 01 '22 11:12 TomSchimansky

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).

herr-schmidt avatar Dec 01 '22 11:12 herr-schmidt

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.

TomSchimansky avatar Dec 01 '22 12:12 TomSchimansky

Fixed now with version 5.0.2.

TomSchimansky avatar Dec 06 '22 22:12 TomSchimansky