diff options
author | Joshua Leung <aligorith@gmail.com> | 2008-12-13 02:25:54 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2008-12-13 02:25:54 +0300 |
commit | 56557f223fb9c9afae0965fb564b9c189e97f5cb (patch) | |
tree | 846332e23b6e1fed438d56469bdc0a4677d64fed /source/blender/editors/space_outliner | |
parent | f3dc0ba876d37f7c85c3fc1408b24f962a88642e (diff) |
2.5 - Assorted View2D related fixes
IPO Editor Fixes:
* Grid now draws correct. Fixed typo in gridline calculations preventing drawing from occurring. Also, set the right arguments to the appropriate View2D calls.
* Limited Ton's cur<->mask mapping 'hack' to Outliner only, as it was causing problems with the drawing of the grid. Perhaps there's still some faulty code in curRect_validate that should be changed instead...
* Horizontal scroller draws frames now by default. However, the values are still offset a bit, so will need further investigation.
Outliner Fixes:
* Fixed overlapping text problem with RNA-path and menus. Now RNA path draws as a label beside the menus, so there shouldn't be any more problems there.
* do_versions code now sets all appropriate flags, as old OOPS views could cause errors with scroller drawing + view manipulation operators which depend on flags being set.
Diffstat (limited to 'source/blender/editors/space_outliner')
-rw-r--r-- | source/blender/editors/space_outliner/outliner_header.c | 17 | ||||
-rw-r--r-- | source/blender/editors/space_outliner/space_outliner.c | 19 |
2 files changed, 15 insertions, 21 deletions
diff --git a/source/blender/editors/space_outliner/outliner_header.c b/source/blender/editors/space_outliner/outliner_header.c index 87e3253dae9..2765d80cf8c 100644 --- a/source/blender/editors/space_outliner/outliner_header.c +++ b/source/blender/editors/space_outliner/outliner_header.c @@ -106,8 +106,10 @@ static void do_outliner_buttons(bContext *C, void *arg, int event) void outliner_header_buttons(const bContext *C, ARegion *ar) { ScrArea *sa= C->area; + SpaceOops *soutliner= sa->spacedata.first; uiBlock *block; int xco, yco= 3; + char *path; block= uiBeginBlock(C, ar, "header buttons", UI_EMBOSS, UI_HELV); uiBlockSetHandleFunc(block, do_outliner_buttons, NULL); @@ -151,11 +153,20 @@ void outliner_header_buttons(const bContext *C, ARegion *ar) xmax= GetButStringLength("View"); uiDefPulldownBut(block, dummy_viewmenu, C->area, - "View", xco, yco-2, xmax-3, 24, ""); + "View", xco, yco-2, xmax-3, 24, ""); + xco += xmax; + + /* header text */ + xco += XIC*2; + + path= (soutliner->rnapath)? soutliner->rnapath: "Main"; + xmax= GetButStringLength(path); + uiDefBut(block, LABEL, 0, path, xco, yco-2, xmax-3, 24, 0, 0, 0, 0, 0, "Current RNA Path"); + xco += xmax; + + uiBlockSetEmboss(block, UI_EMBOSS); } - uiBlockSetEmboss(block, UI_EMBOSS); - /* always as last */ sa->headbutlen= xco+XIC+80; // +80 because the last button is not an icon diff --git a/source/blender/editors/space_outliner/space_outliner.c b/source/blender/editors/space_outliner/space_outliner.c index 229c473625f..7ddcd87d867 100644 --- a/source/blender/editors/space_outliner/space_outliner.c +++ b/source/blender/editors/space_outliner/space_outliner.c @@ -444,14 +444,8 @@ static void outliner_main_area_free(ARegion *ar) static void outliner_header_area_draw(const bContext *C, ARegion *ar) { - SpaceOops *soutliner= C->area->spacedata.first; float col[3]; - int width, height; - rctf bbox; - char *path; - - path= (soutliner->rnapath)? soutliner->rnapath: "Main"; - + if(ED_screen_area_active(C)) UI_GetThemeColor3fv(TH_HEADER, col); else @@ -461,17 +455,6 @@ static void outliner_header_area_draw(const bContext *C, ARegion *ar) glClear(GL_COLOR_BUFFER_BIT); outliner_header_buttons(C, ar); - - width= ar->winrct.xmax - ar->winrct.xmin; - height= ar->winrct.ymax - ar->winrct.ymin; - - /* header text */ - UI_GetBoundingBox(UI_HELV, path, 0, &bbox); - - glColor3f(1.0f, 1.0f, 1.0f); - UI_SetScale(1.0); - UI_RasterPos(50 + 0.5f*(width - (bbox.xmax - bbox.xmin)), 0.5f*(height - (bbox.ymax - bbox.ymin))); - UI_DrawString(UI_HELV, path, 0); } static void outliner_header_area_free(ARegion *ar) |