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>2014-08-24 12:22:03 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2014-08-24 12:22:03 +0400
commit7a026971dc3f9392278898cc28d7051f34e3dd6b (patch)
tree84b56fe4233dd4d8fff2a350ca88d514c696c590 /source
parent9541f75200a3aa7c72244c0efa6eddc17664c1e1 (diff)
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()).
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/interface/interface_regions.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c
index 8ad30d05197..1960c77bc95 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)) {