From 52ecc0c5dafd4f23366ff00266eca7387b92a751 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 3 Dec 2024 23:52:37 +0100 Subject: [PATCH] Simplify computing the new tab control size in Split() Don't handle the case of having 1 or 2 pages specially, there doesn't seem to be any good reason to do it, especially because splitting the notebook programmatically by dragging the pages around doesn't do it. --- src/aui/auibook.cpp | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/src/aui/auibook.cpp b/src/aui/auibook.cpp index dc08b32f92..1f348777f8 100644 --- a/src/aui/auibook.cpp +++ b/src/aui/auibook.cpp @@ -2406,24 +2406,8 @@ void wxAuiNotebook::Split(size_t page, int direction) if (!src_tabs || src_idx == -1) return; - // choose a split size - wxSize split_size; - if (GetPageCount() > 2) - { - split_size = CalculateNewSplitSize(); - } - else - { - // because there are two panes, always split them - // equally - split_size = GetClientSize(); - split_size.x /= 2; - split_size.y /= 2; - } - - // create a new tab frame - wxAuiTabFrame* new_tabs = CreateTabFrame(split_size); + wxAuiTabFrame* new_tabs = CreateTabFrame(CalculateNewSplitSize()); dest_tabs = new_tabs->m_tabs; // create a pane info structure with the information