Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2014-04-02 14:59:48 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2014-04-02 15:03:11 +0400
commit4faef1e10c9d1177eae6350b4471206e91afaff8 (patch)
tree507726457b31e3d27bac0669f709c2bf26804455 /source/blender/makesdna
parent11ee2d8b97ddbdde9ef5a7b77df2b9f9eb2d0e91 (diff)
Add drag-resize to uiTemplatePreview (mat/tex/etc. preview widget).
This is done by adding a new button type, GRIP, similar to other numbuttons (scroll, slider, ...), which here controls the preview height. Then, we add a new DNA struct to be able to save that height in Blend files (note I choose not to use Panel struct for this, because we would then have the same limitation we used to have with uiLists, only one preview per panel and no preview outside panel). This implies a change to template_preview UI RNA/py API (each preview needs an ID), but this is backward compatible, as by default datablock type will be used if no ID is given (which means e.g. all material previews with no ID will have same height). Reviewers: brecht Reviewed By: brecht Differential Revision: https://developer.blender.org/D342
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r--source/blender/makesdna/DNA_screen_types.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/makesdna/DNA_screen_types.h b/source/blender/makesdna/DNA_screen_types.h
index beb230e467c..f676399ac1b 100644
--- a/source/blender/makesdna/DNA_screen_types.h
+++ b/source/blender/makesdna/DNA_screen_types.h
@@ -186,6 +186,14 @@ typedef struct uiList { /* some list UI data need to be saved in file
uiListDyn *dyn_data;
} uiList;
+typedef struct uiPreview { /* some preview UI data need to be saved in file */
+ struct uiPreview *next, *prev;
+
+ char preview_id[64]; /* defined as UI_MAX_NAME_STR */
+ short height;
+ short pad1[3];
+} uiPreview;
+
typedef struct ScrArea {
struct ScrArea *next, *prev;
@@ -241,6 +249,7 @@ typedef struct ARegion {
ListBase panels; /* Panel */
ListBase panels_category_active; /* Stack of panel categories */
ListBase ui_lists; /* uiList */
+ ListBase ui_previews; /* uiPreview */
ListBase handlers; /* wmEventHandler */
ListBase panels_category; /* Panel categories runtime */