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.
This commit is contained in:
@@ -346,34 +346,17 @@ static void graph_buttons_area_init(wmWindowManager *wm, ARegion *ar)
|
||||
{
|
||||
ListBase *keymap;
|
||||
|
||||
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_LIST_UI, ar->winx, ar->winy);
|
||||
ED_region_panels_init(wm, ar);
|
||||
|
||||
keymap= WM_keymap_listbase(wm, "View2D Buttons List", 0, 0);
|
||||
WM_event_add_keymap_handler(&ar->handlers, keymap);
|
||||
keymap= WM_keymap_listbase(wm, "GraphEdit Generic", SPACE_IPO, 0);
|
||||
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
|
||||
}
|
||||
|
||||
static void graph_buttons_area_draw(const bContext *C, ARegion *ar)
|
||||
{
|
||||
float col[3];
|
||||
|
||||
/* clear */
|
||||
UI_GetThemeColor3fv(TH_BACK, col);
|
||||
|
||||
glClearColor(col[0], col[1], col[2], 0.0);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
/* set view2d view matrix for scrolling (without scrollers) */
|
||||
UI_view2d_view_ortho(C, &ar->v2d);
|
||||
|
||||
graph_region_buttons(C, ar);
|
||||
|
||||
/* restore view matrix? */
|
||||
UI_view2d_view_restore(C);
|
||||
ED_region_panels(C, ar, 1, NULL);
|
||||
}
|
||||
|
||||
|
||||
static void graph_region_listener(ARegion *ar, wmNotifier *wmn)
|
||||
{
|
||||
/* context changes */
|
||||
@@ -586,6 +569,8 @@ void ED_spacetype_ipo(void)
|
||||
art->draw= graph_buttons_area_draw;
|
||||
|
||||
BLI_addhead(&st->regiontypes, art);
|
||||
|
||||
graph_buttons_register(art);
|
||||
|
||||
BKE_spacetype_register(st);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user