diff --git a/release/datafiles/icons_svg/gesture_pan.svg b/release/datafiles/icons_svg/gesture_pan.svg new file mode 100644 index 00000000000..821ab527af2 --- /dev/null +++ b/release/datafiles/icons_svg/gesture_pan.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/release/datafiles/icons_svg/gesture_rotate.svg b/release/datafiles/icons_svg/gesture_rotate.svg new file mode 100644 index 00000000000..94256866194 --- /dev/null +++ b/release/datafiles/icons_svg/gesture_rotate.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/release/datafiles/icons_svg/gesture_zoom.svg b/release/datafiles/icons_svg/gesture_zoom.svg new file mode 100644 index 00000000000..23793d2e590 --- /dev/null +++ b/release/datafiles/icons_svg/gesture_zoom.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/source/blender/editors/datafiles/CMakeLists.txt b/source/blender/editors/datafiles/CMakeLists.txt index 81f3ad19942..c1f793c134f 100644 --- a/source/blender/editors/datafiles/CMakeLists.txt +++ b/source/blender/editors/datafiles/CMakeLists.txt @@ -388,6 +388,9 @@ if(WITH_BLENDER) fund geometry_nodes geometry_set + gesture_pan + gesture_rotate + gesture_zoom ghost_disabled ghost_enabled gizmo diff --git a/source/blender/editors/include/UI_icons.hh b/source/blender/editors/include/UI_icons.hh index 0649f228956..b790928b0a6 100644 --- a/source/blender/editors/include/UI_icons.hh +++ b/source/blender/editors/include/UI_icons.hh @@ -849,6 +849,9 @@ DEF_ICON(KEY_TAB_FILLED) DEF_ICON(KEY_TAB) DEF_ICON(KEY_WINDOWS_FILLED) DEF_ICON(KEY_WINDOWS) +DEF_ICON(GESTURE_PAN) +DEF_ICON(GESTURE_ROTATE) +DEF_ICON(GESTURE_ZOOM) /* INTERNET */ DEF_ICON_FUND(FUND) @@ -1067,6 +1070,10 @@ DEF_ICON_COLOR(EVENT_EQUAL) DEF_ICON_COLOR(EVENT_LEFTBRACKET) DEF_ICON_COLOR(EVENT_RIGHTBRACKET) +DEF_ICON_COLOR(EVENT_PAD_PAN) +DEF_ICON_COLOR(EVENT_PAD_ROTATE) +DEF_ICON_COLOR(EVENT_PAD_ZOOM) + DEF_ICON_COLOR(EVENT_NDOF_BUTTON_V1) DEF_ICON_COLOR(EVENT_NDOF_BUTTON_V2) DEF_ICON_COLOR(EVENT_NDOF_BUTTON_V3) diff --git a/source/blender/editors/interface/interface_icons.cc b/source/blender/editors/interface/interface_icons.cc index 0b3b63d399b..b766f2adbee 100644 --- a/source/blender/editors/interface/interface_icons.cc +++ b/source/blender/editors/interface/interface_icons.cc @@ -858,6 +858,10 @@ static void init_event_icons() INIT_EVENT_ICON(ICON_EVENT_LEFTBRACKET, EVT_LEFTBRACKETKEY, KM_ANY); INIT_EVENT_ICON(ICON_EVENT_RIGHTBRACKET, EVT_RIGHTBRACKETKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_PAD_PAN, MOUSEPAN, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_PAD_ROTATE, MOUSEROTATE, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_PAD_ZOOM, MOUSEZOOM, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_F13, EVT_F13KEY, KM_ANY); INIT_EVENT_ICON(ICON_EVENT_F14, EVT_F14KEY, KM_ANY); INIT_EVENT_ICON(ICON_EVENT_F15, EVT_F15KEY, KM_ANY); diff --git a/source/blender/editors/interface/interface_icons_event.cc b/source/blender/editors/interface/interface_icons_event.cc index 93f91ac153f..ac26406e2d8 100644 --- a/source/blender/editors/interface/interface_icons_event.cc +++ b/source/blender/editors/interface/interface_icons_event.cc @@ -120,6 +120,17 @@ static void icon_draw_rect_input_text(const rctf *rect, BLF_draw(font_id, str, BLF_DRAW_STR_DUMMY_MAX); } +static void icon_draw_rect_input_icon(const rctf *rect, + const int icon, + const float aspect, + const float alpha, + const bool inverted, + const int icon_bg = ICON_KEY_EMPTY1) +{ + icon_draw_icon(rect, icon_bg, aspect, alpha, inverted); + icon_draw_icon(rect, icon, aspect, alpha, false); +} + float ui_event_icon_offset(const int icon_id) { const enum { @@ -469,6 +480,15 @@ void icon_draw_rect_input(const float x, else if (icon_id == ICON_EVENT_RIGHTBRACKET) { icon_draw_rect_input_text(&rect, "]", aspect, alpha, inverted); } + else if (icon_id == ICON_EVENT_PAD_PAN) { + icon_draw_rect_input_icon(&rect, ICON_GESTURE_PAN, aspect, alpha, inverted); + } + else if (icon_id == ICON_EVENT_PAD_ROTATE) { + icon_draw_rect_input_icon(&rect, ICON_GESTURE_ROTATE, aspect, alpha, inverted); + } + else if (icon_id == ICON_EVENT_PAD_ZOOM) { + icon_draw_rect_input_icon(&rect, ICON_GESTURE_ZOOM, aspect, alpha, inverted); + } else if (icon_id >= ICON_EVENT_NDOF_BUTTON_V1 && icon_id <= ICON_EVENT_NDOF_BUTTON_MINUS) { if (/* `(icon_id >= ICON_EVENT_NDOF_BUTTON_V1) &&` */ (icon_id <= ICON_EVENT_NDOF_BUTTON_V3)) { char str[7];