diff options
author | Joshua Leung <aligorith@gmail.com> | 2008-12-17 13:25:02 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2008-12-17 13:25:02 +0300 |
commit | 616edcca1222c25b53c13d4da4c3af4f7a0f349a (patch) | |
tree | 7a98f01066c645fcb080e8a381f58d36bd7db585 /source/blender/editors/space_buttons | |
parent | c1379f6613d327a7604700007afd52e36f48080a (diff) |
View2D: Cleanup of presets and fixed errors in various views
Now, preset view configurations are only to be used if they define all (scrollers not included) relevant settings for the view they are set for. This should be less confusing than in the previous situation with V2D_COMMONVIEW_TIMELINE stuff.
One implication of this though, is that all Animation Editors (for example), will have to define their own version of the relatively commonly shared info. However, given the great diversity in the range of settings each have, this should not be too much of an issue.
Also, added a 'standard' view config for main 'window' regions. At this stage, it is recommended that this view config should be used only as a placeholder template on which a set of custom settings could be based. I've put it into use for the buttons window/scripts window/info window so far.
Diffstat (limited to 'source/blender/editors/space_buttons')
-rw-r--r-- | source/blender/editors/space_buttons/space_buttons.c | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c index a042e915f13..9ed56afec18 100644 --- a/source/blender/editors/space_buttons/space_buttons.c +++ b/source/blender/editors/space_buttons/space_buttons.c @@ -84,27 +84,29 @@ static SpaceLink *buttons_new(void) BLI_addtail(&sbuts->regionbase, ar); ar->regiontype= RGN_TYPE_WINDOW; +#if 0 // disabled, as this currently draws badly in new system /* buts space goes from (0,0) to (1280, 228) */ + ar->v2d.tot.xmin= 0.0f; + ar->v2d.tot.ymin= 0.0f; + ar->v2d.tot.xmax= 1279.0f; + ar->v2d.tot.ymax= 228.0f; - sbuts->v2d.tot.xmin= 0.0f; - sbuts->v2d.tot.ymin= 0.0f; - sbuts->v2d.tot.xmax= 1279.0f; - sbuts->v2d.tot.ymax= 228.0f; + ar->v2d.cur= sbuts->v2d.tot; - sbuts->v2d.min[0]= 256.0f; - sbuts->v2d.min[1]= 42.0f; + ar->v2d.min[0]= 256.0f; + ar->v2d.min[1]= 42.0f; - sbuts->v2d.max[0]= 2048.0f; - sbuts->v2d.max[1]= 450.0f; + ar->v2d.max[0]= 2048.0f; + ar->v2d.max[1]= 450.0f; - sbuts->v2d.minzoom= 0.5f; - sbuts->v2d.maxzoom= 1.21f; + ar->v2d.minzoom= 0.5f; + ar->v2d.maxzoom= 1.21f; - sbuts->v2d.scroll= 0; // TODO: will we need scrollbars? - sbuts->v2d.align= V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_NEG_Y; - sbuts->v2d.keepzoom= V2D_KEEPZOOM|V2D_KEEPASPECT; - sbuts->v2d.keeptot= 1; - sbuts->v2d.cur= sbuts->v2d.tot; + ar->v2d.scroll= 0; // TODO: will we need scrollbars? + ar->v2d.align= V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_NEG_Y; + ar->v2d.keepzoom= V2D_KEEPZOOM|V2D_KEEPASPECT; + ar->v2d.keeptot= V2D_KEEPTOT_BOUNDS; +#endif return (SpaceLink *)sbuts; @@ -146,7 +148,7 @@ static void buttons_main_area_init(wmWindowManager *wm, ARegion *ar) { ListBase *keymap; - UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy); + UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_STANDARD, ar->winx, ar->winy); /* own keymap */ keymap= WM_keymap_listbase(wm, "Buttons", SPACE_BUTS, 0); /* XXX weak? */ |