[Bf-blender-cvs] [03059f3] master: uiList: Small tweak to drag-resize (switch to auto-size mode).

Bastien Montagne noreply at git.blender.org
Tue Dec 10 16:22:59 CET 2013


Commit: 03059f31d80caae248d4cc28092d3c2913d6833a
Author: Bastien Montagne
Date:   Tue Dec 10 16:18:58 2013 +0100
http://developer.blender.org/rB03059f31d80caae248d4cc28092d3c2913d6833a

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...

===================================================================

M	source/blender/editors/interface/interface_templates.c

===================================================================

diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 982693d..02dff96 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. */




More information about the Bf-blender-cvs mailing list