Load actual factory default, not saved style, when requested.
This commit is contained in:
parent
c838158e04
commit
917a7b93ce
|
@ -827,7 +827,7 @@ public:
|
|||
|
||||
static void CreateAllDefaultStyles(void);
|
||||
static void CreateDefaultStyle(hStyle h);
|
||||
static void FillDefaultStyle(Style *s, const Default *d = NULL);
|
||||
static void FillDefaultStyle(Style *s, const Default *d = NULL, bool factory = false);
|
||||
static void FreezeDefaultStyles(void);
|
||||
static void LoadFactoryDefaults(void);
|
||||
|
||||
|
|
|
@ -83,12 +83,13 @@ void Style::CreateDefaultStyle(hStyle h) {
|
|||
SK.style.Add(&ns);
|
||||
}
|
||||
|
||||
void Style::FillDefaultStyle(Style *s, const Default *d) {
|
||||
void Style::FillDefaultStyle(Style *s, const Default *d, bool factory) {
|
||||
if(d == NULL) d = &Defaults[0];
|
||||
s->color = CnfThawColor(d->color, CnfColor(d->cnfPrefix));
|
||||
s->width = CnfThawFloat((float)(d->width), CnfWidth(d->cnfPrefix));
|
||||
s->color = (factory) ? d->color : CnfThawColor(d->color, CnfColor(d->cnfPrefix));
|
||||
s->width = (factory) ? d->width : CnfThawFloat((float)(d->width), CnfWidth(d->cnfPrefix));
|
||||
s->widthAs = UNITS_AS_PIXELS;
|
||||
s->textHeight = CnfThawFloat(DEFAULT_TEXT_HEIGHT, CnfTextHeight(d->cnfPrefix));
|
||||
s->textHeight = (factory) ? DEFAULT_TEXT_HEIGHT
|
||||
: CnfThawFloat(DEFAULT_TEXT_HEIGHT, CnfTextHeight(d->cnfPrefix));
|
||||
s->textHeightAs = UNITS_AS_PIXELS;
|
||||
s->textOrigin = 0;
|
||||
s->textAngle = 0;
|
||||
|
@ -106,7 +107,7 @@ void Style::LoadFactoryDefaults(void) {
|
|||
const Default *d;
|
||||
for(d = &(Defaults[0]); d->h.v; d++) {
|
||||
Style *s = Get(d->h);
|
||||
FillDefaultStyle(s, d);
|
||||
FillDefaultStyle(s, d, /*factory=*/true);
|
||||
}
|
||||
SS.backgroundColor = RGBi(0, 0, 0);
|
||||
if(SS.bgImage.fromFile) MemFree(SS.bgImage.fromFile);
|
||||
|
|
Loading…
Reference in New Issue
Block a user