Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_outliner/outliner_select.c
| Show First 20 Lines • Show All 1,874 Lines • ▼ Show 20 Lines | if (!outliner_is_element_visible(active_te)) { | ||||
| } | } | ||||
| *changed = true; | *changed = true; | ||||
| } | } | ||||
| return active_te; | return active_te; | ||||
| } | } | ||||
| /* Scroll the outliner when the walk element reaches the top or bottom boundary */ | /* Scroll the outliner when the walk element reaches the top or bottom boundary */ | ||||
| static void outliner_walk_scroll(ARegion *region, TreeElement *te) | static void outliner_walk_scroll(SpaceOutliner *space_outliner, ARegion *region, TreeElement *te) | ||||
| { | { | ||||
| /* Account for the header height */ | /* Account for the header height */ | ||||
| int y_max = region->v2d.cur.ymax - UI_UNIT_Y; | int y_max = region->v2d.cur.ymax - UI_UNIT_Y; | ||||
| int y_min = region->v2d.cur.ymin; | int y_min = region->v2d.cur.ymin; | ||||
| /* Scroll if walked position is beyond the border */ | /* Scroll if walked position is beyond the border */ | ||||
| if (te->ys > y_max) { | if (te->ys > y_max) { | ||||
| outliner_scroll_view(region, te->ys - y_max); | outliner_scroll_view(space_outliner, region, te->ys - y_max); | ||||
| } | } | ||||
| else if (te->ys < y_min) { | else if (te->ys < y_min) { | ||||
| outliner_scroll_view(region, -(y_min - te->ys)); | outliner_scroll_view(space_outliner, region, -(y_min - te->ys)); | ||||
| } | } | ||||
| } | } | ||||
| static int outliner_walk_select_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) | static int outliner_walk_select_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) | ||||
| { | { | ||||
| SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); | SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); | ||||
| ARegion *region = CTX_wm_region(C); | ARegion *region = CTX_wm_region(C); | ||||
| Show All 10 Lines | static int outliner_walk_select_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) | ||||
| } | } | ||||
| outliner_item_select(C, | outliner_item_select(C, | ||||
| space_outliner, | space_outliner, | ||||
| active_te, | active_te, | ||||
| OL_ITEM_SELECT | OL_ITEM_ACTIVATE | (extend ? OL_ITEM_EXTEND : 0)); | OL_ITEM_SELECT | OL_ITEM_ACTIVATE | (extend ? OL_ITEM_EXTEND : 0)); | ||||
| /* Scroll outliner to focus on walk element */ | /* Scroll outliner to focus on walk element */ | ||||
| outliner_walk_scroll(region, active_te); | outliner_walk_scroll(space_outliner, region, active_te); | ||||
| ED_outliner_select_sync_from_outliner(C, space_outliner); | ED_outliner_select_sync_from_outliner(C, space_outliner); | ||||
| outliner_tag_redraw_avoid_rebuild_on_open_change(space_outliner, region); | outliner_tag_redraw_avoid_rebuild_on_open_change(space_outliner, region); | ||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| void OUTLINER_OT_select_walk(wmOperatorType *ot) | void OUTLINER_OT_select_walk(wmOperatorType *ot) | ||||
| Show All 23 Lines | |||||