From ba704aa24c82a94add86ddb04ea62e202d5aeef5 Mon Sep 17 00:00:00 2001 From: "Jeison Yehuda Amihud (Blender Dumbass)" Date: Mon, 11 Jan 2021 20:50:20 +0000 Subject: [PATCH] Cursors When highlighting various elements Cursors are now change. --- UI/UI_elements.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/UI/UI_elements.py b/UI/UI_elements.py index 88c5804..345eb15 100644 --- a/UI/UI_elements.py +++ b/UI/UI_elements.py @@ -26,7 +26,7 @@ from settings import fileformats from UI import UI_color 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. @@ -68,6 +68,13 @@ def roundrect(layer, win, x, y, width, height, r, button=False, icon=False, if do: + + # cursor + if text: + win.current["cursor"] = win.cursors["text"] + else: + win.current["cursor"] = win.cursors["hand"] + # If holding click if win.current["LMB"]: 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") # If clicked if win.previous["LMB"] and not win.current["LMB"]: + win.current["cursor"] = win.cursors["watch"] button() # 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, button=do, tip=tip, - offset=offset) + offset=offset, + text=True) outlayer.stroke() if win.textactive == name: