Akascape / CTkListbox

A simple listbox for customtkinter (extenstion/add-on)
MIT License
130 stars 14 forks source link

Add parameters to style buttons #25

Closed Sargeanthost closed 6 months ago

Sargeanthost commented 8 months ago

Perhaps add a button_fg_color or allow passthrough of all CTkButton parameters to the constructor so that list items can be styled. Currently it looks very weird on light mode. Right now it's forced to be transparent, which leaves the only option as bg_color, which doesn't have the rounded corners. if you use the bg_corners_colors tuple list, there is some artifacting, so that's not a workaround currently

Additions would probably be on line 40:

        self.button_fg_color = "transparent" if button_fg_color=="default" else button_fg_color

and added to line 147:

        self.buttons[index] = customtkinter.CTkButton(self, text=option, fg_color=self.button_fg_color, anchor=self.justify,
                                                      text_color=self.text_color, font=self.font,
                                                      hover_color=self.hover_color, **args)

Thanks!

Akascape commented 6 months ago

@Sargeanthost Suggestion added, update the package!