Linux: Fix Notices display in Dark Mode

Mac: Ensure that the 3 buttons at bottom of Simple View are legible
This commit is contained in:
Charlie Fenton 2023-06-18 05:34:22 -07:00
parent c439b67973
commit 6a0ea0ce88
2 changed files with 33 additions and 6 deletions

View File

@ -102,7 +102,11 @@ bool CNoticeListCtrl::Create( wxWindow* parent ) {
m_itemCount = 0;
if (wxGetApp().GetIsDarkMode()){
#if wxUSE_WEBVIEW
m_noticesBody = wxT("<html><style>body{background-color:black;color:white;}</style><head></head><body></body></html>");
#else
m_noticesBody = wxT("<html><head></head><body bgcolor=black></body></html>");
#endif
} else {
m_noticesBody = wxT("<html><head></head><body></body></html>");
}
@ -153,9 +157,13 @@ void CNoticeListCtrl::SetItemCount(int newCount) {
if (wxGetApp().GetIsDarkMode()){
m_noticesBody = wxT("<html><style>body{background-color:black;color:white;}</style><head></head><body><font face=helvetica>");
#if wxUSE_WEBVIEW
m_noticesBody = wxT("<html><style>body{background-color:black;color:white;}</style><head></head><body><font face=helvetica>");
#else
m_noticesBody = wxT("<html><head></head><body bgcolor=black><font face=helvetica color=white bgcolor=black>");
#endif
} else {
m_noticesBody = wxT("<html><head></head><body><font face=helvetica>");
m_noticesBody = wxT("<html><head></head><body><font face=helvetica>");
}
for (i=0; i<newCount; ++i) {

View File

@ -941,7 +941,6 @@ void CSimpleFrame::OnDarkModeChanged( wxSysColourChangedEvent& WXUNUSED(event) )
panelSizer->Replace(m_pBackgroundPanel->m_taskPanel, newTaskPanel);
m_pBackgroundPanel->m_taskPanel->Destroy();
m_pBackgroundPanel->m_taskPanel = newTaskPanel;
m_pBackgroundPanel->m_taskPanel->ReskinInterface();
CSimpleProjectPanel* newProjectpanel = new CSimpleProjectPanel(m_pBackgroundPanel);
panelSizer->Replace(m_pBackgroundPanel->m_projPanel, newProjectpanel);
@ -950,9 +949,7 @@ void CSimpleFrame::OnDarkModeChanged( wxSysColourChangedEvent& WXUNUSED(event) )
m_pBackgroundPanel->Layout();
// Force a redraw in case a modal dialog is also open
m_pBackgroundPanel->m_taskPanel->UpdatePanel(false);
m_pBackgroundPanel->m_projPanel->UpdateInterface();
m_pBackgroundPanel->ReskinInterface();
// Restore our task and project settings
int iTask = m_pBackgroundPanel->m_taskPanel->GetTaskSelectionCtrl()->FindString(taskStr);
@ -1178,6 +1175,28 @@ void CSimpleGUIPanel::SetBackgroundBitmap() {
wxMemoryDC srcDC(*srcBmp);
dc.Blit(destX, destY, w, h, &srcDC, srcX, srcY, wxCOPY);
#ifdef __WXMAC__
// In Dark Mode, MacOS makes button backgrounds partly tranparent
// rather than black. It uses a slightly darker rendition of the
// underlying bitmap, which can make the button's white text hard
// to read with some skins. So we force these button backgrounds
// to be dark gray.
if (wxGetApp().GetIsDarkMode()) {
wxPen oldPen = dc.GetPen();
dc.SetPen(*wxBLACK);
wxBrush oldBrush = dc.GetBrush();
dc.SetBrush(*wxBLACK_BRUSH);
wxRect r = m_NoticesButton->GetRect();
dc.DrawRoundedRectangle(r, 5);
r = m_SuspendResumeButton->GetRect();
dc.DrawRoundedRectangle(r, 5);
r = m_HelpButton->GetRect();
dc.DrawRoundedRectangle(r, 5);
dc.SetPen(oldPen);
dc.SetBrush(oldBrush);
}
#endif
// dc.DrawBitmap(*pSkinSimple->GetBackgroundImage()->GetBitmap(), 0, 0, false);
wxLogTrace(wxT("Function Start/End"), wxT("CSimpleGUIPanel::SetBackgroundBitmap - Function End"));