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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-03-13 16:38:41 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-03-13 16:38:41 +0300
commit4c3d64116e2c74315afea7b005ffaf320178337f (patch)
tree86d6db3a35fd5847387c2970ba0d160d9f92b0a7 /source/blender/editors/interface/view2d.c
parenta4793a3b4ac298a651f7bab0bafd809287647509 (diff)
2.5: UI Layout Engine, initial code.
* As a test, used by: * Object buttons, tried to make it match the mockup. * Text window header. * Text window properties panel. * Panel interaction with view2d is still problematic, need to make this work properly still. * Templates are very basic, the ones there are simple but already can follow the object buttons mockup quite closely. * It's based on a three level system: panels, templates and items. To get an idea of what that means in practice, see: http://wiki.blender.org/index.php/BlenderDev/Blender2.5/UI_LayoutEngine#Panels.2C_Templates_and_Items
Diffstat (limited to 'source/blender/editors/interface/view2d.c')
-rw-r--r--source/blender/editors/interface/view2d.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c
index 6e738942e29..d81d9eb79ca 100644
--- a/source/blender/editors/interface/view2d.c
+++ b/source/blender/editors/interface/view2d.c
@@ -249,9 +249,30 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy)
v2d->tot.ymin= -336.0f*((float)winy)/(float)winx;
v2d->cur= v2d->tot;
+ }
+ break;
+
+ /* panels view, with free/horizontal/vertical align */
+ case V2D_COMMONVIEW_PANELS_UI:
+ {
+ /* for now, aspect ratio should be maintained, and zoom is clamped within sane default limits */
+ v2d->keepzoom= (V2D_LOCKZOOM_X|V2D_LOCKZOOM_Y|V2D_KEEPASPECT|V2D_KEEPZOOM);
+ v2d->minzoom= 0.5f;
+ v2d->maxzoom= 2.0f;
+
+ v2d->align= (V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_POS_Y);
+ v2d->keeptot= V2D_KEEPTOT_BOUNDS;
+ v2d->tot.xmin= 0.0f;
+ v2d->tot.xmax= winx;
+
+ v2d->tot.ymax= 0.0f;
+ v2d->tot.ymin= -winy;
+
+ v2d->cur= v2d->tot;
}
break;
+
/* other view types are completely defined using their own settings already */
default:
/* we don't do anything here, as settings should be fine, but just make sure that rect */