Upload files to 'UI'
This commit is contained in:
parent
fa32eead23
commit
f94c92ef1d
1 changed files with 6 additions and 4 deletions
|
@ -432,7 +432,7 @@ def tooltip(win, text):
|
||||||
|
|
||||||
def scroll_area(layer, win, name, x, y, width, height, maxlength,
|
def scroll_area(layer, win, name, x, y, width, height, maxlength,
|
||||||
bar=False,sideways=False, mmb=False, mmb_only=False,
|
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
|
# 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.
|
# 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
|
fraction = height / maxlength # Similar to progress bar for now
|
||||||
if fraction > 1:
|
if fraction > 1:
|
||||||
tobreak = True
|
tobreak = True
|
||||||
|
fraction = 1
|
||||||
|
|
||||||
# To break parameter basically says. To draw it the bar only when
|
# To break parameter basically says. To draw it the bar only when
|
||||||
# it's actully needed. When content aka maxlength is bigger then
|
# it's actully needed. When content aka maxlength is bigger then
|
||||||
# our viewport.
|
# our viewport.
|
||||||
|
|
||||||
if not tobreak:
|
if not tobreak or bar_always:
|
||||||
|
|
||||||
# Now the offset value. That will move our progress bar with
|
# Now the offset value. That will move our progress bar with
|
||||||
# the scroll value.
|
# 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
|
fraction = width / maxlength # Similar to progress bar for now
|
||||||
if fraction > 1:
|
if fraction > 1:
|
||||||
tobreak = True
|
tobreak = True
|
||||||
|
fraction = 1
|
||||||
|
|
||||||
# To break parameter basically says. To draw it the bar only when
|
# To break parameter basically says. To draw it the bar only when
|
||||||
# it's actully needed. When content aka maxlength is bigger then
|
# it's actully needed. When content aka maxlength is bigger then
|
||||||
# our viewport.
|
# our viewport.
|
||||||
|
|
||||||
if not tobreak:
|
if not tobreak or bar_always:
|
||||||
|
|
||||||
# Now the offset value. That will move our progress bar with
|
# Now the offset value. That will move our progress bar with
|
||||||
# the scroll value.
|
# 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.
|
# Automatic scroll system: Based on the position of the cursor.
|
||||||
offsetX = 0
|
offsetX = 0
|
||||||
cursor2location = win.text[name]["cursor"][1]*12 + offsetX
|
cursor2location = win.text[name]["cursor"][1]*12 + offsetX
|
||||||
while cursor2location > width - 50:
|
while cursor2location > width - 5:
|
||||||
offsetX -= 1
|
offsetX -= 1
|
||||||
cursor2location = win.text[name]["cursor"][1]*12 + offsetX
|
cursor2location = win.text[name]["cursor"][1]*12 + offsetX
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue