Keymap: Special keymap for clip editor scrubbing area
Reviewers: sergey Differential Revision: https://developer.blender.org/D4825
This commit is contained in:
@@ -155,6 +155,13 @@ void ED_scrubbing_draw(const ARegion *ar,
|
||||
GPU_matrix_pop_projection();
|
||||
}
|
||||
|
||||
bool ED_event_in_scrubbing_region(const ARegion *ar, const wmEvent *event)
|
||||
{
|
||||
rcti rect = ar->winrct;
|
||||
rect.ymin = rect.ymax - UI_SCRUBBING_MARGIN_Y;
|
||||
return BLI_rcti_isect_pt(&rect, event->x, event->y);
|
||||
}
|
||||
|
||||
void ED_channel_search_draw(const bContext *C, ARegion *ar, bDopeSheet *dopesheet)
|
||||
{
|
||||
GPU_matrix_push_projection();
|
||||
|
||||
@@ -27,12 +27,15 @@
|
||||
struct bContext;
|
||||
struct View2DGrid;
|
||||
struct bDopeSheet;
|
||||
struct wmEvent;
|
||||
|
||||
void ED_scrubbing_draw(const struct ARegion *ar,
|
||||
const struct Scene *scene,
|
||||
bool display_seconds,
|
||||
bool discrete_frames);
|
||||
|
||||
bool ED_event_in_scrubbing_region(const struct ARegion *ar, const struct wmEvent *event);
|
||||
|
||||
void ED_channel_search_draw(const struct bContext *C,
|
||||
struct ARegion *ar,
|
||||
struct bDopeSheet *dopesheet);
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
#include "ED_screen.h"
|
||||
#include "ED_screen_types.h"
|
||||
#include "ED_space_api.h"
|
||||
#include "ED_scrubbing.h"
|
||||
|
||||
#include "GPU_immediate.h"
|
||||
#include "GPU_immediate_util.h"
|
||||
@@ -1566,13 +1567,6 @@ static bool event_in_markers_region(const ARegion *ar, const wmEvent *event)
|
||||
return BLI_rcti_isect_pt(&rect, event->x, event->y);
|
||||
}
|
||||
|
||||
static bool event_in_scrubbing_region(const ARegion *ar, const wmEvent *event)
|
||||
{
|
||||
rcti rect = ar->winrct;
|
||||
rect.ymin = rect.ymax - UI_SCRUBBING_MARGIN_Y;
|
||||
return BLI_rcti_isect_pt(&rect, event->x, event->y);
|
||||
}
|
||||
|
||||
/**
|
||||
* \param ar: Region, may be NULL when adding handlers for \a sa.
|
||||
*/
|
||||
@@ -1620,7 +1614,7 @@ static void ed_default_handlers(
|
||||
|
||||
/* time-scrubbing */
|
||||
keymap = WM_keymap_ensure(wm->defaultconf, "Scrubbing", 0, 0);
|
||||
WM_event_add_keymap_handler_poll(handlers, keymap, event_in_scrubbing_region);
|
||||
WM_event_add_keymap_handler_poll(handlers, keymap, ED_event_in_scrubbing_region);
|
||||
|
||||
/* frame changing and timeline operators (for time spaces) */
|
||||
keymap = WM_keymap_ensure(wm->defaultconf, "Animation", 0, 0);
|
||||
|
||||
@@ -1002,9 +1002,13 @@ static void clip_preview_region_init(wmWindowManager *wm, ARegion *ar)
|
||||
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy);
|
||||
|
||||
/* own keymap */
|
||||
|
||||
keymap = WM_keymap_ensure(wm->defaultconf, "Clip", SPACE_CLIP, 0);
|
||||
WM_event_add_keymap_handler_v2d_mask(&ar->handlers, keymap);
|
||||
|
||||
keymap = WM_keymap_ensure(wm->defaultconf, "Clip Scrubbing", SPACE_CLIP, RGN_TYPE_PREVIEW);
|
||||
WM_event_add_keymap_handler_poll(&ar->handlers, keymap, ED_event_in_scrubbing_region);
|
||||
|
||||
keymap = WM_keymap_ensure(wm->defaultconf, "Clip Graph Editor", SPACE_CLIP, 0);
|
||||
WM_event_add_keymap_handler_v2d_mask(&ar->handlers, keymap);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user