Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if mx in range(mmx+60, mmx+60+22) and my in range(90, 90+22):
xgc.set_rgb_fg_color(gtk.gdk.color_parse("#e47649"))
widget.window.draw_rectangle(xgc, True, mmx+60, 90, 22, 22)
# TOOLTIP
xgc.set_rgb_fg_color(gtk.gdk.color_parse("#aaa"))
widget.window.draw_rectangle(xgc, True, mx+20, my+5, 200, 20)
ctx.set_font_size(15)
ctx.set_source_rgb(0,0,0)
ctx.move_to( mx+30, my+20)
ctx.show_text("ITEM'S CHECKLIST")
ctx.set_source_rgb(1,1,1)
if "GDK_BUTTON1" in str(fx) and self.allowed and "GDK_BUTTON1" not in str(self.mpf) and win.is_active():
checklist.checkwindow(pf=self.pf, title=self.screen.name, FILE=self.screen.path+"/asset.progress")
widget.window.draw_pixbuf(None, self.checklisticon, 0, 0, mmx+60, 90, -1, -1, gtk.gdk.RGB_DITHER_NONE, 0, 0)
# edit preview
#mouse over
if mx in range(mmx+60, mmx+60+22) and my in range(80+mmy-27, 80+mmy-27+22):
xgc.set_rgb_fg_color(gtk.gdk.color_parse("#e47649"))
widget.window.draw_rectangle(xgc, True, mmx+60, 80+mmy-27, 22, 22)
# TOOLTIP
xgc.set_rgb_fg_color(gtk.gdk.color_parse("#aaa"))
widget.window.draw_rectangle(xgc, True, mx+20, my+5, 200, 20)
xgc.set_rgb_fg_color(gtk.gdk.color_parse("#2c2c2c"))
widget.window.draw_rectangle(xgc, True, xpos, ypos, 5, 5 )
ctx.select_font_face("Monospace", cairo.FONT_SLANT_NORMAL, cairo.FONT_WEIGHT_NORMAL)
if mx in range(xpos-1, xpos+10) and my in range(ypos, ypos+10):
if "GDK_BUTTON1" in str(fx) and "GDK_BUTTON1" not in str(self.mpf) and win.is_active(): ## IF CLICKED
if taskfile == "project.progress":
checklist.checkwindow(pf=self.pf, title="[ "+taskstring[taskstring.rfind("/")+1:]+" ] in ", FILE=taskfile, highlight=rawline)
else:
checklist.checkwindow(pf=self.pf, title="[ "+taskstring[taskstring.rfind("/")+1:]+" ] in ", FILE=self.pf+taskfile, highlight=rawline)
istx = xpos
isty = len(taskstring)*9+5
if len(taskfile)*6+2 > isty:
isty = len(taskfile)*6+2
if istx + len(taskstring)*9+5 > w:
istx = w-(len(taskstring)*9+5)
if istx + len(taskfile)*6 > w:
istx = w-len(taskfile)*6
xgc.set_rgb_fg_color(gtk.gdk.color_parse("#e47649"))
widget.window.draw_rectangle(xgc, True, xpos-1, ypos, 10, 10 )
xgc.set_rgb_fg_color(gtk.gdk.color_parse("#5c5c5c"))
widget.window.draw_rectangle(xgc, True, istx, ypos-80, isty, 40 )
else:
xgc.set_rgb_fg_color(gtk.gdk.color_parse("#2c2c2c"))
widget.window.draw_rectangle(xgc, True, xpos, ypos, 5, 5 )
ctx.select_font_face("Monospace", cairo.FONT_SLANT_NORMAL, cairo.FONT_WEIGHT_NORMAL)
if mx in range(xpos-1, xpos+10) and my in range(ypos, ypos+10):
if "GDK_BUTTON1" in str(fx) and "GDK_BUTTON1" not in str(self.mpf) and win.is_active(): ## IF CLICKED
if taskfile == "project.progress":
checklist.checkwindow(pf=self.pf, title="[ "+taskstring[taskstring.rfind("/")+1:]+" ] in ", FILE=taskfile, highlight=rawline)
else:
checklist.checkwindow(pf=self.pf, title="[ "+taskstring[taskstring.rfind("/")+1:]+" ] in ", FILE=self.pf+taskfile, highlight=rawline)
istx = xpos
isty = len(taskstring)*9+5
if len(taskfile)*6+2 > isty:
isty = len(taskfile)*6+2
if istx + len(taskstring)*9+5 > w:
istx = w-(len(taskstring)*9+5)
if istx + len(taskfile)*6 > w:
istx = w-len(taskfile)*6
xgc.set_rgb_fg_color(gtk.gdk.color_parse("#e47649"))
widget.window.draw_rectangle(xgc, True, xpos-1, ypos, 10, 10 )