Ticket #7247: update-statusbar-when-theme-changes.patch

File update-statusbar-when-theme-changes.patch, 2.0 KB (added by Bruno Ramos, 10 years ago)

[Patch] update status bar when theme changes

  • src/interface/Mainfrm.cpp

     
    304304    // so that contextchange events can be processed in the right order.
    305305    m_pContextControl = new CContextControl(this);
    306306
    307     m_pStatusBar = new CStatusBar(this);
    308     if (m_pStatusBar)
    309     {
    310         m_pActivityLed[0] = new CLed(m_pStatusBar, 0);
    311         m_pActivityLed[1] = new CLed(m_pStatusBar, 1);
     307    CreateStatusBar();
    312308
    313         m_pStatusBar->AddField(-1, widget_led_recv, m_pActivityLed[1]);
    314         m_pStatusBar->AddField(-1, widget_led_send, m_pActivityLed[0]);
    315 
    316         SetStatusBar(m_pStatusBar);
    317     }
    318 
    319309    m_closeEventTimer.SetOwner(this);
    320310
    321311    if (CFilterManager::HasActiveFilters(true))
     
    531521#endif
    532522}
    533523
     524bool CMainFrame::CreateStatusBar() {
     525   
     526    wxGetApp().AddStartupProfileRecord(_T("CMainFrame::CreateMenus"));
     527    if (m_pStatusBar)
     528    {
     529        SetStatusBar(0);
     530        delete m_pStatusBar;
     531        m_pStatusBar = 0;
     532    }
     533
     534    m_pStatusBar = new CStatusBar(this);
     535    if (m_pStatusBar)
     536    {
     537        m_pActivityLed[0] = new CLed(m_pStatusBar, 0);
     538        m_pActivityLed[1] = new CLed(m_pStatusBar, 1);
     539
     540        m_pStatusBar->AddField(-1, widget_led_recv, m_pActivityLed[1]);
     541        m_pStatusBar->AddField(-1, widget_led_send, m_pActivityLed[0]);
     542
     543        SetStatusBar(m_pStatusBar);
     544    }
     545
     546    return true;
     547}
     548
    534549bool CMainFrame::CreateMenus()
    535550{
    536551    wxGetApp().AddStartupProfileRecord(_T("CMainFrame::CreateMenus"));
     
    15741589        CreateMainToolBar();
    15751590        if (m_pToolBar)
    15761591            m_pToolBar->UpdateToolbarState();
     1592        CreateStatusBar();
    15771593    }
    15781594
    15791595    if (oldLang != newLang ||
  • src/interface/Mainfrm.h

     
    7474    void FixTabOrder();
    7575
    7676    bool CloseDialogsAndQuit(wxCloseEvent &event);
     77    bool CreateStatusBar();
    7778    bool CreateMenus();
    7879    bool CreateQuickconnectBar();
    7980    bool CreateMainToolBar();