Ember
Loading...
Searching...
No Matches
EmberForge::CustomTabArt Class Reference

Custom tab art provider that uses the application's accent color. More...

#include <CustomTabArt.h>

Inheritance diagram for EmberForge::CustomTabArt:

Public Member Functions

 CustomTabArt ()
virtual ~CustomTabArt ()=default
wxAuiTabArt * Clone () override
int GetIndentSize () override
 Override to increase tab bar height for larger buttons.
int GetBestTabCtrlSize (wxWindow *wnd, const wxAuiNotebookPageArray &pages, const wxSize &requiredBmpSize) override
 Override to get a taller tab bar.
void UpdateAccentColor ()
 Update the highlight color to match the current accent color preference.
int DrawPageTab (wxDC &dc, wxWindow *wnd, wxAuiNotebookPage &page, const wxRect &rect) override
void LoadButtonIcons ()
 Load button icons from resources Must be called after construction when a window context is available.
void DrawTabBarButtons (wxDC &dc, wxWindow *wnd, const wxRect &rect)
 Draw the tab bar buttons (+ and menu) at the right side of the tab area.
TabBarButton ButtonHitTest (int x, int y) const
 Test if a point hits one of the tab bar buttons.
int GetButtonAreaWidth () const
 Get the width reserved for buttons on the right side of the tab bar.
void SetHoveredButton (TabBarButton button)
 Set the hovered button state (for visual feedback)
void SetPressedButton (TabBarButton button)
 Set the pressed button state (for visual feedback)
bool AreButtonsEnabled () const
 Check if buttons are enabled/visible.
void SetButtonsEnabled (bool enabled)
 Enable or disable the integrated buttons.

Private Attributes

wxColour m_accentColor
wxBitmap m_plusNormal
wxBitmap m_plusHovered
wxBitmap m_plusPressed
wxBitmap m_menuNormal
wxBitmap m_menuHovered
wxBitmap m_menuPressed
wxRect m_plusButtonRect
wxRect m_menuButtonRect
TabBarButton m_hoveredButton
TabBarButton m_pressedButton
bool m_buttonsEnabled
bool m_iconsLoaded

Static Private Attributes

static const int BUTTON_SIZE = 20
static const int BUTTON_SPACING = 4
static const int BUTTON_MARGIN = 8

Detailed Description

Custom tab art provider that uses the application's accent color.

This class extends wxAuiFlatTabArt to customize the active tab indicator line color to use the user's configured accent color from preferences. It also provides integrated Add Tab and Menu buttons in the tab bar.

Definition at line 24 of file CustomTabArt.h.

Constructor & Destructor Documentation

◆ CustomTabArt()

EmberForge::CustomTabArt::CustomTabArt ( )

Definition at line 12 of file CustomTabArt.cpp.

◆ ~CustomTabArt()

virtual EmberForge::CustomTabArt::~CustomTabArt ( )
virtualdefault

Member Function Documentation

◆ AreButtonsEnabled()

bool EmberForge::CustomTabArt::AreButtonsEnabled ( ) const
inline

Check if buttons are enabled/visible.

Returns
true if buttons should be shown

Definition at line 92 of file CustomTabArt.h.

◆ ButtonHitTest()

TabBarButton EmberForge::CustomTabArt::ButtonHitTest ( int x,
int y ) const

Test if a point hits one of the tab bar buttons.

Parameters
xX coordinate relative to notebook
yY coordinate relative to notebook
Returns
The button that was hit, or TabBarButton::None

Definition at line 168 of file CustomTabArt.cpp.

◆ Clone()

wxAuiTabArt * EmberForge::CustomTabArt::Clone ( )
override

Definition at line 19 of file CustomTabArt.cpp.

◆ DrawPageTab()

int EmberForge::CustomTabArt::DrawPageTab ( wxDC & dc,
wxWindow * wnd,
wxAuiNotebookPage & page,
const wxRect & rect )
override

Definition at line 80 of file CustomTabArt.cpp.

◆ DrawTabBarButtons()

void EmberForge::CustomTabArt::DrawTabBarButtons ( wxDC & dc,
wxWindow * wnd,
const wxRect & rect )

Draw the tab bar buttons (+ and menu) at the right side of the tab area.

Parameters
dcThe device context to draw on
wndThe window (notebook) being drawn
rectThe full tab bar area rectangle

Definition at line 122 of file CustomTabArt.cpp.

◆ GetBestTabCtrlSize()

int EmberForge::CustomTabArt::GetBestTabCtrlSize ( wxWindow * wnd,
const wxAuiNotebookPageArray & pages,
const wxSize & requiredBmpSize )
override

