Update theme needs repaint; limit wxColour conversion

This commit is contained in:
Charles J. Cliffe 2016-12-27 14:46:50 -05:00
parent 83cb2659ff
commit 1ec92e0d9e
2 changed files with 7 additions and 4 deletions

View File

@ -153,6 +153,8 @@ void BookmarkView::updateTheme() {
m_treeView->SetForegroundColour(textColor);
m_propPanel->SetBackgroundColour(bgColor);
m_buttonPanel->SetBackgroundColour(bgColor);
m_propPanel->SetForegroundColour(textColor);
m_labelLabel->SetForegroundColour(textColor);
@ -163,7 +165,7 @@ void BookmarkView::updateTheme() {
m_modulationVal->SetForegroundColour(textColor);
m_modulationLabel->SetForegroundColour(textColor);
m_buttonPanel->SetBackgroundColour(bgColor);
refreshLayout();
}
@ -653,6 +655,7 @@ void BookmarkView::showButtons() {
void BookmarkView::refreshLayout() {
GetSizer()->Layout();
Update();
Refresh();
}

View File

@ -42,9 +42,9 @@ public:
operator wxColour() {
return wxColour(
(unsigned char) (r * 255.0),
(unsigned char) (g * 255.0),
(unsigned char) (b * 255.0));
(unsigned char) std::min((r * 255.0), 255.0),
(unsigned char) std::min((g * 255.0), 255.0),
(unsigned char) std::min((b * 255.0), 255.0));
}