diff options
author | ack-err <ack-err> | 2013-09-03 13:11:07 +0400 |
---|---|---|
committer | ack-err <ack-err> | 2013-09-03 13:11:07 +0400 |
commit | 53177d165064428b0a82a42958871b6037d11315 (patch) | |
tree | 439242e2a23a596bceb590a3d13af0a6cd8096c1 | |
parent | 76b91a29f59bfedf566bed188511f7f95d8082a2 (diff) |
Commented out menubar text menus. It now displays only custom buttons.
-rw-r--r-- | source/blender/editors/screen/area.c | 82 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/space_view3d.c | 2 |
2 files changed, 42 insertions, 42 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 0285a25f0b1..158be10d39f 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -956,17 +956,17 @@ static void region_rect_recursive(wmWindow *win, ScrArea *sa, ARegion *ar, rcti /* prefsize, for header we stick to exception (prevent dpi rounding error) */ prefsizex = UI_DPI_FAC * (ar->sizex > 1 ? ar->sizex + 0.5f : ar->type->prefsizex); - if (ar->regiontype == RGN_TYPE_HEADER) { + if (ar->regiontype == RGN_TYPE_HEADER || ar->regiontype == RGN_TYPE_MENU_BAR) { prefsizey = ED_area_headersize(); } - else if (ar->regiontype == RGN_TYPE_MENU_BAR) { - /* quantize sizey to once or twice the headysize */ - int headersize = ED_area_headersize(); - if (ar->sizey > 0 && ar->sizey <= headersize) - prefsizey = headersize; - else if (ar->sizey > headersize) - prefsizey = 2 * headersize; - } +// else if (ar->regiontype == RGN_TYPE_MENU_BAR) { +// /* quantize sizey to once or twice the headysize */ +// int headersize = ED_area_headersize(); +// if (ar->sizey > 0 && ar->sizey <= headersize) +// prefsizey = headersize; +// else if (ar->sizey > headersize) +// prefsizey = 2 * headersize; +// } else if (ar->regiontype == RGN_TYPE_UI && sa->spacetype == SPACE_FILE) { prefsizey = UI_UNIT_Y * 2 + (UI_UNIT_Y / 2); } @@ -1867,11 +1867,11 @@ void ED_region_menubar(const bContext *C, ARegion *ar) uiStyle *style = UI_GetStyleDraw(); uiBlock *block; uiLayout *layout, *row; - MenuBarType *mbt; - MenuBar mb = {NULL}; +// MenuBarType *mbt; +// MenuBar mb = {NULL}; int maxco, xco, yco; - int headery = ED_area_headersize() * 2; - const char *context = CTX_data_mode_string(C); + int headery = ED_area_headersize(); +// const char *context = CTX_data_mode_string(C); OperatorListItem *oli; /* clear */ @@ -1881,37 +1881,37 @@ void ED_region_menubar(const bContext *C, ARegion *ar) /* set view2d view matrix for scrolling (without scrollers) */ UI_view2d_view_ortho(&ar->v2d); - xco = maxco = 0.4f * UI_UNIT_X; - yco = headery - floor(0.2f * UI_UNIT_Y); - - block = uiBeginBlock(C, ar, "menubar menus", UI_EMBOSS); - layout = uiBlockLayout(block, UI_LAYOUT_HORIZONTAL, UI_LAYOUT_HEADER, xco, yco, UI_UNIT_Y, 1, style); - - /* add all menubar types to the top bar */ - for (mbt = ar->type->menubartypes.first; mbt; mbt = mbt->next) { - - /* verify context */ - if (context) - if (mbt->context[0] && strcmp(context, mbt->context) != 0) - continue; - - if (mbt->draw) { - mb.type = mbt; - mb.layout = layout; - mbt->draw(C, &mb); - } - } - - /* draw top bar */ - xco = uiLayoutGetWidth(layout); - if (xco > maxco) maxco = xco; - uiBlockLayoutResolve(block, &xco, &yco); - uiEndBlock(C, block); - uiDrawBlock(C, block); +// xco = maxco = 0.4f * UI_UNIT_X; +// yco = headery - floor(0.2f * UI_UNIT_Y); +// +// block = uiBeginBlock(C, ar, "menubar menus", UI_EMBOSS); +// layout = uiBlockLayout(block, UI_LAYOUT_HORIZONTAL, UI_LAYOUT_HEADER, xco, yco, UI_UNIT_Y, 1, style); +// +// /* add all menubar types to the top bar */ +// for (mbt = ar->type->menubartypes.first; mbt; mbt = mbt->next) { +// +// /* verify context */ +// if (context) +// if (mbt->context[0] && strcmp(context, mbt->context) != 0) +// continue; +// +// if (mbt->draw) { +// mb.type = mbt; +// mb.layout = layout; +// mbt->draw(C, &mb); +// } +// } +// +// /* draw top bar */ +// xco = uiLayoutGetWidth(layout); +// if (xco > maxco) maxco = xco; +// uiBlockLayoutResolve(block, &xco, &yco); +// uiEndBlock(C, block); +// uiDrawBlock(C, block); /* add all custom buttons to lower bar */ xco = maxco = 0.4f * UI_UNIT_X; - yco = headery/2 - floor(0.2f * UI_UNIT_Y); + yco = headery - floor(0.2f * UI_UNIT_Y); block = uiBeginBlock(C, ar, "menubar icons", UI_EMBOSS); layout = uiBlockLayout(block, UI_LAYOUT_HORIZONTAL, UI_LAYOUT_HEADER, xco, yco, UI_UNIT_Y, 1, style); diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index b225c53af78..1e3ab3cec12 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -1481,7 +1481,7 @@ void ED_spacetype_view3d(void) /* regions: operators menu bar */ art = MEM_callocN(sizeof(ARegionType), "spacetype view3d operators menu bar region"); art->regionid = RGN_TYPE_MENU_BAR; - art->prefsizey = ED_area_headersize() * 2; + art->prefsizey = ED_area_headersize(); art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_VIEW2D; art->listener = view3d_menubar_area_listener; art->init = view3d_menubar_area_init; |