UI: Previews for screen layouts

Basically all this does is drawing layout previews into the opened layout search menu.
https://youtu.be/RHYWtZP7pyA

The previews are drawn using offscreen rendering so they can't use multi-threading (yet!). But that shouldn't be an issue since only a handful of previews are drawn at the same time. Normally we only need to redraw the preview if a screen layout was changed. Would be nice if PreviewImage could store if it supports threaded rendering.
Previews are saved in files, might be useful if you later want to support appending layouts.
Adds a new file screen_draw.c.
This commit is contained in:
Julian Eisel
2016-12-01 16:43:57 +01:00
parent 4ff4dbc0ab
commit 52ec962516
16 changed files with 189 additions and 13 deletions

View File

@@ -40,7 +40,7 @@ class INFO_HT_header(Header):
layout.operator("screen.back_to_previous", icon='SCREEN_BACK', text="Back to Previous")
layout.separator()
else:
layout.template_ID(context.window, "screen", new="screen.new", unlink="screen.delete")
layout.template_ID_preview(context.window, "screen", new="screen.new", unlink="screen.delete", rows=2, cols=6)
layout.template_ID(context.screen, "scene", new="scene.new", unlink="scene.delete")
layout.separator()