Skip to content

Commit

Permalink
Update theme needs repaint; limit wxColour conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
cjcliffe committed Dec 27, 2016
1 parent 83cb265 commit 1ec92e0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/forms/Bookmark/BookmarkView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -163,7 +165,7 @@ void BookmarkView::updateTheme() {
m_modulationVal->SetForegroundColour(textColor);
m_modulationLabel->SetForegroundColour(textColor);

m_buttonPanel->SetBackgroundColour(bgColor);
refreshLayout();
}


Expand Down Expand Up @@ -653,6 +655,7 @@ void BookmarkView::showButtons() {
void BookmarkView::refreshLayout() {
GetSizer()->Layout();
Update();
Refresh();
}


Expand Down
6 changes: 3 additions & 3 deletions src/visual/ColorTheme.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ class RGBA4f {

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));

}

Expand Down

0 comments on commit 1ec92e0

Please sign in to comment.