diff --git a/UI/UI_elements.py b/UI/UI_elements.py index 88b3610..d97eecb 100644 --- a/UI/UI_elements.py +++ b/UI/UI_elements.py @@ -432,7 +432,7 @@ def tooltip(win, text): def scroll_area(layer, win, name, x, y, width, height, maxlength, bar=False,sideways=False, mmb=False, mmb_only=False, - url="", strenght=50): + url="", strenght=50, bar_always=False): # This function going to handle all the scrolling windows. Making it so it's # relativelly simple to set up big widgets with in small areas. @@ -517,12 +517,13 @@ def scroll_area(layer, win, name, x, y, width, height, maxlength, fraction = height / maxlength # Similar to progress bar for now if fraction > 1: tobreak = True + fraction = 1 # To break parameter basically says. To draw it the bar only when # it's actully needed. When content aka maxlength is bigger then # our viewport. - if not tobreak: + if not tobreak or bar_always: # Now the offset value. That will move our progress bar with # the scroll value. @@ -597,12 +598,13 @@ def scroll_area(layer, win, name, x, y, width, height, maxlength, fraction = width / maxlength # Similar to progress bar for now if fraction > 1: tobreak = True + fraction = 1 # To break parameter basically says. To draw it the bar only when # it's actully needed. When content aka maxlength is bigger then # our viewport. - if not tobreak: + if not tobreak or bar_always: # Now the offset value. That will move our progress bar with # the scroll value. @@ -730,7 +732,7 @@ def text(outlayer, win, name, x, y, width, height, set_text="", parse=False, fil # Automatic scroll system: Based on the position of the cursor. offsetX = 0 cursor2location = win.text[name]["cursor"][1]*12 + offsetX - while cursor2location > width - 50: + while cursor2location > width - 5: offsetX -= 1 cursor2location = win.text[name]["cursor"][1]*12 + offsetX