diff --git a/src/AppFrame.cpp b/src/AppFrame.cpp index 25ef1c8..bdc116d 100644 --- a/src/AppFrame.cpp +++ b/src/AppFrame.cpp @@ -594,6 +594,7 @@ AppFrame::AppFrame() : waterfallCanvas->setLinesPerSecond(wflps); ThemeMgr::mgr.setTheme(wxGetApp().getConfig()->getTheme()); + bookmarkView->updateTheme(); int mpc =wxGetApp().getConfig()->getModemPropsCollapsed(); @@ -1035,6 +1036,7 @@ void AppFrame::OnMenu(wxCommandEvent& event) { spectrumAvgMeter->Refresh(); gainCanvas->setThemeColors(); modemProps->updateTheme(); + bookmarkView->updateTheme(); } switch (event.GetId()) { diff --git a/src/ModemProperties.cpp b/src/ModemProperties.cpp index be3e6ba..a52ca64 100644 --- a/src/ModemProperties.cpp +++ b/src/ModemProperties.cpp @@ -30,26 +30,10 @@ void ModemProperties::OnShow(wxShowEvent & /* event */) { } void ModemProperties::updateTheme() { - wxColour bgColor( - (unsigned char) (ThemeMgr::mgr.currentTheme->generalBackground.r * 255.0), - (unsigned char) (ThemeMgr::mgr.currentTheme->generalBackground.g * 255.0), - (unsigned char) (ThemeMgr::mgr.currentTheme->generalBackground.b * 255.0)); - - wxColour textColor( - (unsigned char) (ThemeMgr::mgr.currentTheme->text.r * 255.0), - (unsigned char) (ThemeMgr::mgr.currentTheme->text.g * 255.0), - (unsigned char) (ThemeMgr::mgr.currentTheme->text.b * 255.0)); - - wxColour btn( - (unsigned char) (ThemeMgr::mgr.currentTheme->button.r * 255.0), - (unsigned char) (ThemeMgr::mgr.currentTheme->button.g * 255.0), - (unsigned char) (ThemeMgr::mgr.currentTheme->button.b * 255.0)); - - wxColour btnHl( - (unsigned char) (ThemeMgr::mgr.currentTheme->buttonHighlight.r * 255.0), - (unsigned char) (ThemeMgr::mgr.currentTheme->buttonHighlight.g * 255.0), - (unsigned char) (ThemeMgr::mgr.currentTheme->buttonHighlight.b * 255.0)); - + wxColour bgColor(ThemeMgr::mgr.currentTheme->generalBackground); + wxColour textColor(ThemeMgr::mgr.currentTheme->text); + wxColour btn(ThemeMgr::mgr.currentTheme->button); + wxColour btnHl(ThemeMgr::mgr.currentTheme->buttonHighlight); m_propertyGrid->SetEmptySpaceColour(bgColor); m_propertyGrid->SetCellBackgroundColour(bgColor); diff --git a/src/demod/DemodulatorInstance.cpp b/src/demod/DemodulatorInstance.cpp index ffe8065..f8955fe 100644 --- a/src/demod/DemodulatorInstance.cpp +++ b/src/demod/DemodulatorInstance.cpp @@ -337,7 +337,9 @@ void DemodulatorInstance::setDemodulatorType(std::string demod_type_in) { outp->setTitle(getDemodulatorType() + ": " + frequencyToStr(getFrequency())); } #endif -} + } + + wxGetApp().getBookmarkMgr().updateActiveList(); } std::string DemodulatorInstance::getDemodulatorType() { diff --git a/src/forms/Bookmark/BookmarkPanel.cpp b/src/forms/Bookmark/BookmarkPanel.cpp index 4090714..6d54fef 100644 --- a/src/forms/Bookmark/BookmarkPanel.cpp +++ b/src/forms/Bookmark/BookmarkPanel.cpp @@ -62,13 +62,13 @@ BookmarkPanel::BookmarkPanel( wxWindow* parent, wxWindowID id, const wxPoint& po bSizer1->Add( m_propPanel, 1, wxBOTTOM|wxEXPAND|wxTOP, 5 ); m_bookmarkButton = new wxButton( this, wxID_ANY, wxT("Bookmark"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer1->Add( m_bookmarkButton, 0, wxALL|wxEXPAND, 5 ); + bSizer1->Add( m_bookmarkButton, 0, wxEXPAND, 5 ); m_activateButton = new wxButton( this, wxID_ANY, wxT("Activate"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer1->Add( m_activateButton, 0, wxALL|wxEXPAND, 5 ); + bSizer1->Add( m_activateButton, 0, wxEXPAND, 5 ); m_removeButton = new wxButton( this, wxID_ANY, wxT("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer1->Add( m_removeButton, 0, wxALL|wxEXPAND, 5 ); + bSizer1->Add( m_removeButton, 0, wxEXPAND, 5 ); this->SetSizer( bSizer1 ); diff --git a/src/forms/Bookmark/BookmarkPanel.fbp b/src/forms/Bookmark/BookmarkPanel.fbp index 10f3f80..f79f744 100644 --- a/src/forms/Bookmark/BookmarkPanel.fbp +++ b/src/forms/Bookmark/BookmarkPanel.fbp @@ -952,7 +952,7 @@ 5 - wxALL|wxEXPAND + wxEXPAND 0 1 @@ -1040,7 +1040,7 @@ 5 - wxALL|wxEXPAND + wxEXPAND 0 1 @@ -1128,7 +1128,7 @@ 5 - wxALL|wxEXPAND + wxEXPAND 0 1 diff --git a/src/forms/Bookmark/BookmarkView.cpp b/src/forms/Bookmark/BookmarkView.cpp index ed98ccb..5b4fcc2 100644 --- a/src/forms/Bookmark/BookmarkView.cpp +++ b/src/forms/Bookmark/BookmarkView.cpp @@ -20,6 +20,32 @@ void BookmarkView::onUpdateTimer( wxTimerEvent& event ) { } } +void BookmarkView::updateTheme() { + wxColour bgColor(ThemeMgr::mgr.currentTheme->generalBackground); + wxColour textColor(ThemeMgr::mgr.currentTheme->text); + wxColour btn(ThemeMgr::mgr.currentTheme->button); + wxColour btnHl(ThemeMgr::mgr.currentTheme->buttonHighlight); + + m_treeView->SetBackgroundColour(bgColor); + m_treeView->SetForegroundColour(textColor); + + m_propPanel->SetBackgroundColour(bgColor); + m_propPanel->SetForegroundColour(textColor); + + m_labelLabel->SetForegroundColour(textColor); + m_frequencyVal->SetForegroundColour(textColor); + m_frequencyLabel->SetForegroundColour(textColor); + m_bandwidthVal->SetForegroundColour(textColor); + m_bandwidthLabel->SetForegroundColour(textColor); + m_modulationVal->SetForegroundColour(textColor); + m_modulationLabel->SetForegroundColour(textColor); + + m_bookmarkButton->SetBackgroundColour(bgColor); + m_removeButton->SetBackgroundColour(bgColor); + m_activateButton->SetBackgroundColour(bgColor); +} + + void BookmarkView::updateActiveList() { doUpdateActive = true; } @@ -53,7 +79,6 @@ void BookmarkView::doUpdateActiveList() { m_treeView->Enable(); m_treeView->ExpandAll(); - } void BookmarkView::onTreeBeginLabelEdit( wxTreeEvent& event ) { diff --git a/src/forms/Bookmark/BookmarkView.h b/src/forms/Bookmark/BookmarkView.h index 0519fde..567c46c 100644 --- a/src/forms/Bookmark/BookmarkView.h +++ b/src/forms/Bookmark/BookmarkView.h @@ -10,6 +10,7 @@ public: void updateActiveList(); void activeSelection(DemodulatorInstance *dsel); + void updateTheme(); protected: diff --git a/src/visual/ColorTheme.h b/src/visual/ColorTheme.h index 6f35324..b4289d4 100644 --- a/src/visual/ColorTheme.h +++ b/src/visual/ColorTheme.h @@ -5,6 +5,7 @@ #include #include #include +#include #define COLOR_THEME_DEFAULT 0 #define COLOR_THEME_BW 1 @@ -38,6 +39,14 @@ public: } RGBA4f operator*(float v) { return RGBA4f(r*v, g*v, b*v); } + + operator wxColour() { + return wxColour( + (unsigned char) (r * 255.0), + (unsigned char) (g * 255.0), + (unsigned char) (b * 255.0)); + + } };