Fix #110853: UI: Support adjusting color picker with Trackpad

Adds the ability to change Color Picker HSL values with Trackpad using
MOUSEPAN.

Pull Request: https://projects.blender.org/blender/blender/pulls/110928
This commit is contained in:
YimingWu
2025-02-07 23:52:06 +01:00
committed by Harley Acheson
parent 1a603602e7
commit 9692c762c5

View File

@@ -20,6 +20,7 @@
#include "BLI_string.h"
#include "BLI_utildefines.h"
#include "WM_api.hh"
#include "WM_types.hh"
#include "RNA_access.hh"
@@ -835,11 +836,18 @@ static int ui_colorpicker_wheel_cb(const bContext * /*C*/, uiBlock *block, const
/* Increase/Decrease the Color HSV Value component using the mouse wheel. */
float add = 0.0f;
if (event->type == WHEELUPMOUSE) {
add = 0.05f;
}
else if (event->type == WHEELDOWNMOUSE) {
add = -0.05f;
switch (event->type) {
case WHEELUPMOUSE:
add = 0.05f;
break;
case WHEELDOWNMOUSE:
add = -0.05f;
break;
case MOUSEPAN:
add = 0.005f * WM_event_absolute_delta_y(event) / UI_SCALE_FAC;
break;
default:
break;
}
if (add != 0.0f) {