diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2014-04-02 15:09:43 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2014-04-02 15:09:43 +0400 |
commit | 9b3bd5582be99e26b6c3651f66db516982bc8461 (patch) | |
tree | 66178e37290f42cca50837ecf46c0010a675d8bc /source/blender/makesdna/DNA_screen_types.h | |
parent | 4faef1e10c9d1177eae6350b4471206e91afaff8 (diff) |
Replace resize code of image scopes by use of new GRIP button.
This deduplicates/simplifies some code. Also cleanup up a bit scopes UI code!
Use new GRIP button for uiList grab-resize.
This allows us to greatly simplifies the code, and get rid of a few hacks in uiList event handling!
Note autosize mode of uiList is now trigered by any value of list_grip below a given threshold, rather than the fixed zero value...
Reviewers: brecht
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D343
Diffstat (limited to 'source/blender/makesdna/DNA_screen_types.h')
-rw-r--r-- | source/blender/makesdna/DNA_screen_types.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/makesdna/DNA_screen_types.h b/source/blender/makesdna/DNA_screen_types.h index f676399ac1b..41d26e34f03 100644 --- a/source/blender/makesdna/DNA_screen_types.h +++ b/source/blender/makesdna/DNA_screen_types.h @@ -154,6 +154,12 @@ typedef struct uiListDyn { int items_len; /* Number of items in collection. */ int items_shown; /* Number of items actually visible after filtering. */ + /* Those are temp data used during drag-resize with GRIP button (they are in pixels, the meaningful data is the + * difference between resize_prev and resize)... + */ + int resize; + int resize_prev; + /* Filtering data. */ int *items_filter_flags; /* items_len length. */ int *items_filter_neworder; /* org_idx -> new_idx, items_len length. */ @@ -319,9 +325,11 @@ enum { /* uiList flag */ enum { UILST_SCROLL_TO_ACTIVE_ITEM = 1 << 0, /* Scroll list to make active item visible. */ - UILST_RESIZING = 1 << 1, /* We are currently resizing, deactivate autosize! */ }; +/* Value (in number of items) we have to go below minimum shown items to enable auto size. */ +#define UI_LIST_AUTO_SIZE_THRESHOLD 1 + /* uiList filter flags (dyn_data) */ enum { UILST_FLT_ITEM = 1 << 31, /* This item has passed the filter process successfully. */ |