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:
authorXiao Xiangquan <xiaoxiangquan@gmail.com>2011-07-16 22:28:24 +0400
committerXiao Xiangquan <xiaoxiangquan@gmail.com>2011-07-16 22:28:24 +0400
commit77926a7f9d7c8f07bc4aa70c48ade0f7927836b4 (patch)
tree175c606a9547f3b534a44527583824d0d7ab7be6 /source
parentfa46278e347ca173e9e6d6b734a59c268f4fc9d0 (diff)
select uiStyle according to UserDef and update lang-packs
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenfont/BLF_api.h3
-rw-r--r--source/blender/blenfont/intern/blf.c1
-rw-r--r--source/blender/blenfont/intern/blf_lang.c10
-rw-r--r--source/blender/editors/include/UI_interface.h2
-rw-r--r--source/blender/editors/interface/interface.c4
-rw-r--r--source/blender/editors/interface/interface_handlers.c6
-rw-r--r--source/blender/editors/interface/interface_panel.c6
-rw-r--r--source/blender/editors/interface/interface_regions.c10
-rw-r--r--source/blender/editors/interface/interface_style.c29
-rw-r--r--source/blender/editors/interface/view2d.c2
-rw-r--r--source/blender/editors/interface/view2d_ops.c3
-rw-r--r--source/blender/editors/screen/area.c4
-rw-r--r--source/blender/editors/space_file/file_draw.c2
-rw-r--r--source/blender/editors/space_file/filesel.c6
-rw-r--r--source/blender/editors/space_logic/logic_window.c6
-rw-r--r--source/blender/editors/space_node/node_draw.c6
-rw-r--r--source/blender/makesdna/DNA_userdef_types.h1
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c8
18 files changed, 53 insertions, 56 deletions
diff --git a/source/blender/blenfont/BLF_api.h b/source/blender/blenfont/BLF_api.h
index 9847b6ce838..88c29d43d25 100644
--- a/source/blender/blenfont/BLF_api.h
+++ b/source/blender/blenfont/BLF_api.h
@@ -188,8 +188,6 @@ void BLF_lang_init(void);
/* Set the current locale. */
void BLF_lang_set(const char *);
-/* Get the current locale. */
-char* BLF_lang_get(void);
/* Set the current encoding name. */
void BLF_lang_encoding_name(const char *str);
@@ -222,7 +220,6 @@ extern int blf_mono_font_render; // dont mess drawing with render threads.
// XXX, me, too
extern int blf_unifont;
-extern int blf_unifont_render; // dont mess drawing with render threads.
#define _(msgid) BLF_gettext(msgid)
#define N_(msgid) msgid
diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c
index 643c2826403..87d380c1b2a 100644
--- a/source/blender/blenfont/intern/blf.c
+++ b/source/blender/blenfont/intern/blf.c
@@ -77,7 +77,6 @@ int blf_mono_font_render= -1;
// XXX, should these be made into global_font_'s too?
int blf_unifont= -1;
-int blf_unifont_render= -1;
static FontBLF *BLF_get(int fontid)
{
diff --git a/source/blender/blenfont/intern/blf_lang.c b/source/blender/blenfont/intern/blf_lang.c
index 6a3e5b1f2ef..6ea9a259286 100644
--- a/source/blender/blenfont/intern/blf_lang.c
+++ b/source/blender/blenfont/intern/blf_lang.c
@@ -117,11 +117,6 @@ void BLF_lang_encoding(const char *str)
/* bind_textdomain_codeset(DOMAIN_NAME, encoding_name); */
}
-char* BLF_lang_get(void)
-{
- return global_language;
-}
-
#else /* ! INTERNATIONAL */
void BLF_lang_init(void)
@@ -141,9 +136,4 @@ void BLF_lang_set(const char *str)
return;
}
-char* BLF_lang_get(void)
-{
- return "";
-}
-
#endif /* INTERNATIONAL */
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h
index 61e19655f8d..852b0465910 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -774,7 +774,7 @@ void uiStyleFontDrawRotated(struct uiFontStyle *fs, struct rcti *rect, const cha
int UI_GetStringWidth(const char *str); // XXX temp
void UI_DrawString(float x, float y, const char *str); // XXX temp
void UI_DrawTriIcon(float x, float y, char dir);
-
+uiStyle* UI_GetStyle(void);
/* linker workaround ack! */
void UI_template_fix_linking(void);
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 8aed0d58a07..ef8bff1fd7d 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -228,7 +228,7 @@ void ui_block_translate(uiBlock *block, int x, int y)
static void ui_text_bounds_block(uiBlock *block, float offset)
{
- uiStyle *style= U.uistyles.first; // XXX pass on as arg
+ uiStyle *style=UI_GetStyle();
uiBut *bt;
int i = 0, j, x1addval= offset, nextcol;
int lastcol= 0, col= 0;
@@ -908,7 +908,7 @@ static void ui_but_to_pixelrect(rcti *rect, const ARegion *ar, uiBlock *block, u
/* uses local copy of style, to scale things down, and allow widgets to change stuff */
void uiDrawBlock(const bContext *C, uiBlock *block)
{
- uiStyle style= *((uiStyle *)U.uistyles.first); // XXX pass on as arg
+ uiStyle style= *UI_GetStyle(); // XXX pass on as arg
ARegion *ar;
uiBut *but;
rcti rect;
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index e9ec4ccc66d..8b84afe9dfd 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -1270,7 +1270,7 @@ static int ui_textedit_delete_selection(uiBut *but, uiHandleButtonData *data)
/* note, but->block->aspect is used here, when drawing button style is getting scaled too */
static void ui_textedit_set_cursor_pos(uiBut *but, uiHandleButtonData *data, short x)
{
- uiStyle *style= U.uistyles.first; // XXX pass on as arg
+ uiStyle *style= UI_GetStyle(); // XXX pass on as arg
uiFontStyle *fstyle = &style->widget;
int startx= but->x1;
char *origstr;
@@ -4102,7 +4102,7 @@ static uiBlock *menu_change_shortcut(bContext *C, ARegion *ar, void *arg)
wmKeyMapItem *kmi;
PointerRNA ptr;
uiLayout *layout;
- uiStyle *style= U.uistyles.first;
+ uiStyle *style= UI_GetStyle();
IDProperty *prop= (but->opptr)? but->opptr->data: NULL;
int kmi_id = WM_key_event_operator_id(C, but->optype->idname, but->opcontext, prop, 1, &km);
@@ -4133,7 +4133,7 @@ static uiBlock *menu_add_shortcut(bContext *C, ARegion *ar, void *arg)
wmKeyMapItem *kmi;
PointerRNA ptr;
uiLayout *layout;
- uiStyle *style= U.uistyles.first;
+ uiStyle *style= UI_GetStyle();
IDProperty *prop= (but->opptr)? but->opptr->data: NULL;
/* XXX this guess_opname can potentially return a different keymap than being found on adding later... */
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index 9ed3cabb4cb..c19d9884c8b 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -173,7 +173,7 @@ static void ui_panel_copy_offset(Panel *pa, Panel *papar)
Panel *uiBeginPanel(ScrArea *sa, ARegion *ar, uiBlock *block, PanelType *pt, int *open)
{
- uiStyle *style= U.uistyles.first;
+ uiStyle *style= UI_GetStyle();
Panel *pa, *patab, *palast, *panext;
char *drawname= pt->label;
char *idname= pt->idname;
@@ -292,7 +292,7 @@ void uiEndPanel(uiBlock *block, int width, int height)
static void ui_offset_panel_block(uiBlock *block)
{
- uiStyle *style= U.uistyles.first;
+ uiStyle *style= UI_GetStyle();
uiBut *but;
int ofsy;
@@ -667,7 +667,7 @@ static int compare_panel(const void *a1, const void *a2)
/* returns 1 when it did something */
static int uiAlignPanelStep(ScrArea *sa, ARegion *ar, float fac, int drag)
{
- uiStyle *style= U.uistyles.first;
+ uiStyle *style= UI_GetStyle();
Panel *pa;
PanelSort *ps, *panelsort, *psnext;
int a, tot=0, done;
diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c
index fbc0c2ceb3b..b6f855d2263 100644
--- a/source/blender/editors/interface/interface_regions.c
+++ b/source/blender/editors/interface/interface_regions.c
@@ -318,7 +318,7 @@ static void ui_tooltip_region_draw_cb(const bContext *UNUSED(C), ARegion *ar)
rcti bbox= data->bbox;
int a;
- ui_draw_menu_back(U.uistyles.first, NULL, &data->bbox);
+ ui_draw_menu_back(UI_GetStyle(), NULL, &data->bbox);
/* draw text */
uiStyleFontSet(&data->fstyle);
@@ -345,7 +345,7 @@ static void ui_tooltip_region_free_cb(ARegion *ar)
ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
{
- uiStyle *style= U.uistyles.first; // XXX pass on as arg
+ uiStyle *style= UI_GetStyle();
static ARegionType type;
ARegion *ar;
uiTooltipData *data;
@@ -973,7 +973,7 @@ static void ui_searchbox_region_free_cb(ARegion *ar)
ARegion *ui_searchbox_create(bContext *C, ARegion *butregion, uiBut *but)
{
- uiStyle *style= U.uistyles.first; // XXX pass on as arg
+ uiStyle *style= UI_GetStyle();
static ARegionType type;
ARegion *ar;
uiSearchboxData *data;
@@ -2288,7 +2288,7 @@ static uiBlock *ui_block_func_POPUP(bContext *C, uiPopupBlockHandle *handle, voi
uiPopupBlockHandle *ui_popup_menu_create(bContext *C, ARegion *butregion, uiBut *but, uiMenuCreateFunc menu_func, void *arg, char *str)
{
wmWindow *window= CTX_wm_window(C);
- uiStyle *style= U.uistyles.first;
+ uiStyle *style= UI_GetStyle();
uiPopupBlockHandle *handle;
uiPopupMenu *pup;
@@ -2337,7 +2337,7 @@ uiPopupBlockHandle *ui_popup_menu_create(bContext *C, ARegion *butregion, uiBut
/* only return handler, and set optional title */
uiPopupMenu *uiPupMenuBegin(bContext *C, const char *title, int icon)
{
- uiStyle *style= U.uistyles.first;
+ uiStyle *style= UI_GetStyle();
uiPopupMenu *pup= MEM_callocN(sizeof(uiPopupMenu), "popup menu");
uiBut *but;
diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c
index efc26e11920..8aab414a803 100644
--- a/source/blender/editors/interface/interface_style.c
+++ b/source/blender/editors/interface/interface_style.c
@@ -252,10 +252,16 @@ void uiStyleFontDrawRotated(uiFontStyle *fs, rcti *rect, const char *str)
/* ************** helpers ************************ */
+uiStyle* UI_GetStyle(void)
+{
+ uiStyle *style = BLI_findstring( &U.uistyles, U.myuistyle, sizeof(style)*2 );
+ return (style != NULL) ? style : U.uifonts.first;
+}
+
/* temporarily, does widget font */
int UI_GetStringWidth(const char *str)
{
- uiStyle *style= U.uistyles.first;
+ uiStyle *style= UI_GetStyle();
uiFontStyle *fstyle= &style->widget;
int width;
@@ -274,7 +280,7 @@ int UI_GetStringWidth(const char *str)
/* temporarily, does widget font */
void UI_DrawString(float x, float y, const char *str)
{
- uiStyle *style= U.uistyles.first;
+ uiStyle *style= UI_GetStyle();
if (style->widget.kerning == 1)
BLF_enable(style->widget.uifont_id, BLF_KERNING_DEFAULT);
@@ -295,7 +301,6 @@ void uiStyleInit(void)
{
uiFont *font= U.uifonts.first;
uiStyle *style= U.uistyles.first;
- char *lang_set= BLF_lang_get();
/* recover from uninitialized dpi */
if(U.dpi == 0)
@@ -336,7 +341,11 @@ void uiStyleInit(void)
BLF_size(font->blf_id, 14, U.dpi);
}
}
-
+
+ if(style==NULL) {
+ ui_style_new(&U.uistyles, "Default Style", UIFONT_DEFAULT );
+ }
+
// XXX, this should be moved into a style, but for now best only load the monospaced font once.
if (blf_mono_font == -1)
blf_mono_font= BLF_load_mem_unique("monospace", (unsigned char *)datatoc_bmonofont_ttf, datatoc_bmonofont_ttf_size);
@@ -349,10 +358,9 @@ void uiStyleInit(void)
BLF_size(blf_mono_font_render, 12, 72);
- /* XXX Maybe it's bad to do this */
- if(style==NULL) {
- // load unifont only when need. It takes 15MB memories
- // get_datatoc_bunifont_ttf() may return null, BLF_load_mem_unique() will handle it
+ /* offset is two struct uiStyle pointers */
+ if( BLI_findstring( &U.uistyles, "Unifont Style", sizeof(style)*2 )==NULL )
+ {
if( blf_unifont == -1 )
blf_unifont= BLF_load_mem_unique("unifont", (unsigned char *)get_datatoc_bunifont_ttf(), datatoc_bunifont_ttf_size);
if( blf_unifont != -1 )
@@ -360,9 +368,10 @@ void uiStyleInit(void)
BLF_size(blf_unifont, 12, 72);
ui_style_new(&U.uistyles, "Unifont Style", blf_unifont );
}
- else
- ui_style_new(&U.uistyles, "Default Style", UIFONT_DEFAULT );
}
+ /* init style setting */
+ if( U.myuistyle[0]==0 )
+ strcpy( U.myuistyle, "Unifont Style" );
}
void uiStyleFontSet(uiFontStyle *fs)
diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c
index 43bf2f59e04..3f5bc21814d 100644
--- a/source/blender/editors/interface/view2d.c
+++ b/source/blender/editors/interface/view2d.c
@@ -168,7 +168,7 @@ static void view2d_masks(View2D *v2d)
void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy)
{
short tot_changed= 0, init= 0;
- uiStyle *style= U.uistyles.first;
+ uiStyle *style= UI_GetStyle();
/* initialise data if there is a need for such */
if ((v2d->flag & V2D_IS_INITIALISED) == 0) {
diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c
index 5cba0b4fdfb..8cdb67a13fd 100644
--- a/source/blender/editors/interface/view2d_ops.c
+++ b/source/blender/editors/interface/view2d_ops.c
@@ -53,6 +53,7 @@
#include "ED_screen.h"
#include "UI_view2d.h"
+#include "UI_interface.h"
#include "PIL_time.h" /* USER_ZOOM_CONT */
@@ -1589,7 +1590,7 @@ static void VIEW2D_OT_scroller_activate(wmOperatorType *ot)
static int reset_exec(bContext *C, wmOperator *UNUSED(op))
{
- uiStyle *style= U.uistyles.first;
+ uiStyle *style= UI_GetStyle();
ARegion *ar= CTX_wm_region(C);
View2D *v2d= &ar->v2d;
int winx, winy;
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index 53d20ddfa20..a9ba86b4861 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -1412,7 +1412,7 @@ int ED_area_header_standardbuttons(const bContext *C, uiBlock *block, int yco)
void ED_region_panels(const bContext *C, ARegion *ar, int vertical, const char *context, int contextnr)
{
ScrArea *sa= CTX_wm_area(C);
- uiStyle *style= U.uistyles.first;
+ uiStyle *style= UI_GetStyle();
uiBlock *block;
PanelType *pt;
Panel *panel;
@@ -1600,7 +1600,7 @@ void ED_region_panels_init(wmWindowManager *wm, ARegion *ar)
void ED_region_header(const bContext *C, ARegion *ar)
{
- uiStyle *style= U.uistyles.first;
+ uiStyle *style= UI_GetStyle();
uiBlock *block;
uiLayout *layout;
HeaderType *ht;
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c
index 899442a8d5a..2f4d6de0f9f 100644
--- a/source/blender/editors/space_file/file_draw.c
+++ b/source/blender/editors/space_file/file_draw.c
@@ -295,7 +295,7 @@ static void file_draw_icon(uiBlock *block, char *path, int sx, int sy, int icon,
static void file_draw_string(int sx, int sy, const char* string, float width, int height, short align)
{
- uiStyle *style= U.uistyles.first;
+ uiStyle *style= UI_GetStyle();
uiFontStyle fs = style->widgetlabel;
rcti rect;
char fname[FILE_MAXFILE];
diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c
index 6773dfb6b2d..e3cf795140e 100644
--- a/source/blender/editors/space_file/filesel.c
+++ b/source/blender/editors/space_file/filesel.c
@@ -403,7 +403,7 @@ float file_shorten_string(char* string, float w, int front)
float file_string_width(const char* str)
{
- uiStyle *style= U.uistyles.first;
+ uiStyle *style= UI_GetStyle();
uiStyleFontSet(&style->widget);
return BLF_width(style->widget.uifont_id, str);
}
@@ -413,12 +413,12 @@ float file_font_pointsize(void)
#if 0
float s;
char tmp[2] = "X";
- uiStyle *style= U.uistyles.first;
+ uiStyle *style= UI_GetStyle();
uiStyleFontSet(&style->widget);
s = BLF_height(style->widget.uifont_id, tmp);
return style->widget.points;
#else
- uiStyle *style= U.uistyles.first;
+ uiStyle *style= UI_GetStyle();
uiStyleFontSet(&style->widget);
return style->widget.points * UI_DPI_FAC;
#endif
diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c
index 019ce2a714a..8323760c725 100644
--- a/source/blender/editors/space_logic/logic_window.c
+++ b/source/blender/editors/space_logic/logic_window.c
@@ -4502,7 +4502,7 @@ static void logic_buttons_new(bContext *C, ARegion *ar)
/* ****************** Controllers ****************** */
xco= 420; yco= 170; width= 300;
- layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, xco, yco, width, 20, U.uistyles.first);
+ layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, xco, yco, width, 20, UI_GetStyle());
row = uiLayoutRow(layout, 1);
uiDefBlockBut(block, controller_menu, NULL, "Controllers", xco-10, yco, 300, UI_UNIT_Y, ""); /* replace this with uiLayout stuff later */
@@ -4605,7 +4605,7 @@ static void logic_buttons_new(bContext *C, ARegion *ar)
/* ****************** Sensors ****************** */
xco= 10; yco= 170; width= 340;
- layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, xco, yco, width, 20, U.uistyles.first);
+ layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, xco, yco, width, 20, UI_GetStyle());
row = uiLayoutRow(layout, 1);
uiDefBlockBut(block, sensor_menu, NULL, "Sensors", xco-10, yco, 300, UI_UNIT_Y, ""); /* replace this with uiLayout stuff later */
@@ -4671,7 +4671,7 @@ static void logic_buttons_new(bContext *C, ARegion *ar)
/* ****************** Actuators ****************** */
xco= 800; yco= 170; width= 340;
- layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, xco, yco, width, 20, U.uistyles.first);
+ layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, xco, yco, width, 20, UI_GetStyle());
row = uiLayoutRow(layout, 1);
uiDefBlockBut(block, actuator_menu, NULL, "Actuators", xco-10, yco, 300, UI_UNIT_Y, ""); /* replace this with uiLayout stuff later */
diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c
index cd1fa5c16a7..fc6281db5bc 100644
--- a/source/blender/editors/space_node/node_draw.c
+++ b/source/blender/editors/space_node/node_draw.c
@@ -288,7 +288,7 @@ static void node_update(const bContext *C, bNodeTree *ntree, bNode *node)
RNA_pointer_create(&ntree->id, &RNA_Node, node, &ptr);
layout= uiBlockLayout(node->block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL,
- node->locx+NODE_DYS, dy, node->butr.xmax, NODE_DY, U.uistyles.first);
+ node->locx+NODE_DYS, dy, node->butr.xmax, NODE_DY, UI_GetStyle());
node->typeinfo->uifunc(layout, (bContext *)C, &ptr);
uiBlockEndAlign(node->block);
@@ -656,7 +656,7 @@ static uiBlock *socket_vector_menu(bContext *C, ARegion *ar, void *args_v)
block= uiBeginBlock(C, ar, "socket menu", UI_EMBOSS);
uiBlockSetFlag(block, UI_BLOCK_KEEP_OPEN);
- layout= uiLayoutColumn(uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, args->x, args->y+2, args->width, NODE_DY, U.uistyles.first), 0);
+ layout= uiLayoutColumn(uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, args->x, args->y+2, args->width, NODE_DY, UI_GetStyle()), 0);
uiItemR(layout, &args->ptr, "default_value", UI_ITEM_R_EXPAND, "", ICON_NONE);
@@ -1114,7 +1114,7 @@ static void node_draw_group(const bContext *C, ARegion *ar, SpaceNode *snode, bN
UI_ThemeColor(TH_TEXT_HI);
layout = uiBlockLayout(gnode->block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, (short)(rect.xmin+15), (short)(rect.ymax+group_header),
- MIN2((int)(rect.xmax - rect.xmin-18.0f), node_group_frame+20), group_header, U.uistyles.first);
+ MIN2((int)(rect.xmax - rect.xmin-18.0f), node_group_frame+20), group_header, UI_GetStyle());
RNA_pointer_create(&ntree->id, &RNA_Node, gnode, &ptr);
uiTemplateIDBrowse(layout, (bContext*)C, &ptr, "node_tree", NULL, NULL, NULL);
uiBlockLayoutResolve(gnode->block, NULL, NULL);
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index ae57cf3f80b..7fd58ffaeec 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -344,6 +344,7 @@ typedef struct UserDef {
struct ListBase keymaps;
struct ListBase addons;
char keyconfigstr[64];
+ char myuistyle[24];
short undosteps;
short undomemory;
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 41838052b47..3067d298567 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -903,7 +903,7 @@ static uiBlock *wm_block_create_redo(bContext *C, ARegion *ar, void *arg_op)
wmOperator *op= arg_op;
uiBlock *block;
uiLayout *layout;
- uiStyle *style= U.uistyles.first;
+ uiStyle *style= UI_GetStyle();
int width= 300;
@@ -981,7 +981,7 @@ static uiBlock *wm_block_dialog_create(bContext *C, ARegion *ar, void *userData)
wmOperator *op= data->op;
uiBlock *block;
uiLayout *layout;
- uiStyle *style= U.uistyles.first;
+ uiStyle *style= UI_GetStyle();
block = uiBeginBlock(C, ar, "operator dialog", UI_EMBOSS);
uiBlockClearFlag(block, UI_BLOCK_LOOP);
@@ -1022,7 +1022,7 @@ static uiBlock *wm_operator_ui_create(bContext *C, ARegion *ar, void *userData)
wmOperator *op= data->op;
uiBlock *block;
uiLayout *layout;
- uiStyle *style= U.uistyles.first;
+ uiStyle *style= UI_GetStyle();
block= uiBeginBlock(C, ar, "opui_popup", UI_EMBOSS);
uiBlockClearFlag(block, UI_BLOCK_LOOP);
@@ -1189,7 +1189,7 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar
uiBlock *block;
uiBut *but;
uiLayout *layout, *split, *col;
- uiStyle *style= U.uistyles.first;
+ uiStyle *style= UI_GetStyle();
struct RecentFile *recent;
int i;
MenuType *mt= WM_menutype_find("USERPREF_MT_splash", TRUE);