feat: UI for dropdown to select which plugin to show past max visible pages

This commit is contained in:
Ian Chua
2026-08-11 17:50:49 +08:00
parent 54fe28ab08
commit 7be7f07551
4 changed files with 87 additions and 132 deletions
+18
View File
@@ -272,6 +272,24 @@ wxString ButtonsListCtrl::GetPageText(size_t n) const
return btn->GetLabel();
}
// ORCA
void ButtonsListCtrl::SetOverflowButton(wxWindow* button)
{
if (m_overflow_button == button)
return;
if (m_overflow_button != nullptr)
m_sizer->Detach(m_overflow_button);
m_overflow_button = button;
if (m_overflow_button != nullptr)
// Right after the tab buttons (index 0), ahead of any stretch spacer / side_tools.
m_sizer->Insert(1, m_overflow_button, 0, wxALIGN_CENTER_VERTICAL | wxLEFT | wxBOTTOM, m_btn_margin);
m_sizer->Layout();
}
//#endif // _WIN32
void Notebook::Init()
+5
View File
@@ -36,6 +36,9 @@ public:
void SetCompact(size_t n, bool compact); // ORCA
wxString GetPageText(size_t n) const;
wxFlexGridSizer* GetBtnsSizer(){return m_buttons_sizer;}; // ORCA
// ORCA: a companion widget shown right after the tab buttons (before any side_tools), e.g.
// an overflow indicator. Pass nullptr to remove it; ownership stays with the caller.
void SetOverflowButton(wxWindow* button);
private:
wxFlexGridSizer* m_buttons_sizer;
@@ -47,6 +50,7 @@ private:
int m_line_margin;
std::vector<wxString> m_pageLabels; // ORCA
wxImageList* m_imageList{nullptr};
wxWindow* m_overflow_button{nullptr}; // ORCA
};
class Notebook : public wxBookCtrlBase
@@ -324,6 +328,7 @@ public:
}
ButtonsListCtrl* GetBtnsListCtrl() const { return static_cast<ButtonsListCtrl*>(m_bookctrl); }
void SetOverflowButton(wxWindow* button) { GetBtnsListCtrl()->SetOverflowButton(button); }
int FindPageByName(const wxString& id) const
{