From 1ec92e0d9e54c521b4e027035e4bbd38f7708eab Mon Sep 17 00:00:00 2001 From: "Charles J. Cliffe" Date: Tue, 27 Dec 2016 14:46:50 -0500 Subject: [PATCH] Update theme needs repaint; limit wxColour conversion --- src/forms/Bookmark/BookmarkView.cpp | 5 ++++- src/visual/ColorTheme.h | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/forms/Bookmark/BookmarkView.cpp b/src/forms/Bookmark/BookmarkView.cpp index d6f13862..06f902fc 100644 --- a/src/forms/Bookmark/BookmarkView.cpp +++ b/src/forms/Bookmark/BookmarkView.cpp @@ -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(); } diff --git a/src/visual/ColorTheme.h b/src/visual/ColorTheme.h index b4289d4d..3e61d5bf 100644 --- a/src/visual/ColorTheme.h +++ b/src/visual/ColorTheme.h @@ -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)); }