Tweaks to the floaties.
This commit is contained in:
parent
3afea198e0
commit
89b603b013
2 changed files with 45 additions and 8 deletions
|
@ -819,26 +819,65 @@ def draw(outlayer, win, path, back="story_editor"):
|
||||||
else:
|
else:
|
||||||
difference = str(round(difference*100,2))
|
difference = str(round(difference*100,2))
|
||||||
result = str(round(after_star*100, 2)) + "% ( "+difference+"% )"
|
result = str(round(after_star*100, 2)) + "% ( "+difference+"% )"
|
||||||
print(result)
|
|
||||||
|
|
||||||
floaty_surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, int(len(result)*9+40), int(30))
|
floaty_surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, int(len(result)*9+40), int(50))
|
||||||
floaty_layer = cairo.Context(floaty_surface)
|
floaty_layer = cairo.Context(floaty_surface)
|
||||||
floaty_layer.select_font_face("Monospace", cairo.FONT_SLANT_NORMAL, cairo.FONT_WEIGHT_NORMAL)
|
floaty_layer.select_font_face("Monospace", cairo.FONT_SLANT_NORMAL, cairo.FONT_WEIGHT_NORMAL)
|
||||||
UI_color.set(floaty_layer, win, "shot_5")
|
|
||||||
if not positive:
|
|
||||||
UI_color.set(floaty_layer, win, "node_badfile")
|
UI_color.set(floaty_layer, win, "node_background")
|
||||||
UI_elements.roundrect(floaty_layer, win,
|
UI_elements.roundrect(floaty_layer, win,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
int(len(result)*9+40),
|
int(len(result)*9+40),
|
||||||
30,
|
50,
|
||||||
10)
|
10)
|
||||||
floaty_layer.select_font_face("Monospace", cairo.FONT_SLANT_NORMAL,
|
floaty_layer.select_font_face("Monospace", cairo.FONT_SLANT_NORMAL,
|
||||||
cairo.FONT_WEIGHT_NORMAL)
|
cairo.FONT_WEIGHT_NORMAL)
|
||||||
floaty_layer.set_font_size(15)
|
floaty_layer.set_font_size(15)
|
||||||
UI_color.set(floaty_layer, win, "text_normal")
|
UI_color.set(floaty_layer, win, "text_normal")
|
||||||
|
if not positive:
|
||||||
|
UI_color.set(floaty_layer, win, "node_badfile")
|
||||||
floaty_layer.move_to(20,20)
|
floaty_layer.move_to(20,20)
|
||||||
floaty_layer.show_text(result)
|
floaty_layer.show_text(result)
|
||||||
|
|
||||||
|
UI_color.set(floaty_layer, win, "progress_background")
|
||||||
|
UI_elements.roundrect(floaty_layer, win,
|
||||||
|
5,
|
||||||
|
35,
|
||||||
|
int(len(result)*9+30),
|
||||||
|
10,
|
||||||
|
5)
|
||||||
|
if positive:
|
||||||
|
UI_color.set(floaty_layer, win, "progress_active")
|
||||||
|
UI_elements.roundrect(floaty_layer, win,
|
||||||
|
5,
|
||||||
|
35,
|
||||||
|
int(len(result)*9+30)*min(1,after_star),
|
||||||
|
10,
|
||||||
|
5)
|
||||||
|
UI_color.set(floaty_layer, win, "text_link")
|
||||||
|
UI_elements.roundrect(floaty_layer, win,
|
||||||
|
5,
|
||||||
|
35,
|
||||||
|
int(len(result)*9+30)*min(1,before_star),
|
||||||
|
10,
|
||||||
|
5)
|
||||||
|
else:
|
||||||
|
UI_color.set(floaty_layer, win, "node_badfile")
|
||||||
|
UI_elements.roundrect(floaty_layer, win,
|
||||||
|
5,
|
||||||
|
35,
|
||||||
|
int(len(result)*9+30)*min(1,before_star),
|
||||||
|
10,
|
||||||
|
5)
|
||||||
|
UI_color.set(floaty_layer, win, "text_link")
|
||||||
|
UI_elements.roundrect(floaty_layer, win,
|
||||||
|
5,
|
||||||
|
35,
|
||||||
|
int(len(result)*9+30)*min(1,after_star),
|
||||||
|
10,
|
||||||
|
5)
|
||||||
|
|
||||||
floaty = {"fx":win.current["mx"],
|
floaty = {"fx":win.current["mx"],
|
||||||
"fy":win.current["my"],
|
"fy":win.current["my"],
|
||||||
|
@ -847,7 +886,6 @@ def draw(outlayer, win, path, back="story_editor"):
|
||||||
"ff":win.current["frame"],
|
"ff":win.current["frame"],
|
||||||
"tf":win.current["frame"]+200,
|
"tf":win.current["frame"]+200,
|
||||||
"sf":floaty_surface}
|
"sf":floaty_surface}
|
||||||
print(floaty)
|
|
||||||
win.floaters.append(floaty)
|
win.floaters.append(floaty)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -460,7 +460,6 @@ def pmdrawing(pmdrawing, main_layer, win):
|
||||||
del win.floaters[n]
|
del win.floaters[n]
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
print(win.floaters)
|
|
||||||
|
|
||||||
win.get_root_window().set_cursor(win.current["cursor"])
|
win.get_root_window().set_cursor(win.current["cursor"])
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue