Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-07-15 23:19:43 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-07-15 23:19:43 +0400
commit4df1836325bd2847f3c88eb6fafa98e7bafea81c (patch)
treec97e1fb46527bdec40f787457cee1152405a990d /source
parent097d05a1afed5d3a6e919c8885da92e35fe482bc (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')
-rw-r--r--source/blender/blenloader/intern/readfile.c3
-rw-r--r--source/blender/editors/interface/interface_panel.c2
-rw-r--r--source/blender/editors/interface/resources.c4
-rw-r--r--source/blender/editors/screen/area.c4
-rw-r--r--source/blender/editors/space_buttons/space_buttons.c31
-rw-r--r--source/blender/editors/space_info/space_info.c32
-rw-r--r--source/blender/makesrna/intern/rna_context.c12
7 files changed, 26 insertions, 62 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 12d95888c0e..37dda0e41f4 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -9191,6 +9191,9 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
+ if (main->versionfile < 250 || (main->versionfile == 250 && main->subversionfile < 1)) {
+ }
+
/* TODO: should be moved into one of the version blocks once this branch moves to trunk and we can
bump the version (or sub-version.) */
{
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);
diff --git a/source/blender/makesrna/intern/rna_context.c b/source/blender/makesrna/intern/rna_context.c
index 7fa27348002..5e164c6525f 100644
--- a/source/blender/makesrna/intern/rna_context.c
+++ b/source/blender/makesrna/intern/rna_context.c
@@ -25,6 +25,7 @@
#include <stdlib.h>
#include "DNA_ID.h"
+#include "DNA_userdef_types.h"
#include "RNA_access.h"
#include "RNA_define.h"
@@ -102,6 +103,13 @@ static PointerRNA rna_Context_tool_settings_get(PointerRNA *ptr)
return rna_pointer_inherit_refine(ptr, &RNA_ToolSettings, CTX_data_tool_settings(C));
}
+static PointerRNA rna_Context_user_preferences_get(PointerRNA *ptr)
+{
+ PointerRNA newptr;
+ RNA_pointer_create(NULL, &RNA_UserPreferences, &U, &newptr);
+ return newptr;
+}
+
#else
void RNA_def_context(BlenderRNA *brna)
@@ -165,6 +173,10 @@ void RNA_def_context(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "ToolSettings");
RNA_def_property_pointer_funcs(prop, "rna_Context_tool_settings_get", NULL, NULL);
+ prop= RNA_def_property(srna, "user_preferences", PROP_POINTER, PROP_NONE);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_struct_type(prop, "UserPreferences");
+ RNA_def_property_pointer_funcs(prop, "rna_Context_user_preferences_get", NULL, NULL);
}
#endif