[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [37792] trunk/blender/source/blender: First commit to make "Style" settings saved in startup.blend

Ton Roosendaal ton at blender.org
Fri Jun 24 16:00:16 CEST 2011


Revision: 37792
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37792
Author:   ton
Date:     2011-06-24 14:00:15 +0000 (Fri, 24 Jun 2011)
Log Message:
-----------
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 :)

Modified Paths:
--------------
    trunk/blender/source/blender/blenloader/intern/readfile.c
    trunk/blender/source/blender/blenloader/intern/writefile.c
    trunk/blender/source/blender/editors/interface/interface_style.c
    trunk/blender/source/blender/makesrna/intern/rna_userdef.c

Modified: trunk/blender/source/blender/blenloader/intern/readfile.c
===================================================================
--- trunk/blender/source/blender/blenloader/intern/readfile.c	2011-06-24 13:27:51 UTC (rev 37791)
+++ trunk/blender/source/blender/blenloader/intern/readfile.c	2011-06-24 14:00:15 UTC (rev 37792)
@@ -11757,7 +11757,8 @@
 
 	// 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);

Modified: trunk/blender/source/blender/blenloader/intern/writefile.c
===================================================================
--- trunk/blender/source/blender/blenloader/intern/writefile.c	2011-06-24 13:27:51 UTC (rev 37791)
+++ trunk/blender/source/blender/blenloader/intern/writefile.c	2011-06-24 14:00:15 UTC (rev 37792)
@@ -723,7 +723,8 @@
 	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 @@
 
 	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)

Modified: trunk/blender/source/blender/editors/interface/interface_style.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_style.c	2011-06-24 13:27:51 UTC (rev 37791)
+++ trunk/blender/source/blender/editors/interface/interface_style.c	2011-06-24 14:00:15 UTC (rev 37792)
@@ -83,7 +83,7 @@
 	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;

Modified: trunk/blender/source/blender/makesrna/intern/rna_userdef.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_userdef.c	2011-06-24 13:27:51 UTC (rev 37791)
+++ trunk/blender/source/blender/makesrna/intern/rna_userdef.c	2011-06-24 14:00:15 UTC (rev 37792)
@@ -361,36 +361,37 @@
 	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");
 	
 }	




More information about the Bf-blender-cvs mailing list