diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-06-05 13:00:36 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-06-05 13:00:36 +0400 |
commit | 07619d8fc0cf13ee852db9a793a02b8955068636 (patch) | |
tree | cd5bed2e47e1a9b3662d3ce18016e97bd58c5700 /source/blender/editors/screen | |
parent | 50d24425cea55c8266fa01964f6348a6f1d70f80 (diff) |
with the new scalable UI. hard coded values were still used for resizing the headers, with DPI of 56 the headers could not be un-hidden.
Diffstat (limited to 'source/blender/editors/screen')
-rw-r--r-- | source/blender/editors/screen/screen_ops.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index d1d59457fd9..9e840e75578 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -1631,7 +1631,7 @@ static int region_scale_modal(bContext *C, wmOperator *op, wmEvent *event) rmd->ar->sizex= rmd->origval + delta; CLAMP(rmd->ar->sizex, 0, rmd->maxsize); - if(rmd->ar->sizex < 24) { + if(rmd->ar->sizex < UI_UNIT_X) { rmd->ar->sizex= rmd->origval; if(!(rmd->ar->flag & RGN_FLAG_HIDDEN)) ED_region_toggle_hidden(C, rmd->ar); @@ -1646,11 +1646,17 @@ static int region_scale_modal(bContext *C, wmOperator *op, wmEvent *event) rmd->ar->sizey= rmd->origval + delta; CLAMP(rmd->ar->sizey, 0, rmd->maxsize); - - if(rmd->ar->regiontype == RGN_TYPE_TOOL_PROPS) - maxsize = rmd->maxsize - ((rmd->sa->headertype==2)?48:24) - 10; - if(rmd->ar->sizey < 24 || (maxsize > 0 && (rmd->ar->sizey > maxsize)) ) { + if(rmd->ar->regiontype == RGN_TYPE_TOOL_PROPS) { + /* this calculation seems overly verbose + * can someone explain why this method is necessary? - campbell */ + maxsize = rmd->maxsize - ((rmd->sa->headertype==HEADERTOP)?UI_UNIT_Y*2:UI_UNIT_Y) - (UI_UNIT_Y/4); + } + + /* note, 'UI_UNIT_Y/4' means you need to drag the header almost + * all the way down for it to become hidden, this is done + * otherwise its too easy to do this by accident */ + if(rmd->ar->sizey < UI_UNIT_Y/4 || (maxsize > 0 && (rmd->ar->sizey > maxsize)) ) { rmd->ar->sizey= rmd->origval; if(!(rmd->ar->flag & RGN_FLAG_HIDDEN)) ED_region_toggle_hidden(C, rmd->ar); |