Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2012-12-26 17:05:39 +0400
committerTon Roosendaal <ton@blender.org>2012-12-26 17:05:39 +0400
commitfa28e50ac2a79e4aa481f659b1457e99f2f17557 (patch)
treec7633940e05de1a1296aa72c9c941518c7ecddcc /source/blender/editors/space_outliner/space_outliner.c
parent4e604642de11603ad1cff1b5b0e679e8a7c13bd9 (diff)
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.
Diffstat (limited to 'source/blender/editors/space_outliner/space_outliner.c')
-rw-r--r--source/blender/editors/space_outliner/space_outliner.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/source/blender/editors/space_outliner/space_outliner.c b/source/blender/editors/space_outliner/space_outliner.c
index ecc09a35670..4bf88376b74 100644
--- a/source/blender/editors/space_outliner/space_outliner.c
+++ b/source/blender/editors/space_outliner/space_outliner.c
@@ -67,6 +67,17 @@ static void outliner_main_area_init(wmWindowManager *wm, ARegion *ar)
ListBase *lb;
wmKeyMap *keymap;
+ /* make sure we keep the hide flags */
+ ar->v2d.scroll |= (V2D_SCROLL_RIGHT | V2D_SCROLL_BOTTOM);
+ ar->v2d.scroll &= ~(V2D_SCROLL_LEFT | V2D_SCROLL_TOP); /* prevent any noise of past */
+ ar->v2d.scroll |= V2D_SCROLL_HORIZONTAL_HIDE;
+ ar->v2d.scroll |= V2D_SCROLL_VERTICAL_HIDE;
+
+ ar->v2d.align = (V2D_ALIGN_NO_NEG_X | V2D_ALIGN_NO_POS_Y);
+ ar->v2d.keepzoom = (V2D_LOCKZOOM_X | V2D_LOCKZOOM_Y | V2D_LIMITZOOM | V2D_KEEPASPECT);
+ ar->v2d.keeptot = V2D_KEEPTOT_STRICT;
+ ar->v2d.minzoom = ar->v2d.maxzoom = 1.0f;
+
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_LIST, ar->winx, ar->winy);
/* own keymap */
@@ -410,12 +421,6 @@ static SpaceLink *outliner_new(const bContext *UNUSED(C))
BLI_addtail(&soutliner->regionbase, ar);
ar->regiontype = RGN_TYPE_WINDOW;
- ar->v2d.scroll = (V2D_SCROLL_RIGHT | V2D_SCROLL_BOTTOM_O);
- ar->v2d.align = (V2D_ALIGN_NO_NEG_X | V2D_ALIGN_NO_POS_Y);
- ar->v2d.keepzoom = (V2D_LOCKZOOM_X | V2D_LOCKZOOM_Y | V2D_LIMITZOOM | V2D_KEEPASPECT);
- ar->v2d.keeptot = V2D_KEEPTOT_STRICT;
- ar->v2d.minzoom = ar->v2d.maxzoom = 1.0f;
-
return (SpaceLink *)soutliner;
}