Store and use passed in theme reference
- Issue MatterHackers/MCCentral#4773 Incorrect text color on theme panel
This commit is contained in:
parent
6676702d7a
commit
fbd1368e90
1 changed files with 7 additions and 6 deletions
|
|
@ -46,14 +46,16 @@ namespace MatterHackers.MatterControl.ConfigurationPage
|
|||
{
|
||||
private Color lastColor;
|
||||
private AccentColorsWidget colorSelector;
|
||||
|
||||
private ThemeConfig theme;
|
||||
private IColorTheme _themeProvider;
|
||||
private GuiWidget previewButtonPanel;
|
||||
|
||||
public ThemeColorPanel(ThemeConfig activeTheme, AccentColorsWidget colorSelector)
|
||||
public ThemeColorPanel(ThemeConfig theme, AccentColorsWidget colorSelector)
|
||||
: base (FlowDirection.TopToBottom)
|
||||
{
|
||||
this.colorSelector = colorSelector;
|
||||
this.theme = theme;
|
||||
|
||||
string currentProviderName = UserSettings.Instance.get(UserSettingsKey.ThemeName) ?? "";
|
||||
|
||||
if (AppContext.ThemeProviders.TryGetValue(currentProviderName, out IColorTheme currentProvider))
|
||||
|
|
@ -65,9 +67,9 @@ namespace MatterHackers.MatterControl.ConfigurationPage
|
|||
_themeProvider = AppContext.ThemeProviders.Values.First();
|
||||
}
|
||||
|
||||
accentPanelColor = activeTheme.ResolveColor(activeTheme.SectionBackgroundColor, activeTheme.SlightShade);
|
||||
accentPanelColor = theme.ResolveColor(theme.SectionBackgroundColor, theme.SlightShade);
|
||||
|
||||
this.SelectionColor = activeTheme.MinimalShade;
|
||||
this.SelectionColor = theme.MinimalShade;
|
||||
|
||||
this.AddChild(previewButtonPanel = new FlowLayoutWidget()
|
||||
{
|
||||
|
|
@ -97,12 +99,11 @@ namespace MatterHackers.MatterControl.ConfigurationPage
|
|||
this.CreateThemeModeButtons();
|
||||
}
|
||||
}
|
||||
|
||||
private void CreateThemeModeButtons()
|
||||
{
|
||||
previewButtonPanel.CloseAllChildren();
|
||||
|
||||
var theme = AppContext.Theme;
|
||||
|
||||
var accentColor = theme.PrimaryAccentColor;
|
||||
|
||||
int providerIndex = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue