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>2013-08-27 19:27:41 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2013-08-27 19:27:41 +0400
commit6b51c274149d854f57f2f1865578942a87e78869 (patch)
treefa73ee4d1547729da976226a0d7723f2c73c2ab0 /source/blender/makesdna
parent07aaf4a90a906f5e1f7681db6f1067e286ffe568 (diff)
uiLists enhacements: dragresize and better GRID layout.
Many thanks to Brecht for the review! * You can now drag-resize uiLists (in default or grid layouts). ** Note about "default" size: when you drag below minimal size of the uiList, it will automatically reset to automatic sizing (i.e. size between rows and maxrows, depending on the number of items to show). This often means (e.g. in Materials list with many mat slots) that the list will grow again to maxrows! * Grid uiLists now have a customizable number of columns (previously it was a fixed value of 9), and they will respect the rows/maxrows settings as well (i.e. show a scrollbar when needed), instead of growing indefinitly!
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r--source/blender/makesdna/DNA_screen_types.h39
1 files changed, 29 insertions, 10 deletions
diff --git a/source/blender/makesdna/DNA_screen_types.h b/source/blender/makesdna/DNA_screen_types.h
index 9d840ad13e8..c15deaeb137 100644
--- a/source/blender/makesdna/DNA_screen_types.h
+++ b/source/blender/makesdna/DNA_screen_types.h
@@ -112,22 +112,36 @@ typedef struct Panel { /* the part from uiBlock that needs saved in file */
void *activedata; /* runtime for panel manipulation */
} Panel;
-typedef struct uiList { /* some list UI data need to be saved in file */
+/* uiList dynamic data... */
+/* These two Lines with # tell makesdna this struct can be excluded. */
+#
+#
+typedef struct uiListDyn {
+ int height; /* Number of rows needed to draw all elements. */
+ int visual_height; /* Actual visual height of the list (in rows). */
+ int visual_height_min; /* Minimal visual height of the list (in rows). */
+
+ int items_len; /* Number of items in collection. */
+ int items_shown; /* Number of items actually visible after filtering. */
+} uiListDyn;
+
+typedef struct uiList { /* some list UI data need to be saved in file */
struct uiList *next, *prev;
- struct uiListType *type; /* runtime */
- void *padp;
+ struct uiListType *type; /* runtime */
- char list_id[64]; /* defined as UI_MAX_NAME_STR */
+ char list_id[64]; /* defined as UI_MAX_NAME_STR */
- int layout_type; /* How items are layedout in the list */
- int padi;
+ int layout_type; /* How items are layedout in the list */
+ int flag;
int list_scroll;
- int list_size;
+ int list_grip;
int list_last_len;
- int list_grip_size;
-/* char list_search[64]; */
+ int padi1;
+
+ /* Dynamic data (runtime). */
+ uiListDyn *dyn_data;
} uiList;
typedef struct ScrArea {
@@ -232,13 +246,18 @@ typedef struct ARegion {
#define PNL_DEFAULT_CLOSED 1
#define PNL_NO_HEADER 2
-/* uilist layout_type */
+/* uiList layout_type */
enum {
UILST_LAYOUT_DEFAULT = 0,
UILST_LAYOUT_COMPACT = 1,
UILST_LAYOUT_GRID = 2,
};
+/* uiList flag */
+enum {
+ UILST_SCROLL_TO_ACTIVE_ITEM = 1 << 0, /* Scroll list to make active item visible. */
+};
+
/* regiontype, first two are the default set */
/* Do NOT change order, append on end. Types are hardcoded needed */
enum {