israel-dryer / ttkbootstrap

A supercharged theme extension for tkinter that enables on-demand modern flat style themes inspired by Bootstrap.
MIT License
1.78k stars 358 forks source link

Multiple FloodGauge with same bootstyle, all show same mask despite different ones set. #513

Open CLB-rootwave opened 6 months ago

CLB-rootwave commented 6 months ago

Desktop (please complete the following information):

ttkbootstrap Version 1.10.1 OS: Windows

Describe the bug

When creating multiple flood gauges using same bootstyle, the same mask/text is used for all flood gauges. If different bootstyles are used for each gauge then the masks appear correctly, but would like to be able to use the same style for all, just each with a different mask.

To Reproduce


import ttkbootstrap as ttk

root = ttk.Window()

#All gauges use the same bootstyle. The mask of the last one is shown on all gauges
c = 0  # column value
for x in range(8):
    fg = ttk.Floodgauge(
        bootstyle=ttk.PRIMARY,
        font=(None, 8, 'bold'),
        mask=str(c)+' {}%',
        value=c*10,
        maximum=100,

    )
    fg.grid(row=1, column=c, padx=4, pady=10)
    c = c + 1
root.mainloop()

import ttkbootstrap as ttk

root = ttk.Window()
#Correct Masks, but each using different bootstyles
x = 0  # column value
for my_style in root.style.colors:
    fg = ttk.Floodgauge(
        bootstyle=my_style,
        font=(None, 8, 'bold'),
        mask=str(x)+' {}%',
        value=x*10,
        maximum=100,

    )
    fg.grid(row=2, column=x, padx=4, pady=10)
    x = x + 1

root.mainloop()

Expected behavior

I would expect each flood gauge to show a different mask and text value. The progress bar reflects the correct value but the text value does not match.

Screenshots

If all gauges use the same bootstyle, all masks are same: image

Expect different masks and values like this: image

Additional context

No response