diff --git a/source/blender/editors/screen/area.cc b/source/blender/editors/screen/area.cc index 879bcf3dea9..7f3a98037b6 100644 --- a/source/blender/editors/screen/area.cc +++ b/source/blender/editors/screen/area.cc @@ -3378,6 +3378,16 @@ void ED_region_panels_init(wmWindowManager *wm, ARegion *region) { UI_view2d_region_reinit(®ion->v2d, V2D_COMMONVIEW_PANELS_UI, region->winx, region->winy); + /* Place scroll bars to the left if left-aligned, right if right-aligned. */ + if (region->alignment & RGN_ALIGN_LEFT) { + region->v2d.scroll &= ~V2D_SCROLL_RIGHT; + region->v2d.scroll |= V2D_SCROLL_LEFT; + } + else if (region->alignment & RGN_ALIGN_RIGHT) { + region->v2d.scroll &= ~V2D_SCROLL_LEFT; + region->v2d.scroll |= V2D_SCROLL_RIGHT; + } + wmKeyMap *keymap = WM_keymap_ensure( wm->defaultconf, "View2D Buttons List", SPACE_EMPTY, RGN_TYPE_WINDOW); WM_event_add_keymap_handler(®ion->runtime->handlers, keymap);