Changeset 486c619 in git


Ignore:
Timestamp:
21/01/14 02:16:12 (6 years ago)
Author:
Olly Betts <olly@…>
Branches:
line_contents, master, stereo, travis-osx
Children:
08e858b
Parents:
fb941bfd
Message:

src/mainfrm.cc,src/mainfrm.h: If full screen, don't recreate the
side panel when a new file is opened (e.g. via Ctrl+O).

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    rfb941bfd r486c619  
     1Tue Jan 21 02:15:38 GMT 2014  Olly Betts <olly@survex.com>
     2
     3        * src/mainfrm.cc,src/mainfrm.h: If full screen, don't recreate the
     4          side panel when a new file is opened (e.g. via Ctrl+O).
     5
    16Mon Jan 20 05:33:04 GMT 2014  Olly Betts <olly@survex.com>
    27
  • src/mainfrm.cc

    rfb941bfd r486c619  
    688688MainFrm::MainFrm(const wxString& title, const wxPoint& pos, const wxSize& size) :
    689689    wxFrame(NULL, 101, title, pos, size, wxDEFAULT_FRAME_STYLE),
     690    m_SashPosition(-1),
    690691    m_Gfx(NULL), m_NumEntrances(0), m_NumFixedPts(0), m_NumExportedPts(0),
    691692    m_NumHighlighted(0),
     
    17071708void MainFrm::InitialiseAfterLoad(const wxString & file)
    17081709{
    1709     int x;
    1710     int y;
    1711     GetClientSize(&x, &y);
    1712     if (x < 600)
    1713         x /= 3;
    1714     else if (x < 1000)
    1715         x = 200;
    1716     else
    1717         x /= 5;
     1710    if (m_SashPosition < 0) {
     1711        // Calculate sane default width for side panel.
     1712        int x;
     1713        int y;
     1714        GetClientSize(&x, &y);
     1715        if (x < 600)
     1716            x /= 3;
     1717        else if (x < 1000)
     1718            x = 200;
     1719        else
     1720            x /= 5;
     1721        m_SashPosition = x;
     1722    }
    17181723
    17191724    // Do this before we potentially delete the log window which may own the
     
    17481753    }
    17491754
    1750     m_Splitter->SplitVertically(m_Notebook, m_Gfx, x);
    1751     m_SashPosition = x; // Save width of panel.
     1755    if (!IsFullScreen()) {
     1756        m_Splitter->SplitVertically(m_Notebook, m_Gfx, m_SashPosition);
     1757    } else {
     1758        was_showing_sidepanel_before_fullscreen = true;
     1759    }
    17521760
    17531761    m_Gfx->Initialise(same_file);
    1754     m_Notebook->Show(true);
     1762    if (!IsFullScreen()) {
     1763        m_Notebook->Show(true);
     1764    }
    17551765
    17561766    m_Gfx->Show(true);
     
    25582568void MainFrm::ViewFullScreen() {
    25592569    ShowFullScreen(!IsFullScreen());
    2560     static bool sidepanel;
    2561     if (IsFullScreen()) sidepanel = ShowingSidePanel();
    2562     if (sidepanel) ToggleSidePanel();
    2563 }
     2570    if (IsFullScreen())
     2571        was_showing_sidepanel_before_fullscreen = ShowingSidePanel();
     2572    if (was_showing_sidepanel_before_fullscreen)
     2573        ToggleSidePanel();
     2574}
  • src/mainfrm.h

    rfb941bfd r486c619  
    217217    wxFileHistory m_history;
    218218    int m_SashPosition;
     219    bool was_showing_sidepanel_before_fullscreen;
    219220    list<traverse> traverses;
    220221    list<traverse> surface_traverses;
Note: See TracChangeset for help on using the changeset viewer.