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
path: root/source
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2013-12-10 19:18:58 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2013-12-10 19:23:16 +0400
commit03059f31d80caae248d4cc28092d3c2913d6833a (patch)
treeaf04b7fa58fd9d1fd26d5743a729edec57bd6714 /source
parenta1031d5dd529885fea53b0908a912585d65c4567 (diff)
uiList: Small tweak to drag-resize (switch to auto-size mode).
When you drag past the smallest size of the list, it switches back to auto-size mode. This commit makes wider the gap between smallest size and auto-size activation, previously it could switch to auto-size a bit too easily...
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/interface/interface_templates.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 982693daca6..02dff9695fe 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -2664,8 +2664,11 @@ static void prepare_list(uiList *ui_list, int len, int activei, int rows, int ma
if (columns == 0)
columns = 9;
- if (ui_list->list_grip >= rows) {
- maxrows = rows = ui_list->list_grip;
+ if (ui_list->list_grip >= (rows - 1) && ui_list->list_grip != 0) {
+ /* Only enable auto-size mode when we have dragged one row away from minimum size.
+ * Avoids to switch too easily to auto-size mode when resizing to minimum size...
+ */
+ maxrows = rows = max_ii(ui_list->list_grip, rows);
}
else {
ui_list->list_grip = 0; /* Reset to auto-size mode. */