diff options
author | Ton Roosendaal <ton@blender.org> | 2009-04-10 21:39:37 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2009-04-10 21:39:37 +0400 |
commit | a14630c9d37a3de8adc3f53ec16cb668bef75138 (patch) | |
tree | 8df41516b226c0c42e63cbdee2456f2d505da0ba /source | |
parent | 4e81404d7eb00d7373ea8e4c01ae8bdfad287d72 (diff) |
2.5
Quick hack to enable zoom in buttons window again.
It uses bad old conventions for fixed panel width still, view2d has
to be tweaked for new system. But, it shows layout to work. :)
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/interface/interface_layout.c | 2 | ||||
-rw-r--r-- | source/blender/editors/interface/view2d.c | 21 |
2 files changed, 20 insertions, 3 deletions
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index f2bab0284a2..52250ca2559 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -941,7 +941,7 @@ void uiRegionPanelLayout(const bContext *C, ARegion *ar, int vertical, char *con block= uiBeginBlock(C, ar, pt->idname, UI_EMBOSS, UI_HELV); if(vertical) - w= (ar->type->minsizex)? ar->type->minsizex-12: ar->winx-12; + w= (ar->type->minsizex)? ar->type->minsizex-12: block->aspect*ar->winx-12; else w= (ar->type->minsizex)? ar->type->minsizex-12: UI_PANEL_WIDTH-12; diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index 34c8bfaab74..3b503f00fd3 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -155,6 +155,23 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy) { short tot_changed= 0; + /* XXX always set state vars for buttonsview, this is hardcoded */ + switch (type) { + /* 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_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; + } + break; + } + + /* initialise data if there is a need for such */ if ((v2d->flag & V2D_IS_INITIALISED) == 0) { /* set initialised flag so that View2D doesn't get reinitialised next time again */ @@ -257,12 +274,12 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy) 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->keepzoom= (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_STRICT; + v2d->keeptot= V2D_KEEPTOT_BOUNDS; v2d->tot.xmin= 0.0f; v2d->tot.xmax= winx; |