Code cleanup

This commit is contained in:
PySimpleGUI 2020-06-21 08:51:42 -04:00
parent bf687f114d
commit ed0fd5fbbb
1 changed files with 1 additions and 0 deletions

View File

@ -39,6 +39,7 @@ while True: # Event Loop
rect_height = int(GSIZE[1] * float(cpu_percent) / 100) rect_height = int(GSIZE[1] * float(cpu_percent) / 100)
rect_id = graph.draw_rectangle((0, rect_height), (GSIZE[0], 0), fill_color=sg.theme_button_color()[1], line_width=0) rect_id = graph.draw_rectangle((0, rect_height), (GSIZE[0], 0), fill_color=sg.theme_button_color()[1], line_width=0)
# Draw the % used text and the close "X" on bottom # Draw the % used text and the close "X" on bottom
text_id1 = graph.draw_text(f'{int(cpu_percent)}%', (GSIZE[0] // 2, GSIZE[1] // 2), font='Any 40', text_location=sg.TEXT_LOCATION_CENTER, color=sg.theme_button_color()[0])
text_id3 = graph.draw_text('', (0, 0), font='Any 8', text_location=sg.TEXT_LOCATION_BOTTOM_LEFT, color=sg.theme_button_color()[0]) text_id3 = graph.draw_text('', (0, 0), font='Any 8', text_location=sg.TEXT_LOCATION_BOTTOM_LEFT, color=sg.theme_button_color()[0])
# put the bar behind everything else # put the bar behind everything else
graph.send_figure_to_back(rect_id) graph.send_figure_to_back(rect_id)