Cursors
When highlighting various elements Cursors are now change.
This commit is contained in:
parent
ff3f1e7101
commit
ba704aa24c
1 changed files with 11 additions and 2 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue