Skip to content

Commit

Permalink
gui: fix breaking changes with themeing
Browse files Browse the repository at this point in the history
  • Loading branch information
turanszkij committed Feb 24, 2025
1 parent 770d05c commit a523be9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
10 changes: 8 additions & 2 deletions WickedEngine/wiGUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -681,11 +681,17 @@ namespace wi::gui
theme.image.Apply(sprites[id].params);
}
theme.font.Apply(font.params);
SetShadowRadius(theme.shadow);
if (theme.shadow >= 0)
{
SetShadowRadius(theme.shadow);
}
SetShadowColor(theme.shadow_color);
theme.tooltipFont.Apply(tooltipFont.params);
theme.tooltipImage.Apply(tooltipSprite.params);
tooltip_shadow = theme.tooltip_shadow;
if (theme.tooltip_shadow >= 0)
{
tooltip_shadow = theme.tooltip_shadow;
}
tooltip_shadow_color = theme.tooltip_shadow_color;
shadow_highlight = theme.shadow_highlight;
shadow_highlight_color = theme.shadow_highlight_color;
Expand Down
4 changes: 2 additions & 2 deletions WickedEngine/wiGUI.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,15 +210,15 @@ namespace wi::gui
}
} font;

float shadow = 1; // shadow radius
float shadow = -1; // shadow radius, if less than 0, it won't be used to override
wi::Color shadow_color = wi::Color::Shadow(); // shadow color for whole widget
bool shadow_highlight = false;
XMFLOAT3 shadow_highlight_color = XMFLOAT3(1, 1, 1);
float shadow_highlight_spread = 1;

Image tooltipImage;
Font tooltipFont;
float tooltip_shadow = 1; // shadow radius
float tooltip_shadow = -1; // shadow radius, if less than 0, it won't be used to override
wi::Color tooltip_shadow_color = wi::Color::Shadow();
};

Expand Down
2 changes: 1 addition & 1 deletion WickedEngine/wiVersion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace wi::version
// minor features, major updates, breaking compatibility changes
const int minor = 71;
// minor bug fixes, alterations, refactors, updates
const int revision = 690;
const int revision = 691;

const std::string version_string = std::to_string(major) + "." + std::to_string(minor) + "." + std::to_string(revision);

Expand Down

0 comments on commit a523be9

Please sign in to comment.