From fa28e50ac2a79e4aa481f659b1457e99f2f17557 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Wed, 26 Dec 2012 13:05:39 +0000 Subject: Region scrollbar fix! Now scrollbars correctly hide and show, making space for the actual contents in a region. It solves several old hacks, and puts view2d code a bit more back in control as well. Implementation notes: - The view2d mask feature is working again - The #define V2D_SCROLL_HORIZONTAL_HIDE means: "turn on hiding". - Code for UI_view2d_region_reinit() is enforcing better standard view settings But... two hack/patches needed to be added: - Region panel drawing: if after generating the button panels it appears a scroller hides or reveils, it calls all the generating code again. (a simple scale doesn't work due to rounding differences in layout code) - View2d code that maps 'tot' and 'cur' rects: if this code detects that the mask changes, it calcs the map code again. Also a bugfix (issue in 2.65) - The left/bottom area split widget was drawing 1 pixel too large sometimes, leaving bad trails on moving area dividers. --- source/blender/editors/space_userpref/space_userpref.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/space_userpref') diff --git a/source/blender/editors/space_userpref/space_userpref.c b/source/blender/editors/space_userpref/space_userpref.c index 1ea3876f5cc..6560f218002 100644 --- a/source/blender/editors/space_userpref/space_userpref.c +++ b/source/blender/editors/space_userpref/space_userpref.c @@ -105,14 +105,14 @@ static SpaceLink *userpref_duplicate(SpaceLink *sl) /* add handlers, stuff you only do once or on area/region changes */ static void userpref_main_area_init(wmWindowManager *wm, ARegion *ar) { + ar->v2d.flag &= ~V2D_IS_INITIALISED; + ar->v2d.scroll = V2D_SCROLL_RIGHT | V2D_SCROLL_VERTICAL_HIDE; + ED_region_panels_init(wm, ar); } static void userpref_main_area_draw(const bContext *C, ARegion *ar) { - /* this solves "vibrating UI" bug #25422 */ - UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_PANELS_UI, ar->winx, ar->winy); - ED_region_panels(C, ar, 1, NULL, -1); } -- cgit v1.2.3