Override to get a taller tab bar.

Definition at line 49 of file CustomTabArt.cpp.

◆ GetButtonAreaWidth()

int EmberForge::CustomTabArt::GetButtonAreaWidth ( ) const

Get the width reserved for buttons on the right side of the tab bar.

Returns
Width in pixels to reserve for buttons

Definition at line 114 of file CustomTabArt.cpp.

◆ GetIndentSize()

int EmberForge::CustomTabArt::GetIndentSize ( )
override

Override to increase tab bar height for larger buttons.

Definition at line 44 of file CustomTabArt.cpp.

◆ LoadButtonIcons()

void EmberForge::CustomTabArt::LoadButtonIcons ( )

Load button icons from resources Must be called after construction when a window context is available.

Definition at line 60 of file CustomTabArt.cpp.

◆ SetButtonsEnabled()

void EmberForge::CustomTabArt::SetButtonsEnabled ( bool enabled)
inline

Enable or disable the integrated buttons.

Parameters
enabledWhether buttons should be shown

Definition at line 98 of file CustomTabArt.h.

◆ SetHoveredButton()

void EmberForge::CustomTabArt::SetHoveredButton ( TabBarButton button)

Set the hovered button state (for visual feedback)

Parameters
buttonThe button being hovered, or None

Definition at line 182 of file CustomTabArt.cpp.

◆ SetPressedButton()

void EmberForge::CustomTabArt::SetPressedButton ( TabBarButton button)

Set the pressed button state (for visual feedback)

Parameters
buttonThe button being pressed, or None

Definition at line 184 of file CustomTabArt.cpp.

◆ UpdateAccentColor()

void EmberForge::CustomTabArt::UpdateAccentColor ( )

Update the highlight color to match the current accent color preference.

Definition at line 39 of file CustomTabArt.cpp.

Member Data Documentation

◆ BUTTON_MARGIN

const int EmberForge::CustomTabArt::BUTTON_MARGIN = 8
staticprivate

Definition at line 122 of file CustomTabArt.h.

◆ BUTTON_SIZE

const int EmberForge::CustomTabArt::BUTTON_SIZE = 20
staticprivate

Definition at line 120 of file CustomTabArt.h.

◆ BUTTON_SPACING

const int EmberForge::CustomTabArt::BUTTON_SPACING = 4
staticprivate

Definition at line 121 of file CustomTabArt.h.

◆ m_accentColor

wxColour EmberForge::CustomTabArt::m_accentColor
private

Definition at line 101 of file CustomTabArt.h.

◆ m_buttonsEnabled

bool EmberForge::CustomTabArt::m_buttonsEnabled
private

Definition at line 116 of file CustomTabArt.h.

◆ m_hoveredButton

TabBarButton EmberForge::CustomTabArt::m_hoveredButton
private

Definition at line 112 of file CustomTabArt.h.

◆ m_iconsLoaded

bool EmberForge::CustomTabArt::m_iconsLoaded
private

Definition at line 117 of file CustomTabArt.h.

◆ m_menuButtonRect

wxRect EmberForge::CustomTabArt::m_menuButtonRect
private

Definition at line 109 of file CustomTabArt.h.

◆ m_menuHovered

wxBitmap EmberForge::CustomTabArt::m_menuHovered
private

Definition at line 105 of file CustomTabArt.h.

◆ m_menuNormal

wxBitmap EmberForge::CustomTabArt::m_menuNormal
private

Definition at line 105 of file CustomTabArt.h.

◆ m_menuPressed

wxBitmap EmberForge::CustomTabArt::m_menuPressed
private

Definition at line 105 of file CustomTabArt.h.

◆ m_plusButtonRect

wxRect EmberForge::CustomTabArt::m_plusButtonRect
private

Definition at line 108 of file CustomTabArt.h.

◆ m_plusHovered

wxBitmap EmberForge::CustomTabArt::m_plusHovered
private

Definition at line 104 of file CustomTabArt.h.

◆ m_plusNormal

wxBitmap EmberForge::CustomTabArt::m_plusNormal
private

Definition at line 104 of file CustomTabArt.h.

◆ m_plusPressed

wxBitmap EmberForge::CustomTabArt::m_plusPressed
private

Definition at line 104 of file CustomTabArt.h.

◆ m_pressedButton

TabBarButton EmberForge::CustomTabArt::m_pressedButton
private

Definition at line 113 of file CustomTabArt.h.


The documentation for this class was generated from the following files: