UI: Cleanup (line length)
This commit is contained in:
@@ -851,7 +851,13 @@ static void ui_menu_block_set_keyaccels(uiBlock *block)
|
||||
* fun first pass on all buttons so first word chars always get first priority */
|
||||
|
||||
for (but = block->buttons.first; but; but = but->next) {
|
||||
if (!ELEM(but->type, UI_BTYPE_BUT, UI_BTYPE_BUT_MENU, UI_BTYPE_MENU, UI_BTYPE_BLOCK, UI_BTYPE_PULLDOWN) || (but->flag & UI_HIDDEN)) {
|
||||
if (!ELEM(but->type,
|
||||
UI_BTYPE_BUT,
|
||||
UI_BTYPE_BUT_MENU,
|
||||
UI_BTYPE_MENU, UI_BTYPE_BLOCK,
|
||||
UI_BTYPE_PULLDOWN) ||
|
||||
(but->flag & UI_HIDDEN))
|
||||
{
|
||||
/* pass */
|
||||
}
|
||||
else if (but->menu_key == '\0') {
|
||||
@@ -3088,7 +3094,10 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, const char *str,
|
||||
but->drawflag |= (UI_BUT_TEXT_LEFT | UI_BUT_ICON_LEFT);
|
||||
}
|
||||
else if ((block->flag & UI_BLOCK_LOOP) ||
|
||||
ELEM(but->type, UI_BTYPE_MENU, UI_BTYPE_TEXT, UI_BTYPE_LABEL, UI_BTYPE_BLOCK, UI_BTYPE_BUT_MENU, UI_BTYPE_SEARCH_MENU, UI_BTYPE_PROGRESS_BAR, UI_BTYPE_SEARCH_MENU_UNLINK))
|
||||
ELEM(but->type,
|
||||
UI_BTYPE_MENU, UI_BTYPE_TEXT, UI_BTYPE_LABEL,
|
||||
UI_BTYPE_BLOCK, UI_BTYPE_BUT_MENU, UI_BTYPE_SEARCH_MENU,
|
||||
UI_BTYPE_PROGRESS_BAR, UI_BTYPE_SEARCH_MENU_UNLINK))
|
||||
{
|
||||
but->drawflag |= (UI_BUT_TEXT_LEFT | UI_BUT_ICON_LEFT);
|
||||
}
|
||||
|
@@ -390,7 +390,9 @@ void ui_pan_to_scroll(const wmEvent *event, int *type, int *val)
|
||||
|
||||
bool ui_but_is_editable(const uiBut *but)
|
||||
{
|
||||
return !ELEM(but->type, UI_BTYPE_LABEL, UI_BTYPE_SEPR, UI_BTYPE_SEPR_LINE, UI_BTYPE_ROUNDBOX, UI_BTYPE_LISTBOX, UI_BTYPE_PROGRESS_BAR);
|
||||
return !ELEM(but->type,
|
||||
UI_BTYPE_LABEL, UI_BTYPE_SEPR, UI_BTYPE_SEPR_LINE,
|
||||
UI_BTYPE_ROUNDBOX, UI_BTYPE_LISTBOX, UI_BTYPE_PROGRESS_BAR);
|
||||
}
|
||||
|
||||
static uiBut *ui_but_prev(uiBut *but)
|
||||
@@ -438,7 +440,10 @@ static uiBut *ui_but_last(uiBlock *block)
|
||||
static bool ui_but_is_cursor_warp(uiBut *but)
|
||||
{
|
||||
if (U.uiflag & USER_CONTINUOUS_MOUSE) {
|
||||
if (ELEM(but->type, UI_BTYPE_NUM, UI_BTYPE_NUM_SLIDER, UI_BTYPE_HSVCIRCLE, UI_BTYPE_TRACK_PREVIEW, UI_BTYPE_HSVCUBE, UI_BTYPE_CURVE)) {
|
||||
if (ELEM(but->type,
|
||||
UI_BTYPE_NUM, UI_BTYPE_NUM_SLIDER, UI_BTYPE_HSVCIRCLE,
|
||||
UI_BTYPE_TRACK_PREVIEW, UI_BTYPE_HSVCUBE, UI_BTYPE_CURVE))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -2517,7 +2522,9 @@ static void ui_textedit_next_but(uiBlock *block, uiBut *actbut, uiHandleButtonDa
|
||||
return;
|
||||
|
||||
for (but = actbut->next; but; but = but->next) {
|
||||
if (ELEM(but->type, UI_BTYPE_TEXT, UI_BTYPE_NUM, UI_BTYPE_NUM_SLIDER, UI_BTYPE_SEARCH_MENU, UI_BTYPE_SEARCH_MENU_UNLINK)) {
|
||||
if (ELEM(but->type, UI_BTYPE_TEXT, UI_BTYPE_NUM, UI_BTYPE_NUM_SLIDER,
|
||||
UI_BTYPE_SEARCH_MENU, UI_BTYPE_SEARCH_MENU_UNLINK))
|
||||
{
|
||||
if (!(but->flag & UI_BUT_DISABLED)) {
|
||||
data->postbut = but;
|
||||
data->posttype = BUTTON_ACTIVATE_TEXT_EDITING;
|
||||
@@ -2526,7 +2533,9 @@ static void ui_textedit_next_but(uiBlock *block, uiBut *actbut, uiHandleButtonDa
|
||||
}
|
||||
}
|
||||
for (but = block->buttons.first; but != actbut; but = but->next) {
|
||||
if (ELEM(but->type, UI_BTYPE_TEXT, UI_BTYPE_NUM, UI_BTYPE_NUM_SLIDER, UI_BTYPE_SEARCH_MENU, UI_BTYPE_SEARCH_MENU_UNLINK)) {
|
||||
if (ELEM(but->type, UI_BTYPE_TEXT, UI_BTYPE_NUM, UI_BTYPE_NUM_SLIDER,
|
||||
UI_BTYPE_SEARCH_MENU, UI_BTYPE_SEARCH_MENU_UNLINK))
|
||||
{
|
||||
if (!(but->flag & UI_BUT_DISABLED)) {
|
||||
data->postbut = but;
|
||||
data->posttype = BUTTON_ACTIVATE_TEXT_EDITING;
|
||||
@@ -2545,7 +2554,9 @@ static void ui_textedit_prev_but(uiBlock *block, uiBut *actbut, uiHandleButtonDa
|
||||
return;
|
||||
|
||||
for (but = actbut->prev; but; but = but->prev) {
|
||||
if (ELEM(but->type, UI_BTYPE_TEXT, UI_BTYPE_NUM, UI_BTYPE_NUM_SLIDER, UI_BTYPE_SEARCH_MENU, UI_BTYPE_SEARCH_MENU_UNLINK)) {
|
||||
if (ELEM(but->type, UI_BTYPE_TEXT, UI_BTYPE_NUM, UI_BTYPE_NUM_SLIDER,
|
||||
UI_BTYPE_SEARCH_MENU, UI_BTYPE_SEARCH_MENU_UNLINK))
|
||||
{
|
||||
if (!(but->flag & UI_BUT_DISABLED)) {
|
||||
data->postbut = but;
|
||||
data->posttype = BUTTON_ACTIVATE_TEXT_EDITING;
|
||||
@@ -2554,7 +2565,9 @@ static void ui_textedit_prev_but(uiBlock *block, uiBut *actbut, uiHandleButtonDa
|
||||
}
|
||||
}
|
||||
for (but = block->buttons.last; but != actbut; but = but->prev) {
|
||||
if (ELEM(but->type, UI_BTYPE_TEXT, UI_BTYPE_NUM, UI_BTYPE_NUM_SLIDER, UI_BTYPE_SEARCH_MENU, UI_BTYPE_SEARCH_MENU_UNLINK)) {
|
||||
if (ELEM(but->type, UI_BTYPE_TEXT, UI_BTYPE_NUM, UI_BTYPE_NUM_SLIDER,
|
||||
UI_BTYPE_SEARCH_MENU, UI_BTYPE_SEARCH_MENU_UNLINK))
|
||||
{
|
||||
if (!(but->flag & UI_BUT_DISABLED)) {
|
||||
data->postbut = but;
|
||||
data->posttype = BUTTON_ACTIVATE_TEXT_EDITING;
|
||||
@@ -8177,8 +8190,9 @@ static int ui_handle_menu_event(
|
||||
((ELEM(type, DOWNARROWKEY, WHEELDOWNMOUSE)) && (block->direction & UI_DIR_RIGHT)) ||
|
||||
((ELEM(type, UPARROWKEY, WHEELUPMOUSE)) && (block->direction & UI_DIR_UP)))
|
||||
{
|
||||
/* the following is just a hack - uiBut->type set to UI_BTYPE_BUT and UI_BTYPE_BUT_MENU have there menus built
|
||||
* opposite ways - this should be changed so that all popup-menus use the same uiBlock->direction */
|
||||
/* the following is just a hack - uiBut->type set to
|
||||
* UI_BTYPE_BUT and UI_BTYPE_BUT_MENU have there menus built opposite ways -
|
||||
* this should be changed so that all popup-menus use the same uiBlock->direction */
|
||||
if (but->type & type_flip)
|
||||
but = ui_but_next(but);
|
||||
else
|
||||
|
Reference in New Issue
Block a user