Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add preferences for flag colors #217

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/XGridCtrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ void XGridCtrl::Init()
grid.backgroundColor.AddCallback(this, &XGridCtrl::SetBackgroundColour);
grid.whiteSquareColor.AddCallback(this, &XGridCtrl::SetWhiteSquareColor);
grid.blackSquareColor.AddCallback(this, &XGridCtrl::SetBlackSquareColor);
grid.correctFlagColor.AddCallback(this, &XGridCtrl::SetCorrectColor);
grid.checkedFlagColor.AddCallback(this, &XGridCtrl::SetCheckedColor);
grid.revealedFlagColor.AddCallback(this, &XGridCtrl::SetRevealedColor);
grid.highlightTheme.AddCallback(this, &XGridCtrl::ShowThemeHighlight);
grid.themeSquareColor.AddCallback(this, &XGridCtrl::SetThemeSquareColor);
grid.selectionColor.AddCallback(this, &XGridCtrl::SetSelectionColor);
Expand Down
12 changes: 12 additions & 0 deletions src/XGridCtrl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,12 @@ class XGridCtrl
{ m_drawer.SetWhiteSquareColor(color); if (! IsEmpty()) Refresh(); }
void SetBlackSquareColor(const wxColor & color)
{ m_drawer.SetBlackSquareColor(color); if (! IsEmpty()) Refresh(); }
void SetCorrectColor(const wxColor & color)
{ m_drawer.SetCorrectColor(color); if (! IsEmpty()) Refresh(); }
void SetCheckedColor(const wxColor & color)
{ m_drawer.SetCheckedColor(color); if (! IsEmpty()) Refresh(); }
void SetRevealedColor(const wxColor & color)
{ m_drawer.SetRevealedColor(color); if (! IsEmpty()) Refresh(); }
void ShowThemeHighlight(bool doit = true)
{ m_drawer.ShowThemeHighlight(doit); if (! IsEmpty()) Refresh(); }
void SetThemeSquareColor(const wxColor & color)
Expand All @@ -268,6 +274,12 @@ class XGridCtrl
{ return m_drawer.GetWhiteSquareColor(); }
const wxColor & GetBlackSquareColor() const
{ return m_drawer.GetBlackSquareColor(); }
const wxColor & GetCorrectColor() const
{ return m_drawer.GetCorrectColor(); }
const wxColor & GetCheckedColor() const
{ return m_drawer.GetCheckedColor(); }
const wxColor & GetRevealedColor() const
{ return m_drawer.GetRevealedColor(); }
const wxColor & GetThemeSquareColor() const
{ return m_drawer.GetThemeColor(); }
const wxColor & GetPenColor() const
Expand Down
3 changes: 3 additions & 0 deletions src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ ConfigManager::Grid_t::Grid_t(ConfigManager * cfg)
focusedWordColor(this, _T("focusedWordColor"), &cfg->Appearance.gridHighlightColor, &GetWordHighlight),
whiteSquareColor(this, _T("whiteSquareColor"), *wxWHITE),
blackSquareColor(this, _T("blackSquareColor"), *wxBLACK),
correctFlagColor(this, _T("correctFlagColor"), wxColour(64, 193, 23)),
checkedFlagColor(this, _T("checkedFlagColor"), *wxBLACK),
revealedFlagColor(this, _T("revealedFlagColor"), wxColour(246, 36, 0)),
highlightTheme(this, _T("highlightTheme"), false),
themeSquareColor(this, _T("themeSquareColor"), &cfg->Appearance.gridHighlightColor, &GetThemeColor),
selectionColor(this, _T("selectionColor"), &cfg->Appearance.listHighlightColor),
Expand Down
3 changes: 3 additions & 0 deletions src/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ class ConfigManager : public ConfigManagerBase
ConfigColor focusedWordColor;
ConfigColor whiteSquareColor;
ConfigColor blackSquareColor;
ConfigColor correctFlagColor;
ConfigColor checkedFlagColor;
ConfigColor revealedFlagColor;
ConfigBool highlightTheme;
ConfigColor themeSquareColor;
ConfigColor selectionColor;
Expand Down
3 changes: 3 additions & 0 deletions src/dialogs/TreePanels.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,9 @@ class GridBaseAppearance : public AppearancePanelBase
Add(grid.numberFont, "Number", FontDesc(FP_DEFAULT & ~FP_POINTSIZE));
Add(grid.penColor, "Text");
Add(grid.backgroundColor, "Background");
Add(grid.correctFlagColor, "Correct dot");
Add(grid.checkedFlagColor, "Incorrect triangle");
Add(grid.revealedFlagColor, "Revealed triangle");
}
};

Expand Down