diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-07-15 23:19:43 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-07-15 23:19:43 +0400 |
commit | 4df1836325bd2847f3c88eb6fafa98e7bafea81c (patch) | |
tree | c97e1fb46527bdec40f787457cee1152405a990d /source/blender/editors | |
parent | 097d05a1afed5d3a6e919c8885da92e35fe482bc (diff) |
2.5: User Preferences
* Added basic infrastructure to layout user preferences. The
intention is that you open a user preferences space in place
of the buttons space, and have panels there.
* The existing sections don't have to be followed, it's easy
to create different ones, just change the user_pref_sections
enum in RNA.
* This will get separated from the info header later.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/interface/interface_panel.c | 2 | ||||
-rw-r--r-- | source/blender/editors/interface/resources.c | 4 | ||||
-rw-r--r-- | source/blender/editors/screen/area.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_buttons/space_buttons.c | 31 | ||||
-rw-r--r-- | source/blender/editors/space_info/space_info.c | 32 |
5 files changed, 11 insertions, 62 deletions
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index a3c456c0a93..363717c29d3 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -104,6 +104,8 @@ static int panel_aligned(ScrArea *sa, ARegion *ar) SpaceButs *sbuts= sa->spacedata.first; return sbuts->align; } + else if(sa->spacetype==SPACE_INFO && ar->regiontype == RGN_TYPE_WINDOW) + return BUT_VERTICAL; else if(sa->spacetype==SPACE_FILE && ar->regiontype == RGN_TYPE_CHANNELS) return BUT_VERTICAL; else if(ELEM3(ar->regiontype, RGN_TYPE_UI, RGN_TYPE_TOOLS, RGN_TYPE_TOOL_PROPS)) diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index 2798f7a473f..297e22610a6 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -581,7 +581,7 @@ void ui_theme_init_userdef(void) /* space info */ btheme->tinfo= btheme->tv3d; - SETCOL(btheme->tinfo.back, 153, 153, 153, 255); + SETCOLF(btheme->tinfo.back, 0.45, 0.45, 0.45, 1.0); /* space sound */ btheme->tsnd= btheme->tv3d; @@ -1231,6 +1231,8 @@ void init_userdef_do_versions(void) btheme->tlogic= btheme->tv3d; SETCOL(btheme->tlogic.back, 100, 100, 100, 255); } + + SETCOLF(btheme->tinfo.back, 0.45, 0.45, 0.45, 1.0); } } diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index e923a3bde61..addda6e02ee 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -1254,8 +1254,10 @@ void ED_region_panels_init(wmWindowManager *wm, ARegion *ar) { ListBase *keymap; - // XXX quick hack for files saved with 2.5 already (i.e. the builtin defaults file) + // XXX quick hacks for files saved with 2.5 already (i.e. the builtin defaults file) ar->v2d.scroll |= (V2D_SCROLL_RIGHT|V2D_SCROLL_BOTTOM); + if(!(ar->v2d.align & V2D_ALIGN_NO_POS_Y)) + ar->v2d.flag &= ~V2D_IS_INITIALISED; UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_PANELS_UI, ar->winx, ar->winy); diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c index 65fbdeb4205..9345a24b198 100644 --- a/source/blender/editors/space_buttons/space_buttons.c +++ b/source/blender/editors/space_buttons/space_buttons.c @@ -94,31 +94,6 @@ static SpaceLink *buttons_new(const bContext *C) BLI_addtail(&sbuts->regionbase, ar); ar->regiontype= RGN_TYPE_WINDOW; -#if 0 // disabled, as this currently draws badly in new system - /* buts space goes from (0,0) to (1280, 228) */ - ar->v2d.tot.xmin= 0.0f; - ar->v2d.tot.ymin= 0.0f; - ar->v2d.tot.xmax= 1279.0f; - ar->v2d.tot.ymax= 228.0f; - - ar->v2d.cur= sbuts->v2d.tot; - - ar->v2d.min[0]= 256.0f; - ar->v2d.min[1]= 42.0f; - - ar->v2d.max[0]= 2048.0f; - ar->v2d.max[1]= 450.0f; - - ar->v2d.minzoom= 0.5f; - ar->v2d.maxzoom= 1.21f; - - ar->v2d.scroll= 0; // TODO: will we need scrollbars? - ar->v2d.align= V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_NEG_Y; - ar->v2d.keepzoom= V2D_KEEPZOOM|V2D_KEEPASPECT; - ar->v2d.keeptot= V2D_KEEPTOT_BOUNDS; -#endif - - return (SpaceLink *)sbuts; } @@ -164,13 +139,7 @@ static SpaceLink *buttons_duplicate(SpaceLink *sl) /* add handlers, stuff you only do once or on area/region changes */ static void buttons_main_area_init(wmWindowManager *wm, ARegion *ar) { - ListBase *keymap; - ED_region_panels_init(wm, ar); - - /* own keymap */ - keymap= WM_keymap_listbase(wm, "Buttons", SPACE_BUTS, 0); /* XXX weak? */ - WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); } static void buttons_main_area_draw(const bContext *C, ARegion *ar) diff --git a/source/blender/editors/space_info/space_info.c b/source/blender/editors/space_info/space_info.c index 7b24e8f4e07..60d8b17668e 100644 --- a/source/blender/editors/space_info/space_info.c +++ b/source/blender/editors/space_info/space_info.c @@ -84,9 +84,6 @@ static SpaceLink *info_new(const bContext *C) BLI_addtail(&sinfo->regionbase, ar); ar->regiontype= RGN_TYPE_WINDOW; - /* channel list region XXX */ - - return (SpaceLink *)sinfo; } @@ -118,35 +115,12 @@ static SpaceLink *info_duplicate(SpaceLink *sl) /* add handlers, stuff you only do once or on area/region changes */ static void info_main_area_init(wmWindowManager *wm, ARegion *ar) { - ListBase *keymap; - - UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_STANDARD, ar->winx, ar->winy); - - /* own keymap */ - keymap= WM_keymap_listbase(wm, "info", SPACE_INFO, 0); /* XXX weak? */ - WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); + ED_region_panels_init(wm, ar); } static void info_main_area_draw(const bContext *C, ARegion *ar) { - /* draw entirely, view changes should be handled here */ - // SpaceInfo *sinfo= (SpaceInfo*)CTX_wm_space_data(C); - View2D *v2d= &ar->v2d; - float col[3]; - - /* clear and setup matrix */ - UI_GetThemeColor3fv(TH_BACK, col); - glClearColor(col[0], col[1], col[2], 0.0); - glClear(GL_COLOR_BUFFER_BIT); - - UI_view2d_view_ortho(C, v2d); - - /* data... */ - - /* reset view matrix */ - UI_view2d_view_restore(C); - - /* scrollers? */ + ED_region_panels(C, ar, 1, NULL); } void info_operatortypes(void) @@ -217,7 +191,7 @@ void ED_spacetype_info(void) art->init= info_main_area_init; art->draw= info_main_area_draw; art->listener= info_main_area_listener; - art->keymapflag= ED_KEYMAP_VIEW2D; + art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D; BLI_addhead(&st->regiontypes, art); |