Upload files to 'UI'

This commit is contained in:
Jeison Yehuda Amihud (Blender Dumbass) 2020-12-15 20:42:56 +00:00
parent fa32eead23
commit f94c92ef1d

View file

@ -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