diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-07-11 00:43:32 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-07-11 00:43:32 +0400 |
commit | 395025d67ec9374039703d591d6d44b664f79dcd (patch) | |
tree | 73b800363c759d889c1ff11d55e3a5f7b4256fe0 /source/blender/editors | |
parent | ad59d04c77a9b096fd4d7454b0d59e9bf30ffca6 (diff) |
2.5:
* Default panel zoom level user preference, when creating
new button windows or pressing home-key to reset. Patch
by Matt D., thanks!
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/interface/interface.c | 2 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_style.c | 2 | ||||
-rw-r--r-- | source/blender/editors/interface/view2d.c | 9 | ||||
-rw-r--r-- | source/blender/editors/interface/view2d_ops.c | 11 |
4 files changed, 16 insertions, 8 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 391be4ba591..6f86e3e809a 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -1615,7 +1615,7 @@ uiBlock *uiBeginBlock(const bContext *C, ARegion *region, const char *name, shor block= MEM_callocN(sizeof(uiBlock), "uiBlock"); block->active= 1; block->dt= dt; - block->evil_C= C; // XXX + block->evil_C= (void*)C; // XXX BLI_strncpy(block->name, name, sizeof(block->name)); if(region) diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c index 9ff1f2d6b29..83eb8a32701 100644 --- a/source/blender/editors/interface/interface_style.c +++ b/source/blender/editors/interface/interface_style.c @@ -89,6 +89,8 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name) BLI_addtail(styles, style); BLI_strncpy(style->name, name, MAX_STYLE_NAME); + style->panelzoom= 1.0; + style->paneltitle.uifont_id= UIFONT_DEFAULT; style->paneltitle.points= 13; style->paneltitle.shadow= 5; diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index fcac1987fdc..e0e2af5472d 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -155,7 +155,8 @@ static void view2d_masks(View2D *v2d) void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy) { short tot_changed= 0; - + uiStyle *style= U.uistyles.first; + /* 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 */ @@ -250,7 +251,11 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy) v2d->tot.ymax= 0.0f; v2d->tot.ymin= -winy; - v2d->cur= v2d->tot; + v2d->cur.xmin= 0.0f; + v2d->cur.xmax= winx*style->panelzoom; + + v2d->cur.ymax= 0.0f; + v2d->cur.ymin= -winy*style->panelzoom; } break; diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c index 101d89da618..54ab0d9ef61 100644 --- a/source/blender/editors/interface/view2d_ops.c +++ b/source/blender/editors/interface/view2d_ops.c @@ -1273,6 +1273,7 @@ void VIEW2D_OT_scroller_activate(wmOperatorType *ot) static int reset_exec(bContext *C, wmOperator *op) { + uiStyle *style= U.uistyles.first; ARegion *ar= CTX_wm_region(C); View2D *v2d= &ar->v2d; int winx, winy; @@ -1283,26 +1284,26 @@ static int reset_exec(bContext *C, wmOperator *op) v2d->cur.xmax= v2d->cur.xmin + winx; v2d->cur.ymax= v2d->cur.ymin + winy; - + /* align */ if(v2d->align) { /* posx and negx flags are mutually exclusive, so watch out */ if ((v2d->align & V2D_ALIGN_NO_POS_X) && !(v2d->align & V2D_ALIGN_NO_NEG_X)) { v2d->cur.xmax= 0.0f; - v2d->cur.xmin= v2d->winx; + v2d->cur.xmin= v2d->winx*style->panelzoom; } else if ((v2d->align & V2D_ALIGN_NO_NEG_X) && !(v2d->align & V2D_ALIGN_NO_POS_X)) { - v2d->cur.xmax= v2d->cur.xmax - v2d->cur.xmin; + v2d->cur.xmax= (v2d->cur.xmax - v2d->cur.xmin)*style->panelzoom; v2d->cur.xmin= 0.0f; } /* - posx and negx flags are mutually exclusive, so watch out */ if ((v2d->align & V2D_ALIGN_NO_POS_Y) && !(v2d->align & V2D_ALIGN_NO_NEG_Y)) { v2d->cur.ymax= 0.0f; - v2d->cur.ymin= -v2d->winy; + v2d->cur.ymin= -v2d->winy*style->panelzoom; } else if ((v2d->align & V2D_ALIGN_NO_NEG_Y) && !(v2d->align & V2D_ALIGN_NO_POS_Y)) { - v2d->cur.ymax= v2d->cur.ymax - v2d->cur.ymin; + v2d->cur.ymax= (v2d->cur.ymax - v2d->cur.ymin)*style->panelzoom; v2d->cur.ymin= 0.0f; } } |