israel-dryer/ttkbootstrap

allow for `justify` argument in `tooltip`

ABDsheikho opened this issue · 0 comments

Is your feature request related to a problem? Please describe.

I have been using ttkbootstrap for a good while, and I can say that I really like it, but sometimes I feel it has some default choices made.

in the source code of tooltip the code use default justify=LEFT on line 129 without considering allowing the choice to change it. and you only need to add two lines to allow for it.

Describe the solution you'd like

in the __init__ arguments body (line 41):

    def __init__(
        self,
        widget,
        text="widget info",
        justify: Literal['left', 'center', 'right'] = 'left',
        bootstyle=None,
        wraplength=None,
        delay=250,    # milliseconds
        **kwargs,
    ):

and then defining the attribute (line 70):

        self.text = text
        self.justify = justify
        self.bootstyle = bootstyle

and then at lbl definition (line 129):

            justify=self.justify,

Describe alternatives you've considered

or as an alterntive, you can assign self to lbl and make it an attribute so it can be possible to access it and change its configuation.

Additional context

https://github.com/israel-dryer/ttkbootstrap/blob/master/src/ttkbootstrap/tooltip.py