From 40ae17d2f6e2d5dbbe89321491572035c304872c Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 19 May 2009 17:13:33 +0000 Subject: UI * Fix buttons jumping around when resizing and zoom. Part of this was adding a tiny a 0.001f offset in UI_view2d_view_ortho, otherwise the rounding is unpredictable (used to be 0.375f, but that was disabled). * Fix various issues with zooming, panning panels. V2D_LOCKOFS_X/Y is now taken into account in more places in the view2d code, to avoid zooming into the center or panning out of the view. * Remove "Free" align mode in buttons window (it's not really useful). * View3D/Graph/Image editors now use the same PanelType system as the buttons window, means some deprecated panel code could be removed. * Some small visual tweaks for panels. * View 2D Reset operator (Home key), to reset zoom and panning for panels. * Added argument to set number buttons as sliders (slider=True for itemR). * Ignore labels for button alignment (doesn't look right). * Fix some use of context.main in py scripts, should get data from active object instead. * Fix autotexspace -> auto_texspace in py script. --- source/blender/editors/space_buttons/space_buttons.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'source/blender/editors/space_buttons/space_buttons.c') diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c index 785f0d0b89b..9f5e0f5974a 100644 --- a/source/blender/editors/space_buttons/space_buttons.c +++ b/source/blender/editors/space_buttons/space_buttons.c @@ -132,7 +132,7 @@ static void buttons_init(struct wmWindowManager *wm, ScrArea *sa) SpaceButs *sbuts= sa->spacedata.first; /* auto-align based on size */ - if(sbuts->align == BUT_AUTO) { + if(sbuts->align == BUT_AUTO || !sbuts->align) { if(sa->winx > sa->winy) sbuts->align= BUT_HORIZONTAL; else @@ -155,8 +155,7 @@ static void buttons_main_area_init(wmWindowManager *wm, ARegion *ar) { ListBase *keymap; -// ar->v2d.minzoom= ar->v2d.maxzoom= 1.0f; - UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_PANELS_UI, ar->winx, ar->winy); + ED_region_panels_init(wm, ar); /* own keymap */ keymap= WM_keymap_listbase(wm, "Buttons", SPACE_BUTS, 0); /* XXX weak? */ @@ -280,7 +279,7 @@ void ED_spacetype_buttons(void) art->init= buttons_main_area_init; art->draw= buttons_main_area_draw; art->listener= buttons_area_listener; - art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D|ED_KEYMAP_FRAMES; + art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_FRAMES; BLI_addhead(&st->regiontypes, art); /* regions: header */ -- cgit v1.2.3