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:
@@ -559,7 +559,7 @@ void uiEndBlock(const bContext *C, uiBlock *block)
|
||||
}
|
||||
|
||||
/* handle pending stuff */
|
||||
if(block->layout) uiBlockLayoutResolve(C, block, NULL, NULL);
|
||||
if(block->layouts.first) uiBlockLayoutResolve(C, block, NULL, NULL);
|
||||
ui_block_do_align(block);
|
||||
if(block->flag & UI_BLOCK_LOOP) ui_menu_block_set_keymaps(C, block);
|
||||
|
||||
@@ -1984,6 +1984,11 @@ void uiBlockEndAlign(uiBlock *block)
|
||||
block->flag &= ~UI_BUT_ALIGN; // all 4 flags
|
||||
}
|
||||
|
||||
int ui_but_can_align(uiBut *but)
|
||||
{
|
||||
return !ELEM(but->type, LABEL, ROUNDBOX);
|
||||
}
|
||||
|
||||
static void ui_block_do_align_but(uiBlock *block, uiBut *first, int nr)
|
||||
{
|
||||
uiBut *prev, *but=NULL, *next;
|
||||
@@ -2176,7 +2181,7 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, char *str, short
|
||||
but->aspect= 1.0f; //XXX block->aspect;
|
||||
but->block= block; // pointer back, used for frontbuffer status, and picker
|
||||
|
||||
if(block->flag & UI_BUT_ALIGN)
|
||||
if((block->flag & UI_BUT_ALIGN) && ui_but_can_align(but))
|
||||
but->alignnr= block->alignnr;
|
||||
|
||||
but->func= block->func;
|
||||
|
||||
Reference in New Issue
Block a user