diff options
author | Ton Roosendaal <ton@blender.org> | 2009-07-03 17:21:09 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2009-07-03 17:21:09 +0400 |
commit | ea287fc4ec7f52a690730eb890c1c548d1d60773 (patch) | |
tree | b2ec12b51487a8f493f1c5de66bf8f6f78f30224 /source/blender/editors/interface/view2d.c | |
parent | 3c6f957097cec1bc8f7e64af304cc8dec12b2158 (diff) |
2.5
More scroller work:
- Added subtle arrow widgets to denote a scroller can zoom the view.
- Made zoom symmetric (old convention to only zoom "one side" just
worked badly)
Diffstat (limited to 'source/blender/editors/interface/view2d.c')
-rw-r--r-- | source/blender/editors/interface/view2d.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index 705963981c8..11714df0491 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -1207,14 +1207,14 @@ void UI_view2d_grid_free(View2DGrid *grid) * For now, we don't need to have a separate (internal) header for structs like this... */ struct View2DScrollers { - rcti hor, vert; /* exact size of slider backdrop */ - int horfull, vertfull; /* set if sliders are full, we don't draw them */ - /* focus bubbles */ int vert_min, vert_max; /* vertical scrollbar */ int hor_min, hor_max; /* horizontal scrollbar */ - /* scales */ + rcti hor, vert; /* exact size of slider backdrop */ + int horfull, vertfull; /* set if sliders are full, we don't draw them */ + + /* scales */ View2DGrid *grid; /* grid for coordinate drawing */ short xunits, xclamp; /* units and clamping options for x-axis */ short yunits, yclamp; /* units and clamping options for y-axis */ @@ -1455,13 +1455,17 @@ void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *v bTheme *btheme= U.themes.first; uiWidgetColors wcol= btheme->tui.wcol_scroll; rcti slider; + int state; slider.xmin= vs->hor_min; slider.xmax= vs->hor_max; slider.ymin= hor.ymin; slider.ymax= hor.ymax; - uiWidgetScrollDraw(&wcol, &hor, &slider, (v2d->scroll_ui & V2D_SCROLL_H_ACTIVE)?UI_SELECT:0); + state= (v2d->scroll_ui & V2D_SCROLL_H_ACTIVE)?UI_SCROLL_PRESSED:0; + if (!(v2d->keepzoom & V2D_LOCKZOOM_X)) + state |= UI_SCROLL_ARROWS; + uiWidgetScrollDraw(&wcol, &hor, &slider, state); } /* scale indicators */ @@ -1547,13 +1551,17 @@ void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *v bTheme *btheme= U.themes.first; uiWidgetColors wcol= btheme->tui.wcol_scroll; rcti slider; + int state; slider.xmin= vert.xmin; slider.xmax= vert.xmax; slider.ymin= vs->vert_min; slider.ymax= vs->vert_max; - uiWidgetScrollDraw(&wcol, &vert, &slider, (v2d->scroll_ui & V2D_SCROLL_V_ACTIVE)?UI_SELECT:0); + state= (v2d->scroll_ui & V2D_SCROLL_V_ACTIVE)?UI_SCROLL_PRESSED:0; + if (!(v2d->keepzoom & V2D_LOCKZOOM_Y)) + state |= UI_SCROLL_ARROWS; + uiWidgetScrollDraw(&wcol, &vert, &slider, state); } |