UI: tweak menu padding and make separator line more visible.
Adds some padding to the left of the icon, adds more space around the separator line and make it more visible, and add some spacing at the top and bottom of the menu. Ref T37794 Reviewed By: dingto, billrey Differential Revision: https://developer.blender.org/D223
This commit is contained in:
parent
ac74718e6f
commit
8b6b42b694
Notes:
blender-bot
2023-02-14 11:29:52 +01:00
Referenced by issue #37794, Add Menu Padding (and other menu design details)
|
@ -270,6 +270,7 @@ typedef enum {
|
|||
PROGRESSBAR = (51 << 9),
|
||||
SEARCH_MENU_UNLINK = (52 << 9),
|
||||
NODESOCKET = (53 << 9),
|
||||
SEPRLINE = (54 << 9),
|
||||
} eButType;
|
||||
|
||||
#define BUTTYPE (63 << 9)
|
||||
|
@ -771,7 +772,7 @@ enum {
|
|||
/* not apart of the corner flags but mixed in some functions */
|
||||
#define UI_RB_ALPHA (UI_CNR_ALL + 1)
|
||||
|
||||
uiLayout *uiBlockLayout(uiBlock *block, int dir, int type, int x, int y, int size, int em, struct uiStyle *style);
|
||||
uiLayout *uiBlockLayout(uiBlock *block, int dir, int type, int x, int y, int size, int em, int padding, struct uiStyle *style);
|
||||
void uiBlockSetCurLayout(uiBlock *block, uiLayout *layout);
|
||||
void uiBlockLayoutResolve(uiBlock *block, int *x, int *y);
|
||||
|
||||
|
|
|
@ -214,7 +214,7 @@ static void ui_text_bounds_block(uiBlock *block, float offset)
|
|||
uiStyleFontSet(&style->widget);
|
||||
|
||||
for (bt = block->buttons.first; bt; bt = bt->next) {
|
||||
if (bt->type != SEPR) {
|
||||
if (!ELEM(bt->type, SEPR, SEPRLINE)) {
|
||||
j = BLF_width(style->widget.uifont_id, bt->drawstr, sizeof(bt->drawstr));
|
||||
|
||||
if (j > i) i = j;
|
||||
|
@ -2553,7 +2553,7 @@ void uiBlockEndAlign(uiBlock *block)
|
|||
|
||||
int ui_but_can_align(uiBut *but)
|
||||
{
|
||||
return !ELEM4(but->type, LABEL, OPTION, OPTIONN, SEPR);
|
||||
return !ELEM5(but->type, LABEL, OPTION, OPTIONN, SEPR, SEPRLINE);
|
||||
}
|
||||
|
||||
static void ui_block_do_align_but(uiBut *first, short nr)
|
||||
|
@ -2855,7 +2855,7 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, const char *str,
|
|||
}
|
||||
|
||||
/* keep track of UI_interface.h */
|
||||
if (ELEM9(but->type, BLOCK, BUT, LABEL, PULLDOWN, ROUNDBOX, LISTBOX, BUTM, SCROLL, SEPR)) {}
|
||||
if (ELEM10(but->type, BLOCK, BUT, LABEL, PULLDOWN, ROUNDBOX, LISTBOX, BUTM, SCROLL, SEPR, SEPRLINE)) {}
|
||||
else if (but->type >= SEARCH_MENU) {}
|
||||
else but->flag |= UI_BUT_UNDO;
|
||||
|
||||
|
|
|
@ -309,7 +309,7 @@ void ui_pan_to_scroll(const wmEvent *event, int *type, int *val)
|
|||
|
||||
static bool ui_but_editable(uiBut *but)
|
||||
{
|
||||
return ELEM5(but->type, LABEL, SEPR, ROUNDBOX, LISTBOX, PROGRESSBAR);
|
||||
return ELEM6(but->type, LABEL, SEPR, SEPRLINE, ROUNDBOX, LISTBOX, PROGRESSBAR);
|
||||
}
|
||||
|
||||
static uiBut *ui_but_prev(uiBut *but)
|
||||
|
@ -2144,7 +2144,7 @@ static void ui_textedit_next_but(uiBlock *block, uiBut *actbut, uiHandleButtonDa
|
|||
uiBut *but;
|
||||
|
||||
/* label and roundbox can overlap real buttons (backdrops...) */
|
||||
if (ELEM4(actbut->type, LABEL, SEPR, ROUNDBOX, LISTBOX))
|
||||
if (ELEM5(actbut->type, LABEL, SEPR, SEPRLINE, ROUNDBOX, LISTBOX))
|
||||
return;
|
||||
|
||||
for (but = actbut->next; but; but = but->next) {
|
||||
|
@ -2172,7 +2172,7 @@ static void ui_textedit_prev_but(uiBlock *block, uiBut *actbut, uiHandleButtonDa
|
|||
uiBut *but;
|
||||
|
||||
/* label and roundbox can overlap real buttons (backdrops...) */
|
||||
if (ELEM4(actbut->type, LABEL, SEPR, ROUNDBOX, LISTBOX))
|
||||
if (ELEM5(actbut->type, LABEL, SEPR, SEPRLINE, ROUNDBOX, LISTBOX))
|
||||
return;
|
||||
|
||||
for (but = actbut->prev; but; but = but->prev) {
|
||||
|
@ -5218,7 +5218,7 @@ static uiBlock *menu_change_shortcut(bContext *C, ARegion *ar, void *arg)
|
|||
uiBlockSetFlag(block, UI_BLOCK_MOVEMOUSE_QUIT);
|
||||
uiBlockSetDirection(block, UI_CENTER);
|
||||
|
||||
layout = uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, 200, 20, style);
|
||||
layout = uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, 200, 20, 0, style);
|
||||
|
||||
uiItemR(layout, &ptr, "type", UI_ITEM_R_FULL_EVENT | UI_ITEM_R_IMMEDIATE, "", ICON_NONE);
|
||||
|
||||
|
@ -5263,7 +5263,7 @@ static uiBlock *menu_add_shortcut(bContext *C, ARegion *ar, void *arg)
|
|||
uiBlockSetHandleFunc(block, but_shortcut_name_func, but);
|
||||
uiBlockSetDirection(block, UI_CENTER);
|
||||
|
||||
layout = uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, 200, 20, style);
|
||||
layout = uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, 200, 20, 0, style);
|
||||
|
||||
uiItemR(layout, &ptr, "type", UI_ITEM_R_FULL_EVENT | UI_ITEM_R_IMMEDIATE, "", ICON_NONE);
|
||||
|
||||
|
@ -5849,6 +5849,7 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, const wmEvent *
|
|||
|
||||
/* quiet warnings for unhandled types */
|
||||
case SEPR:
|
||||
case SEPRLINE:
|
||||
case BUT_EXTRA:
|
||||
break;
|
||||
}
|
||||
|
@ -6003,7 +6004,7 @@ static bool ui_is_but_interactive(const uiBut *but, const bool labeledit)
|
|||
/* note, LABEL is included for highlights, this allows drags */
|
||||
if ((but->type == LABEL) && but->dragpoin == NULL)
|
||||
return false;
|
||||
if (ELEM3(but->type, ROUNDBOX, SEPR, LISTBOX))
|
||||
if (ELEM4(but->type, ROUNDBOX, SEPR, SEPRLINE, LISTBOX))
|
||||
return false;
|
||||
if (but->flag & UI_HIDDEN)
|
||||
return false;
|
||||
|
@ -7570,7 +7571,7 @@ static int ui_handle_menu_event(bContext *C, const wmEvent *event, uiPopupBlockH
|
|||
for (but = block->buttons.first; but; but = but->next) {
|
||||
bool doit = false;
|
||||
|
||||
if (!ELEM(but->type, LABEL, SEPR))
|
||||
if (!ELEM3(but->type, LABEL, SEPR, SEPRLINE))
|
||||
count++;
|
||||
|
||||
/* exception for rna layer buts */
|
||||
|
|
|
@ -83,6 +83,7 @@ typedef struct uiLayoutRoot {
|
|||
int opcontext;
|
||||
|
||||
int emw, emh;
|
||||
int padding;
|
||||
|
||||
uiMenuHandleFunc handlefunc;
|
||||
void *argv;
|
||||
|
@ -1751,9 +1752,11 @@ void uiItemV(uiLayout *layout, const char *name, int icon, int argval)
|
|||
void uiItemS(uiLayout *layout)
|
||||
{
|
||||
uiBlock *block = layout->root->block;
|
||||
bool is_menu = ui_block_is_menu(block);
|
||||
int space = (is_menu) ? 0.45f * UI_UNIT_X : 0.3f * UI_UNIT_X;
|
||||
|
||||
uiBlockSetCurLayout(block, layout);
|
||||
uiDefBut(block, SEPR, 0, "", 0, 0, 0.3f * UI_UNIT_X, 0.3f * UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
|
||||
uiDefBut(block, (is_menu) ? SEPRLINE : SEPR, 0, "", 0, 0, space, space, NULL, 0.0, 0.0, 0, 0, "");
|
||||
}
|
||||
|
||||
/* level items */
|
||||
|
@ -2851,7 +2854,20 @@ static void ui_layout_free(uiLayout *layout)
|
|||
MEM_freeN(layout);
|
||||
}
|
||||
|
||||
uiLayout *uiBlockLayout(uiBlock *block, int dir, int type, int x, int y, int size, int em, uiStyle *style)
|
||||
static void ui_layout_add_padding_button(uiLayoutRoot *root)
|
||||
{
|
||||
if (root->padding) {
|
||||
/* add an invisible button for padding */
|
||||
uiBlock *block = root->block;
|
||||
uiLayout *prev_layout = block->curlayout;
|
||||
|
||||
block->curlayout = root->layout;
|
||||
uiDefBut(block, SEPR, 0, "", 0, 0, root->padding, root->padding, NULL, 0.0, 0.0, 0, 0, "");
|
||||
block->curlayout = prev_layout;
|
||||
}
|
||||
}
|
||||
|
||||
uiLayout *uiBlockLayout(uiBlock *block, int dir, int type, int x, int y, int size, int em, int padding, uiStyle *style)
|
||||
{
|
||||
uiLayout *layout;
|
||||
uiLayoutRoot *root;
|
||||
|
@ -2860,6 +2876,7 @@ uiLayout *uiBlockLayout(uiBlock *block, int dir, int type, int x, int y, int siz
|
|||
root->type = type;
|
||||
root->style = style;
|
||||
root->block = block;
|
||||
root->padding = padding;
|
||||
root->opcontext = WM_OP_INVOKE_REGION_WIN;
|
||||
|
||||
layout = MEM_callocN(sizeof(uiLayout), "uiLayout");
|
||||
|
@ -2888,6 +2905,8 @@ uiLayout *uiBlockLayout(uiBlock *block, int dir, int type, int x, int y, int siz
|
|||
block->curlayout = layout;
|
||||
root->layout = layout;
|
||||
BLI_addtail(&block->layouts, root);
|
||||
|
||||
ui_layout_add_padding_button(root);
|
||||
|
||||
return layout;
|
||||
}
|
||||
|
@ -2944,6 +2963,8 @@ void uiBlockLayoutResolve(uiBlock *block, int *x, int *y)
|
|||
block->curlayout = NULL;
|
||||
|
||||
for (root = block->layouts.first; root; root = root->next) {
|
||||
ui_layout_add_padding_button(root);
|
||||
|
||||
/* NULL in advance so we don't interfere when adding button */
|
||||
ui_layout_end(block, root->layout, x, y);
|
||||
ui_layout_free(root->layout);
|
||||
|
|
|
@ -74,6 +74,7 @@
|
|||
|
||||
#define B_NOP -1
|
||||
#define MENU_TOP 8
|
||||
#define MENU_PADDING (int)(0.2f * UI_UNIT_Y)
|
||||
|
||||
/*********************** Menu Data Parsing ********************* */
|
||||
|
||||
|
@ -1482,13 +1483,13 @@ static void ui_block_position(wmWindow *window, ARegion *butregion, uiBut *but,
|
|||
|
||||
if (dir1 == UI_LEFT) {
|
||||
xof = butrct.xmin - block->rect.xmax;
|
||||
if (dir2 == UI_TOP) yof = butrct.ymin - block->rect.ymin - center;
|
||||
else yof = butrct.ymax - block->rect.ymax + center;
|
||||
if (dir2 == UI_TOP) yof = butrct.ymin - block->rect.ymin - center - MENU_PADDING;
|
||||
else yof = butrct.ymax - block->rect.ymax + center + MENU_PADDING;
|
||||
}
|
||||
else if (dir1 == UI_RIGHT) {
|
||||
xof = butrct.xmax - block->rect.xmin;
|
||||
if (dir2 == UI_TOP) yof = butrct.ymin - block->rect.ymin - center;
|
||||
else yof = butrct.ymax - block->rect.ymax + center;
|
||||
if (dir2 == UI_TOP) yof = butrct.ymin - block->rect.ymin - center - MENU_PADDING;
|
||||
else yof = butrct.ymax - block->rect.ymax + center + MENU_PADDING;
|
||||
}
|
||||
else if (dir1 == UI_TOP) {
|
||||
yof = butrct.ymax - block->rect.ymin;
|
||||
|
@ -1846,6 +1847,8 @@ static void ui_block_func_MENUSTR(bContext *UNUSED(C), uiLayout *layout, void *a
|
|||
/* Do not use uiItemL here, as our root layout is a menu one, it will add a fake blank icon! */
|
||||
uiDefBut(block, LABEL, 0, md->title, 0, 0, UI_UNIT_X * 5, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
|
||||
}
|
||||
|
||||
uiItemS(layout);
|
||||
}
|
||||
|
||||
/* create items */
|
||||
|
@ -2442,7 +2445,7 @@ static uiBlock *ui_block_func_POPUP(bContext *C, uiPopupBlockHandle *handle, voi
|
|||
for (bt = block->buttons.first; bt; bt = bt->next)
|
||||
offset[0] = min_ii(offset[0], -(bt->rect.xmin + 0.8f * BLI_rctf_size_x(&bt->rect)));
|
||||
|
||||
offset[1] = 1.5 * UI_UNIT_Y;
|
||||
offset[1] = 2.1 * UI_UNIT_Y;
|
||||
}
|
||||
|
||||
block->minbounds = minwidth;
|
||||
|
@ -2462,7 +2465,7 @@ static uiBlock *ui_block_func_POPUP(bContext *C, uiPopupBlockHandle *handle, voi
|
|||
}
|
||||
|
||||
block->minbounds = minwidth;
|
||||
uiTextBoundsBlock(block, 2.5 * UI_UNIT_X);
|
||||
uiTextBoundsBlock(block, 3.0f * UI_UNIT_X);
|
||||
}
|
||||
|
||||
/* if menu slides out of other menu, override direction */
|
||||
|
@ -2481,10 +2484,11 @@ uiPopupBlockHandle *ui_popup_menu_create(bContext *C, ARegion *butregion, uiBut
|
|||
uiStyle *style = UI_GetStyleDraw();
|
||||
uiPopupBlockHandle *handle;
|
||||
uiPopupMenu *pup;
|
||||
|
||||
pup = MEM_callocN(sizeof(uiPopupMenu), __func__);
|
||||
pup->block = uiBeginBlock(C, NULL, __func__, UI_EMBOSSP);
|
||||
pup->block->flag |= UI_BLOCK_NUMSELECT; /* default menus to numselect */
|
||||
pup->layout = uiBlockLayout(pup->block, UI_LAYOUT_VERTICAL, UI_LAYOUT_MENU, 0, 0, 200, 0, style);
|
||||
pup->layout = uiBlockLayout(pup->block, UI_LAYOUT_VERTICAL, UI_LAYOUT_MENU, 0, 0, 200, 0, MENU_PADDING, style);
|
||||
pup->slideout = but ? ui_block_is_menu(but->block) : false;
|
||||
pup->but = but;
|
||||
uiLayoutSetOperatorContext(pup->layout, WM_OP_INVOKE_REGION_WIN);
|
||||
|
@ -2549,7 +2553,7 @@ uiPopupMenu *uiPupMenuBegin(bContext *C, const char *title, int icon)
|
|||
pup->block = uiBeginBlock(C, NULL, __func__, UI_EMBOSSP);
|
||||
pup->block->flag |= UI_BLOCK_POPUP_MEMORY;
|
||||
pup->block->puphash = ui_popup_menu_hash(title);
|
||||
pup->layout = uiBlockLayout(pup->block, UI_LAYOUT_VERTICAL, UI_LAYOUT_MENU, 0, 0, 200, 0, style);
|
||||
pup->layout = uiBlockLayout(pup->block, UI_LAYOUT_VERTICAL, UI_LAYOUT_MENU, 0, 0, 200, 0, MENU_PADDING, style);
|
||||
|
||||
/* note, this intentionally differs from the menu & submenu default because many operators
|
||||
* use popups like this to select one of their options - where having invoke doesn't make sense */
|
||||
|
@ -2570,6 +2574,8 @@ uiPopupMenu *uiPupMenuBegin(bContext *C, const char *title, int icon)
|
|||
but = uiDefBut(pup->block, LABEL, 0, title, 0, 0, 200, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
|
||||
but->drawflag = UI_BUT_TEXT_LEFT;
|
||||
}
|
||||
|
||||
uiItemS(pup->layout);
|
||||
}
|
||||
|
||||
return pup;
|
||||
|
|
|
@ -3485,7 +3485,7 @@ static uiBlock *component_menu(bContext *C, ARegion *ar, void *args_v)
|
|||
block = uiBeginBlock(C, ar, __func__, UI_EMBOSS);
|
||||
uiBlockSetFlag(block, UI_BLOCK_KEEP_OPEN);
|
||||
|
||||
layout = uiLayoutColumn(uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, UI_UNIT_X * 6, UI_UNIT_Y, UI_GetStyle()), 0);
|
||||
layout = uiLayoutColumn(uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, UI_UNIT_X * 6, UI_UNIT_Y, 0, UI_GetStyle()), 0);
|
||||
|
||||
uiItemR(layout, &args->ptr, args->propname, UI_ITEM_R_EXPAND, "", ICON_NONE);
|
||||
|
||||
|
|
|
@ -1360,6 +1360,11 @@ static void widget_draw_text_icon(uiFontStyle *fstyle, uiWidgetColors *wcol, uiB
|
|||
const bool show_menu_icon = ui_but_draw_menu_icon(but);
|
||||
const float icon_size = ICON_SIZE_FROM_BUTRECT(rect);
|
||||
|
||||
/* menu item - add some more padding so menus don't feel cramped. it must
|
||||
* be part of the button so that this area is still clickable */
|
||||
if (but->block && ui_block_is_menu(but->block))
|
||||
rect->xmin += 0.3f * U.widget_unit;
|
||||
|
||||
widget_draw_icon(but, but->icon + but->iconadd, alpha, rect, show_menu_icon);
|
||||
|
||||
rect->xmin += icon_size;
|
||||
|
@ -2356,7 +2361,7 @@ static void ui_draw_separator(const rcti *rect, uiWidgetColors *wcol)
|
|||
col[0] = wcol->text[0];
|
||||
col[1] = wcol->text[1];
|
||||
col[2] = wcol->text[2];
|
||||
col[3] = 7;
|
||||
col[3] = 30;
|
||||
|
||||
glEnable(GL_BLEND);
|
||||
glColor4ubv(col);
|
||||
|
@ -3308,7 +3313,7 @@ void ui_draw_but(const bContext *C, ARegion *ar, uiStyle *style, uiBut *but, rct
|
|||
case LABEL:
|
||||
widget_draw_text_icon(&style->widgetlabel, &tui->wcol_menu_back, but, rect);
|
||||
break;
|
||||
case SEPR:
|
||||
case SEPRLINE:
|
||||
ui_draw_separator(rect, &tui->wcol_menu_item);
|
||||
break;
|
||||
default:
|
||||
|
@ -3333,6 +3338,7 @@ void ui_draw_but(const bContext *C, ARegion *ar, uiStyle *style, uiBut *but, rct
|
|||
break;
|
||||
|
||||
case SEPR:
|
||||
case SEPRLINE:
|
||||
break;
|
||||
|
||||
case BUT:
|
||||
|
|
|
@ -1691,7 +1691,7 @@ void ED_region_panels(const bContext *C, ARegion *ar, int vertical, const char *
|
|||
if (pt->draw_header && !(pt->flag & PNL_NO_HEADER) && (open || vertical)) {
|
||||
/* for enabled buttons */
|
||||
panel->layout = uiBlockLayout(block, UI_LAYOUT_HORIZONTAL, UI_LAYOUT_HEADER,
|
||||
triangle, (UI_UNIT_Y * 1.1f) + style->panelspace, UI_UNIT_Y, 1, style);
|
||||
triangle, (UI_UNIT_Y * 1.1f) + style->panelspace, UI_UNIT_Y, 1, 0, style);
|
||||
|
||||
pt->draw_header(C, panel);
|
||||
|
||||
|
@ -1713,7 +1713,7 @@ void ED_region_panels(const bContext *C, ARegion *ar, int vertical, const char *
|
|||
panelContext = UI_LAYOUT_PANEL;
|
||||
|
||||
panel->layout = uiBlockLayout(block, UI_LAYOUT_VERTICAL, panelContext,
|
||||
style->panelspace, 0, w - 2 * style->panelspace, em, style);
|
||||
style->panelspace, 0, w - 2 * style->panelspace, em, 0, style);
|
||||
|
||||
pt->draw(C, panel);
|
||||
|
||||
|
@ -1836,7 +1836,7 @@ void ED_region_header(const bContext *C, ARegion *ar)
|
|||
/* draw all headers types */
|
||||
for (ht = ar->type->headertypes.first; ht; ht = ht->next) {
|
||||
block = uiBeginBlock(C, ar, ht->idname, UI_EMBOSS);
|
||||
layout = uiBlockLayout(block, UI_LAYOUT_HORIZONTAL, UI_LAYOUT_HEADER, xco, yco, UI_UNIT_Y, 1, style);
|
||||
layout = uiBlockLayout(block, UI_LAYOUT_HORIZONTAL, UI_LAYOUT_HEADER, xco, yco, UI_UNIT_Y, 1, 0, style);
|
||||
|
||||
if (ht->draw) {
|
||||
header.type = ht;
|
||||
|
|
|
@ -772,7 +772,7 @@ static uiBlock *sensor_menu(bContext *C, ARegion *ar, void *UNUSED(arg))
|
|||
|
||||
uiDefBut(block, BUTM, 1, IFACE_("Show Objects"), 0, (short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 1, 0, "");
|
||||
uiDefBut(block, BUTM, 1, IFACE_("Hide Objects"), 0, (short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 1, 1, "");
|
||||
uiDefBut(block, SEPR, 0, "", 0, (short)(yco-=6), 160, 6, NULL, 0.0, 0.0, 0, 0, "");
|
||||
uiDefBut(block, SEPRLINE, 0, "", 0, (short)(yco-=6), 160, 6, NULL, 0.0, 0.0, 0, 0, "");
|
||||
uiDefBut(block, BUTM, 1, IFACE_("Show Sensors"), 0, (short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 1, 2, "");
|
||||
uiDefBut(block, BUTM, 1, IFACE_("Hide Sensors"), 0, (short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 1, 3, "");
|
||||
|
||||
|
@ -821,7 +821,7 @@ static uiBlock *controller_menu(bContext *C, ARegion *ar, void *UNUSED(arg))
|
|||
|
||||
uiDefBut(block, BUTM, 1, IFACE_("Show Objects"), 0, (short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 1, 0, "");
|
||||
uiDefBut(block, BUTM, 1, IFACE_("Hide Objects"), 0, (short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 1, 1, "");
|
||||
uiDefBut(block, SEPR, 0, "", 0, (short)(yco-=6), 160, 6, NULL, 0.0, 0.0, 0, 0, "");
|
||||
uiDefBut(block, SEPRLINE, 0, "", 0, (short)(yco-=6), 160, 6, NULL, 0.0, 0.0, 0, 0, "");
|
||||
uiDefBut(block, BUTM, 1, IFACE_("Show Controllers"), 0, (short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 2, 2, "");
|
||||
uiDefBut(block, BUTM, 1, IFACE_("Hide Controllers"), 0, (short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 3, 3, "");
|
||||
|
||||
|
@ -870,7 +870,7 @@ static uiBlock *actuator_menu(bContext *C, ARegion *ar, void *UNUSED(arg))
|
|||
|
||||
uiDefBut(block, BUTM, 1, IFACE_("Show Objects"), 0, (short)(xco-=20), 160, 19, NULL, 0.0, 0.0, 1, 0, "");
|
||||
uiDefBut(block, BUTM, 1, IFACE_("Hide Objects"), 0, (short)(xco-=20), 160, 19, NULL, 0.0, 0.0, 1, 1, "");
|
||||
uiDefBut(block, SEPR, 0, "", 0, (short)(xco-=6), 160, 6, NULL, 0.0, 0.0, 0, 0, "");
|
||||
uiDefBut(block, SEPRLINE, 0, "", 0, (short)(xco-=6), 160, 6, NULL, 0.0, 0.0, 0, 0, "");
|
||||
uiDefBut(block, BUTM, 1, IFACE_("Show Actuators"), 0, (short)(xco-=20), 160, 19, NULL, 0.0, 0.0, 1, 2, "");
|
||||
uiDefBut(block, BUTM, 1, IFACE_("Hide Actuators"), 0, (short)(xco-=20), 160, 19, NULL, 0.0, 0.0, 1, 3, "");
|
||||
|
||||
|
@ -2285,7 +2285,7 @@ void logic_buttons(bContext *C, ARegion *ar)
|
|||
/* ****************** Controllers ****************** */
|
||||
|
||||
xco= 21 * U.widget_unit; yco= - U.widget_unit / 2; width= 15 * U.widget_unit;
|
||||
layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, xco, yco, width, 20, UI_GetStyle());
|
||||
layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, xco, yco, width, 20, 0, UI_GetStyle());
|
||||
row = uiLayoutRow(layout, TRUE);
|
||||
|
||||
uiDefBlockBut(block, controller_menu, NULL, IFACE_("Controllers"), xco - U.widget_unit / 2, yco, width, UI_UNIT_Y, ""); /* replace this with uiLayout stuff later */
|
||||
|
@ -2392,7 +2392,7 @@ void logic_buttons(bContext *C, ARegion *ar)
|
|||
/* ****************** Sensors ****************** */
|
||||
|
||||
xco= U.widget_unit / 2; yco= -U.widget_unit / 2; width= 17 * U.widget_unit;
|
||||
layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, xco, yco, width, 20, UI_GetStyle());
|
||||
layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, xco, yco, width, 20, 0, UI_GetStyle());
|
||||
row = uiLayoutRow(layout, TRUE);
|
||||
|
||||
uiDefBlockBut(block, sensor_menu, NULL, IFACE_("Sensors"), xco - U.widget_unit / 2, yco, 15 * U.widget_unit, UI_UNIT_Y, ""); /* replace this with uiLayout stuff later */
|
||||
|
@ -2461,7 +2461,7 @@ void logic_buttons(bContext *C, ARegion *ar)
|
|||
/* ****************** Actuators ****************** */
|
||||
|
||||
xco= 40 * U.widget_unit; yco= -U.widget_unit / 2; width= 17 * U.widget_unit;
|
||||
layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, xco, yco, width, 20, UI_GetStyle());
|
||||
layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, xco, yco, width, 20, 0, UI_GetStyle());
|
||||
row = uiLayoutRow(layout, TRUE);
|
||||
|
||||
uiDefBlockBut(block, actuator_menu, NULL, IFACE_("Actuators"), xco - U.widget_unit / 2, yco, 15 * U.widget_unit, UI_UNIT_Y, ""); /* replace this with uiLayout stuff later */
|
||||
|
|
|
@ -347,7 +347,7 @@ static void node_update_basis(const bContext *C, bNodeTree *ntree, bNode *node)
|
|||
RNA_pointer_create(&ntree->id, &RNA_NodeSocket, nsock, &sockptr);
|
||||
|
||||
layout = uiBlockLayout(node->block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL,
|
||||
locx + NODE_DYS, dy, NODE_WIDTH(node) - NODE_DY, NODE_DY, UI_GetStyle());
|
||||
locx + NODE_DYS, dy, NODE_WIDTH(node) - NODE_DY, NODE_DY, 0, UI_GetStyle());
|
||||
/* context pointers for current node and socket */
|
||||
uiLayoutSetContextPointer(layout, "node", &nodeptr);
|
||||
uiLayoutSetContextPointer(layout, "socket", &sockptr);
|
||||
|
@ -418,7 +418,7 @@ static void node_update_basis(const bContext *C, bNodeTree *ntree, bNode *node)
|
|||
|
||||
|
||||
layout = uiBlockLayout(node->block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL,
|
||||
locx + NODE_DYS, dy, node->butr.xmax, 0, UI_GetStyle());
|
||||
locx + NODE_DYS, dy, node->butr.xmax, 0, 0, UI_GetStyle());
|
||||
uiLayoutSetContextPointer(layout, "node", &nodeptr);
|
||||
|
||||
node->typeinfo->draw_buttons(layout, (bContext *)C, &nodeptr);
|
||||
|
@ -437,7 +437,7 @@ static void node_update_basis(const bContext *C, bNodeTree *ntree, bNode *node)
|
|||
RNA_pointer_create(&ntree->id, &RNA_NodeSocket, nsock, &sockptr);
|
||||
|
||||
layout = uiBlockLayout(node->block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL,
|
||||
locx + NODE_DYS, dy, NODE_WIDTH(node) - NODE_DY, NODE_DY, UI_GetStyle());
|
||||
locx + NODE_DYS, dy, NODE_WIDTH(node) - NODE_DY, NODE_DY, 0, UI_GetStyle());
|
||||
/* context pointers for current node and socket */
|
||||
uiLayoutSetContextPointer(layout, "node", &nodeptr);
|
||||
uiLayoutSetContextPointer(layout, "socket", &sockptr);
|
||||
|
|
|
@ -1387,7 +1387,7 @@ static uiBlock *wm_block_create_redo(bContext *C, ARegion *ar, void *arg_op)
|
|||
assert(op->type->flag & OPTYPE_REGISTER);
|
||||
|
||||
uiBlockSetHandleFunc(block, wm_block_redo_cb, arg_op);
|
||||
layout = uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, width, UI_UNIT_Y, style);
|
||||
layout = uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, width, UI_UNIT_Y, 0, style);
|
||||
|
||||
if (op == WM_operator_last_redo(C))
|
||||
if (!WM_operator_check_ui_enabled(C, op->type->name))
|
||||
|
@ -1460,7 +1460,7 @@ static uiBlock *wm_block_dialog_create(bContext *C, ARegion *ar, void *userData)
|
|||
* where quitting by accident is very annoying */
|
||||
uiBlockSetFlag(block, UI_BLOCK_KEEP_OPEN);
|
||||
|
||||
layout = uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, data->width, data->height, style);
|
||||
layout = uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, data->width, data->height, 0, style);
|
||||
|
||||
uiBlockSetFunc(block, dialog_check_cb, op, NULL);
|
||||
|
||||
|
@ -1501,7 +1501,7 @@ static uiBlock *wm_operator_ui_create(bContext *C, ARegion *ar, void *userData)
|
|||
uiBlockClearFlag(block, UI_BLOCK_LOOP);
|
||||
uiBlockSetFlag(block, UI_BLOCK_KEEP_OPEN | UI_BLOCK_MOVEMOUSE_QUIT);
|
||||
|
||||
layout = uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, data->width, data->height, style);
|
||||
layout = uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, data->width, data->height, 0, style);
|
||||
|
||||
/* since ui is defined the auto-layout args are not used */
|
||||
uiLayoutOperatorButs(C, layout, op, NULL, 'V', 0);
|
||||
|
@ -1801,7 +1801,7 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar
|
|||
}
|
||||
#endif /* WITH_BUILDINFO */
|
||||
|
||||
layout = uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 10, 2, U.pixelsize * 480, U.pixelsize * 110, style);
|
||||
layout = uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 10, 2, U.pixelsize * 480, U.pixelsize * 110, 0, style);
|
||||
|
||||
uiBlockSetEmboss(block, UI_EMBOSS);
|
||||
/* show the splash menu (containing interaction presets), using python */
|
||||
|
|
Loading…
Reference in New Issue