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
This commit is contained in:
committed by
Harley Acheson
parent
daa417d304
commit
3e29f3eaa2
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user