mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-27 10:51:22 +00:00
feat: UI for dropdown to select which plugin to show past max visible pages
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user