[Bf-blender-cvs] [7a02697] master: Fix T41548: Menu pulldown button behaves incorrectly on click if menu shadow width is set to 0 in theme prefs.

Bastien Montagne noreply at git.blender.org
Sun Aug 24 10:26:33 CEST 2014


Commit: 7a026971dc3f9392278898cc28d7051f34e3dd6b
Author: Bastien Montagne
Date:   Sun Aug 24 10:22:03 2014 +0200
Branches: master
https://developer.blender.org/rB7a026971dc3f9392278898cc28d7051f34e3dd6b

Fix T41548: Menu pulldown button behaves incorrectly on click if menu shadow width is set to 0 in theme prefs.

This is more like a workaround actually, we use a fixed 'margin' for height in case of search menus,
instead of using shadow width (which gave the bug with low values, and insane margins with big ones).

Note root of the issue is that if 'top' margin is too small, the first entry of the search menu
gets activated before the 'opening' click is released. This means that button will get the
KM_RELEASE event, and immediately quit (see interface_handlers.c:7945, ui_handle_menu_button()).

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

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

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

diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c
index 8ad30d0..1960c77 100644
--- a/source/blender/editors/interface/interface_regions.c
+++ b/source/blender/editors/interface/interface_regions.c
@@ -1165,8 +1165,9 @@ ARegion *ui_searchbox_create(bContext *C, ARegion *butregion, uiBut *but)
 		/* widget rect, in region coords */
 		data->bbox.xmin = width;
 		data->bbox.xmax = BLI_rcti_size_x(&ar->winrct) - width;
-		data->bbox.ymin = width;
-		data->bbox.ymax = BLI_rcti_size_y(&ar->winrct) - width;
+		/* Do not use shadow width for height, gives insane margin with big shadows, and issue T41548 with small ones */
+		data->bbox.ymin = 8 * UI_DPI_FAC;
+		data->bbox.ymax = BLI_rcti_size_y(&ar->winrct) - 8 * UI_DPI_FAC;
 		
 		/* check if button is lower half */
 		if (but->rect.ymax < BLI_rctf_cent_y(&but->block->rect)) {




More information about the Bf-blender-cvs mailing list