Skip to content

Commit 1ec92e0

Browse files
committed
Update theme needs repaint; limit wxColour conversion
1 parent 83cb265 commit 1ec92e0

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/forms/Bookmark/BookmarkView.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,8 @@ void BookmarkView::updateTheme() {
153153
m_treeView->SetForegroundColour(textColor);
154154

155155
m_propPanel->SetBackgroundColour(bgColor);
156+
m_buttonPanel->SetBackgroundColour(bgColor);
157+
156158
m_propPanel->SetForegroundColour(textColor);
157159

158160
m_labelLabel->SetForegroundColour(textColor);
@@ -163,7 +165,7 @@ void BookmarkView::updateTheme() {
163165
m_modulationVal->SetForegroundColour(textColor);
164166
m_modulationLabel->SetForegroundColour(textColor);
165167

166-
m_buttonPanel->SetBackgroundColour(bgColor);
168+
refreshLayout();
167169
}
168170

169171

@@ -653,6 +655,7 @@ void BookmarkView::showButtons() {
653655
void BookmarkView::refreshLayout() {
654656
GetSizer()->Layout();
655657
Update();
658+
Refresh();
656659
}
657660

658661

src/visual/ColorTheme.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ class RGBA4f {
4242

4343
operator wxColour() {
4444
return wxColour(
45-
(unsigned char) (r * 255.0),
46-
(unsigned char) (g * 255.0),
47-
(unsigned char) (b * 255.0));
45+
(unsigned char) std::min((r * 255.0), 255.0),
46+
(unsigned char) std::min((g * 255.0), 255.0),
47+
(unsigned char) std::min((b * 255.0), 255.0));
4848

4949
}
5050

0 commit comments

Comments
 (0)