diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-06-04 10:31:30 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-06-04 10:31:30 +0300 |
commit | 44505b38df557a5711703613685a1dec9fc2c3d9 (patch) | |
tree | 3f05bebcc7bfadf56569f2dcca7f95fc56b1b0d0 /source/blender/editors/space_view3d/view3d_toolbar.c | |
parent | 6654e109df952be3a3128fae2508a02c196ae593 (diff) |
Cleanup: strip trailing space in editors
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_toolbar.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_toolbar.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/source/blender/editors/space_view3d/view3d_toolbar.c b/source/blender/editors/space_view3d/view3d_toolbar.c index 3e61809671a..e7ae0d39a2b 100644 --- a/source/blender/editors/space_view3d/view3d_toolbar.c +++ b/source/blender/editors/space_view3d/view3d_toolbar.c @@ -137,15 +137,15 @@ typedef struct CustomTool { static void operator_call_cb(struct bContext *C, void *arg_listbase, void *arg2) { wmOperatorType *ot = arg2; - + if (ot) { CustomTool *ct = MEM_callocN(sizeof(CustomTool), "CustomTool"); - + BLI_addtail(arg_listbase, ct); BLI_strncpy(ct->opname, ot->idname, OP_MAX_TYPENAME); BLI_strncpy(ct->context, CTX_data_mode_string(C), OP_MAX_TYPENAME); } - + } static void operator_search_cb(const struct bContext *C, void *UNUSED(arg), const char *str, uiSearchItems *items) @@ -157,7 +157,7 @@ static void operator_search_cb(const struct bContext *C, void *UNUSED(arg), cons if (BLI_strcasestr(ot->name, str)) { if (WM_operator_poll((bContext *)C, ot)) { - + if (false == UI_search_item_add(items, ot->name, ot, 0)) break; } @@ -174,30 +174,30 @@ static uiBlock *tool_search_menu(bContext *C, ARegion *ar, void *arg_listbase) wmWindow *win = CTX_wm_window(C); uiBlock *block; uiBut *but; - + /* clear initial search string, then all items show */ search[0] = 0; - + block = UI_block_begin(C, ar, "_popup", UI_EMBOSS); UI_block_flag_enable(block, UI_BLOCK_LOOP | UI_BLOCK_SEARCH_MENU); - + /* fake button, it holds space for search items */ uiDefBut(block, UI_BTYPE_LABEL, 0, "", 10, 15, UI_searchbox_size_x(), UI_searchbox_size_y(), NULL, 0, 0, 0, 0, NULL); - + but = uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 0, 150, 19, 0, 0, ""); UI_but_func_search_set(but, NULL, operator_search_cb, arg_listbase, operator_call_cb, NULL); - + UI_block_bounds_set_normal(block, 6); UI_block_direction_set(block, UI_DIR_DOWN); UI_block_end(C, block); - + wm_event_init_from_window(win, &event); event.type = EVT_BUT_OPEN; event.val = KM_PRESS; event.customdata = but; event.customdatafree = false; wm_event_add(win, &event); - + return block; } @@ -208,13 +208,13 @@ static void view3d_panel_tool_shelf(const bContext *C, Panel *pa) SpaceType *st = NULL; uiLayout *col; const char *context = CTX_data_mode_string(C); - + if (sl) st = BKE_spacetype_from_id(sl->spacetype); - + if (st && st->toolshelf.first) { CustomTool *ct; - + for (ct = st->toolshelf.first; ct; ct = ct->next) { if (STREQLEN(context, ct->context, OP_MAX_TYPENAME)) { col = uiLayoutColumn(pa->layout, true); @@ -242,7 +242,7 @@ void view3d_toolshelf_register(ARegionType *art) void view3d_tool_props_register(ARegionType *art) { PanelType *pt; - + pt = MEM_callocN(sizeof(PanelType), "spacetype view3d panel last operator"); strcpy(pt->idname, "VIEW3D_PT_last_operator"); strcpy(pt->label, N_("Operator")); @@ -258,7 +258,7 @@ static int view3d_toolshelf_toggle_exec(bContext *C, wmOperator *UNUSED(op)) { ScrArea *sa = CTX_wm_area(C); ARegion *ar = view3d_has_tools_region(sa); - + if (ar) ED_region_toggle_hidden(C, ar); @@ -270,10 +270,10 @@ void VIEW3D_OT_toolshelf(wmOperatorType *ot) ot->name = "Tool Shelf"; ot->description = "Toggles tool shelf display"; ot->idname = "VIEW3D_OT_toolshelf"; - + ot->exec = view3d_toolshelf_toggle_exec; ot->poll = ED_operator_view3d_active; - + /* flags */ ot->flag = 0; } |