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 :)
This commit is contained in:
@@ -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);
|
||||
|
@@ -723,6 +723,7 @@ static void write_userdef(WriteData *wd)
|
||||
wmKeyMap *keymap;
|
||||
wmKeyMapItem *kmi;
|
||||
bAddon *bext;
|
||||
uiStyle *style;
|
||||
|
||||
writestruct(wd, USER, "UserDef", 1, &U);
|
||||
|
||||
@@ -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)
|
||||
|
@@ -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;
|
||||
|
@@ -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");
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user