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:
authorJulian Eisel <eiseljulian@gmail.com>2015-09-05 20:28:24 +0300
committerJulian Eisel <eiseljulian@gmail.com>2015-09-05 20:42:05 +0300
commitb529b828306b2179baa95d5b4988f6eeaf46ded8 (patch)
tree03f50c0027a3614a0b4e0f9d3f8b8a3f5285f4d5 /source/blender/editors/interface/interface.c
parent1478ac35c743430d0b333ae9829689782baf70c2 (diff)
Fix T45944: Ctrl+Wheel to cycle values failes in toolshelf
Now, ctrl+wheel for cycling tabs is passed to hovered button if it supports cycling values (RNA menus, color/row/number/slider buttons, list boxes) This might feel a bit glitchy if ctrl+wheel is used to cycle tabs and in newly opened tab, a button with cycling support is under the mouse, which will get mouse input from this point on instead of region. Think this is still better than old behavior.
Diffstat (limited to 'source/blender/editors/interface/interface.c')
-rw-r--r--source/blender/editors/interface/interface.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index dcf114383f9..a39990ea060 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -1805,6 +1805,16 @@ bool ui_but_is_rna_valid(uiBut *but)
}
}
+/**
+ * Checks if the button supports ctrl+mousewheel cycling
+ */
+bool ui_but_supports_cycling(const uiBut *but)
+{
+ return ((ELEM(but->type, UI_BTYPE_ROW, UI_BTYPE_NUM, UI_BTYPE_NUM_SLIDER, UI_BTYPE_LISTBOX)) ||
+ (but->type == UI_BTYPE_MENU && ui_but_menu_step_poll(but)) ||
+ (but->type == UI_BTYPE_COLOR && but->a1 != -1));
+}
+
double ui_but_value_get(uiBut *but)
{
PropertyRNA *prop;