When highlighting various elements
Cursors are now change.
This commit is contained in:
Jeison Yehuda Amihud (Blender Dumbass) 2021-01-11 20:50:20 +00:00
parent ff3f1e7101
commit ba704aa24c

View file

@ -26,7 +26,7 @@ from settings import fileformats
from UI import UI_color from UI import UI_color
def roundrect(layer, win, x, y, width, height, r, button=False, icon=False, def roundrect(layer, win, x, y, width, height, r, button=False, icon=False,
tip="", fill=True, url="", clip=False, offset=[0,0]): tip="", fill=True, url="", clip=False, offset=[0,0], text=False):
# This function draws a rectangle with rounded edges. # This function draws a rectangle with rounded edges.
@ -68,6 +68,13 @@ def roundrect(layer, win, x, y, width, height, r, button=False, icon=False,
if do: if do:
# cursor
if text:
win.current["cursor"] = win.cursors["text"]
else:
win.current["cursor"] = win.cursors["hand"]
# If holding click # If holding click
if win.current["LMB"]: if win.current["LMB"]:
UI_color.set(layer, win, "button_clicked") UI_color.set(layer, win, "button_clicked")
@ -75,6 +82,7 @@ def roundrect(layer, win, x, y, width, height, r, button=False, icon=False,
UI_color.set(layer, win, "button_active") UI_color.set(layer, win, "button_active")
# If clicked # If clicked
if win.previous["LMB"] and not win.current["LMB"]: if win.previous["LMB"] and not win.current["LMB"]:
win.current["cursor"] = win.cursors["watch"]
button() button()
# Button might have a tooltip as well # Button might have a tooltip as well
@ -1075,7 +1083,8 @@ def text(outlayer, win, name, x, y, width, height, set_text="", parse=False, fil
fill=False, fill=False,
button=do, button=do,
tip=tip, tip=tip,
offset=offset) offset=offset,
text=True)
outlayer.stroke() outlayer.stroke()
if win.textactive == name: if win.textactive == name: