From 3e29f3eaa28dfb91e92fe881ba4579e8472dfd0d Mon Sep 17 00:00:00 2001 From: Harley Acheson Date: Mon, 24 Mar 2025 20:45:13 +0100 Subject: [PATCH] UI: Scroll Bars on the Left Side of Left-Aligned Regions Toolbars and some other regions are aligned to the left sides of their areas and have an (often hidden) right edge that can be dragged to resize or hide it. If there isn't enough vertical space to show all of its contents then you also get a scroll bar along that same edge. These two things conflict badly and is almost impossible to use with a tablet pen. The mouse cursor changes to indicate dragging over the scrollbar but doesn't work. Dragging the scoll bar requires doing so to the right of it. This PR moves the scroll bars to the left side of these left- aligned areas. They are correctly changed to the right side if you flip the region. Pull Request: https://projects.blender.org/blender/blender/pulls/136218 --- source/blender/editors/screen/area.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) 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);