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:
authorTon Roosendaal <ton@blender.org>2011-06-24 18:00:15 +0400
committerTon Roosendaal <ton@blender.org>2011-06-24 18:00:15 +0400
commit05fb0e2d61f49b138e4f1c0abd8465cf77f95eca (patch)
tree1b305aae3524f14a7323bff4d45ad8324df0fe34 /source
parentebff5d5fb2335ff3ae76676c701435293fe19b42 (diff)
First commit to make "Style" settings saved in startup.blend
Usage currently is limited to: - Panel text, widget text and label text style: point size, shadow effects Setting individual fonts to these is not possible yet, it uses the default for it. Access goes via outliner now; check "User Preferences". UI team could add this in userpref scripts :)
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenloader/intern/readfile.c3
-rw-r--r--source/blender/blenloader/intern/writefile.c7
-rw-r--r--source/blender/editors/interface/interface_style.c2
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c13
4 files changed, 16 insertions, 9 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 462124bb65d..bd1764b2dc9 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -11757,7 +11757,8 @@ static BHead *read_userdef(BlendFileData *bfd, FileData *fd, BHead *bhead)
// XXX
user->uifonts.first= user->uifonts.last= NULL;
- user->uistyles.first= user->uistyles.last= NULL;
+
+ link_list(fd, &user->uistyles);
/* free fd->datamap again */
oldnewmap_free_unused(fd->datamap);
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 240e8d00ab8..d5192eaf09c 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -723,7 +723,8 @@ static void write_userdef(WriteData *wd)
wmKeyMap *keymap;
wmKeyMapItem *kmi;
bAddon *bext;
-
+ uiStyle *style;
+
writestruct(wd, USER, "UserDef", 1, &U);
for(btheme= U.themes.first; btheme; btheme=btheme->next)
@@ -742,6 +743,10 @@ static void write_userdef(WriteData *wd)
for(bext= U.addons.first; bext; bext=bext->next)
writestruct(wd, DATA, "bAddon", 1, bext);
+
+ for(style= U.uistyles.first; style; style= style->next) {
+ writestruct(wd, DATA, "uiStyle", 1, style);
+ }
}
static void write_boid_state(WriteData *wd, BoidState *state)
diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c
index 2e4106b3c04..5f2a757d2e3 100644
--- a/source/blender/editors/interface/interface_style.c
+++ b/source/blender/editors/interface/interface_style.c
@@ -83,7 +83,7 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name)
BLI_addtail(styles, style);
BLI_strncpy(style->name, name, MAX_STYLE_NAME);
- style->panelzoom= 1.0;
+ style->panelzoom= 1.0; /* unused */
style->paneltitle.uifont_id= UIFONT_DEFAULT;
style->paneltitle.points= 12;
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 1bdb21d2d00..4d1e1f175f2 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -361,36 +361,37 @@ static void rna_def_userdef_theme_ui_style(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "uiStyle");
RNA_def_struct_ui_text(srna, "Style", "Theme settings for style sets");
+ /* (not used yet)
prop= RNA_def_property(srna, "panelzoom", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.5, 2.0);
RNA_def_property_ui_text(prop, "Panel Zoom", "Default zoom level for panel areas");
-
+ */
prop= RNA_def_property(srna, "panel_title", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "paneltitle");
RNA_def_property_struct_type(prop, "ThemeFontStyle");
- RNA_def_property_ui_text(prop, "Panel Font", "");
+ RNA_def_property_ui_text(prop, "Panel Style", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
-
+/* (not used yet)
prop= RNA_def_property(srna, "group_label", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "grouplabel");
RNA_def_property_struct_type(prop, "ThemeFontStyle");
RNA_def_property_ui_text(prop, "Group Label Font", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
-
+*/
prop= RNA_def_property(srna, "widget_label", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "widgetlabel");
RNA_def_property_struct_type(prop, "ThemeFontStyle");
- RNA_def_property_ui_text(prop, "Widget Label Font", "");
+ RNA_def_property_ui_text(prop, "Widget Label Style", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
prop= RNA_def_property(srna, "widget", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "widget");
RNA_def_property_struct_type(prop, "ThemeFontStyle");
- RNA_def_property_ui_text(prop, "Widget Font", "");
+ RNA_def_property_ui_text(prop, "Widget Style", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
}