21 art->SetNormalFont(m_normalFont);
22 art->SetSelectedFont(m_selectedFont);
23 art->SetMeasuringFont(m_measuringFont);
50 const wxSize &requiredBmpSize) {
52 int baseSize = wxAuiFlatTabArt::GetBestTabCtrlSize(wnd, pages, requiredBmpSize);
55 const int MIN_TAB_HEIGHT = 42;
57 return std::max(baseSize, MIN_TAB_HEIGHT);
67 m_plusNormal = wxBitmap(plusIconPath +
"Plus_Normal_20.png", wxBITMAP_TYPE_PNG);
68 m_plusHovered = wxBitmap(plusIconPath +
"Plus_Hovered_20.png", wxBITMAP_TYPE_PNG);
69 m_plusPressed = wxBitmap(plusIconPath +
"Plus_Pressed_20.png", wxBITMAP_TYPE_PNG);
73 m_menuNormal = wxBitmap(menuIconPath +
"Menu_Normal_20.png", wxBITMAP_TYPE_PNG);
74 m_menuHovered = wxBitmap(menuIconPath +
"Menu_Hovered_20.png", wxBITMAP_TYPE_PNG);
75 m_menuPressed = wxBitmap(menuIconPath +
"Menu_Pressed_20.png", wxBITMAP_TYPE_PNG);
83 bool isNonClosable = page.window && page.window->GetName() ==
"BlackboardScene";
85 std::vector<wxAuiTabContainerButton> savedButtons;
87 savedButtons = std::move(page.buttons);
91 int result = wxAuiFlatTabArt::DrawPageTab(dc, wnd, page, rect);
94 page.buttons = std::move(savedButtons);
97 const int THICKNESS = wnd->FromDIP(2);
98 const int y = m_flags & wxAUI_NB_BOTTOM ? page.rect.GetBottom() - THICKNESS : page.rect.GetTop();
101 wxColour bbColor(150, 100, 200);
102 dc.SetBrush(wxBrush(bbColor));
103 dc.SetPen(*wxTRANSPARENT_PEN);
104 dc.DrawRectangle(page.rect.GetLeft() + 1, y, page.rect.GetWidth() - 1, THICKNESS);
105 }
else if (page.active) {
107 dc.SetPen(*wxTRANSPARENT_PEN);
108 dc.DrawRectangle(page.rect.GetLeft() + 1, y, page.rect.GetWidth() - 1, THICKNESS);
128 int tabHeight = rect.GetHeight();
129 int buttonY = rect.GetTop() + (tabHeight -
BUTTON_SIZE) / 2;
160 if (plusBmp.IsOk()) {
163 if (menuBmp.IsOk()) {
Centralized resource path management for EmberForge.
static wxColour GetAccentColor()
Get the accent color as a wxColour for UI elements.
void DrawTabBarButtons(wxDC &dc, wxWindow *wnd, const wxRect &rect)
Draw the tab bar buttons (+ and menu) at the right side of the tab area.
int GetBestTabCtrlSize(wxWindow *wnd, const wxAuiNotebookPageArray &pages, const wxSize &requiredBmpSize) override
Override to get a taller tab bar.
void LoadButtonIcons()
Load button icons from resources Must be called after construction when a window context is available...
TabBarButton m_pressedButton
TabBarButton m_hoveredButton
static const int BUTTON_MARGIN
int GetButtonAreaWidth() const
Get the width reserved for buttons on the right side of the tab bar.
static const int BUTTON_SPACING
void SetHoveredButton(TabBarButton button)
Set the hovered button state (for visual feedback)
TabBarButton ButtonHitTest(int x, int y) const
Test if a point hits one of the tab bar buttons.
void UpdateAccentColor()
Update the highlight color to match the current accent color preference.
int GetIndentSize() override
Override to increase tab bar height for larger buttons.
static const int BUTTON_SIZE
int DrawPageTab(wxDC &dc, wxWindow *wnd, wxAuiNotebookPage &page, const wxRect &rect) override
wxAuiTabArt * Clone() override
void SetPressedButton(TabBarButton button)
Set the pressed button state (for visual feedback)
static wxString GetDir(const wxString &relativeDir)
Get the full path to a resource directory.
wxDEFINE_EVENT(EVT_TAB_ART_ADD_BUTTON, wxCommandEvent)