NDEVR
API Documentation
SectionIconTab

Provides a tab that contains an icon and some buttons used for either a tab if the section content is attached to a Container, or as the drag bar if the content is floating. More...

Inheritance diagram for SectionIconTab:
[legend]
Collaboration diagram for SectionIconTab:
[legend]

Public Member Functions

 SectionIconTab (SectionContent *content, DockItem *widget)
 Constructs a SectionIconTab for the given section content and dock item.
QColor backgroundColor ()
 Returns the current background color of this tab.
void contextMenu (const QPoint &point)
 Shows a context menu at the given position.
QIcon getIcon () const override
 Returns the icon displayed on this tab.
virtual TranslatedString getTitle () const override
 Returns the translated title text displayed on this tab.
void init ()
 Initializes the tab's UI elements including icon, title, and action buttons.
bool isDocked ()
 Returns whether this tab is currently in a docked state.
QSize minimumSizeHint () const override
 Returns the minimum recommended size for this tab widget.
void mouseDoubleClickEvent (QMouseEvent *e) override
 Handles double-click events on the tab, typically toggling fullscreen.
void onVisible (bool is_visible)
 Slot called when the visibility of the associated content changes.
void paintEvent (QPaintEvent *) override
 Paints the tab including its background color and rounded corners.
void resizeEvent (QResizeEvent *event) override
 Handles resize events to update icon sizes and layout.
void setBackgroundColor (QColor color)
 Sets the background color of this tab.
void setDocked (bool is_docked) override
 Sets whether this tab is in a docked state.
void setFlat (bool flat)
 Sets whether the tab should render with a flat visual style.
void setFloatingWidget (FloatingWidget *widget) override
 Assigns the floating widget that this tab is part of.
void setFullscreen (bool fullscreen) override
 Sets whether this tab is displayed in fullscreen mode.
void setIcon (const QIcon &icon)
 Sets the icon displayed on this tab.
void setIconID (const String &icon)
 Sets the icon by its resource identifier string.
void setLocation (RibbonArea area, bool is_docked) override
 Updates the tab layout and appearance based on its dock location.
void setSelected (bool is_selected) override
 Sets the selected state of this tab.
void setTitle (const TranslatedString &title)
 Sets the title text displayed on this tab.
QSize sizeHint () const override
 Returns the recommended size for this tab widget.
void updateClosedButton ()
 Updates the visibility and state of the close button.
void updateFullscreenButton ()
 Updates the visibility and state of the fullscreen button.
void updateMovable ()
 Updates the movable state of the tab based on the current section configuration.
void updateSettingsButton ()
 Updates the visibility and state of the settings button.
void updateShowTab ()
 Updates the visibility of the tab based on the current section configuration.
Public Member Functions inherited from SectionTab
 SectionTab (SectionContent *content, QWidget *parent)
 Constructs a SectionTab associated with the given section content and parent widget.
void activeTabChanged ()
 Emitted when the active tab changes.
void clickedSignal (SectionContent *content)
 Emitted when the tab is clicked.
void closableUpdated (bool is_closeable)
 Emitted when the closable state of this tab changes.
void closedSignal (SectionContent *content)
 Emitted when the tab's close action is triggered.
bool event (QEvent *event) override
 Processes generic events such as style changes.
void fullscreenSignal (bool fullscreen)
 Emitted when the fullscreen state is toggled.
void fullscreenUpdated (bool is_fullscreen)
 Emitted when the fullscreen state of this tab changes.
bool isActiveTab () const
 Returns whether this tab is currently the active (selected) tab.
virtual bool isMovable () const
 Returns whether this tab can be moved (dragged) by the user.
virtual bool isShown () const
 Returns whether this tab is currently shown.
void isShownUpdated (bool is_shown)
 Emitted when the shown state of this tab changes.
void moveableUpdated (bool is_moveable)
 Emitted when the moveable state of this tab changes.
void setActiveTab (bool active)
 Sets whether this tab is the active (selected) tab.
void setIsShown (bool shown)
 Sets whether this tab should be shown or hidden.
void setRoundedCorners (int radius_tl, int radius_tr, int radius_bl, int radius_br)
 Sets the rounded corner radii for each corner of the tab.
void setSectionContent (SectionContent *content)
 Sets the section content associated with this tab.
void updateClosableSignal ()
 Emitted to request an update of the closable state.
void updateMoveableSignal ()
 Emitted to request an update of the moveable state.
void updateRoundedCorners ()
 Updates the rounded corner radii based on the current docking position.

Protected Member Functions

bool event (QEvent *event) override
 Handles generic events such as palette changes and hover tracking.
QPalette::ColorRole preferredColorRoll () const
 Returns the preferred palette color role for this tab's background.
void updateBackgroundColor ()
 Updates the background color based on the current selection and hover state.
void updateIconSizes ()
 Updates the icon and button sizes based on the current tab dimensions.
void updateOpacity ()
 Updates the opacity effect based on the tab's active and hover state.
void updateRoundedCorners ()
 Updates the rounded corner radii based on the tab's docking position.
Protected Member Functions inherited from SectionTab
virtual void leaveEvent (QEvent *event) override
 Handles the leave event when the mouse exits the tab.
virtual void mouseMoveEvent (QMouseEvent *ev) override
 Handles mouse move events during tab dragging.
virtual void mousePressEvent (QMouseEvent *event) override
 Handles mouse press events to initiate tab dragging.
virtual void mouseReleaseEvent (QMouseEvent *ev) override
 Handles mouse release events to complete tab dragging or selection.
void receiveCloseButtonClicked ()
 Processes a close button click by emitting the closedSignal.
void receiveFullScreenButtonClicked ()
 Processes a fullscreen button click by emitting the fullscreenSignal.

Protected Attributes

Buttonm_close_button
 Button to close the associated section content.
QPropertyAnimation * m_color_animation
 Animation for background color transitions.
Buttonm_fullscreen_button
 Button to toggle fullscreen mode.
ImageViewm_icon_label
 The label displaying the tab icon.
bool m_is_docked
 Whether this tab is currently docked.
bool m_is_flat
 Whether the tab uses a flat visual style.
bool m_is_hovering
 Whether the mouse cursor is hovering over this tab.
bool m_is_selected
 Whether this tab is currently selected.
QGraphicsOpacityEffect * m_opacity_effect
 Opacity effect for inactive tab dimming.
RibbonArea m_ribbon_area
 The ribbon area where this tab is located.
Buttonm_settings_button
 Button to access settings for the section content.
QCustomLabelm_title_label
 The label displaying the tab title text.
DockItemm_widget
 The dock item that owns this tab.
Protected Attributes inherited from SectionTab
bool m_active_tab
 Whether this is the currently active tab.
SectionContentm_content
 The section content this tab represents.
QPointF m_drag_start_pos
 The global position where a drag operation started.
FloatingWidgetm_floating_widget
 The floating widget hosting this tab, if any.
bool m_is_fullscreen
 Whether the associated content is in fullscreen mode.
QPointF m_local_drag_pos
 The local position within the tab where the drag started.
bool m_tab_moving
 Whether the tab is currently being dragged.

Detailed Description

Provides a tab that contains an icon and some buttons used for either a tab if the section content is attached to a Container, or as the drag bar if the content is floating.


Definition at line 54 of file SectionIconTab.h.

Constructor & Destructor Documentation

◆ SectionIconTab()

SectionIconTab::SectionIconTab ( SectionContent * content,
DockItem * widget )
explicit

Constructs a SectionIconTab for the given section content and dock item.

Parameters
[in]contentThe section content associated with this tab.
[in]widgetThe dock item that owns this tab.

Referenced by init().

Member Function Documentation

◆ backgroundColor()

QColor SectionIconTab::backgroundColor ( )

Returns the current background color of this tab.

Returns
The background color.

◆ contextMenu()

void SectionIconTab::contextMenu ( const QPoint & point)

Shows a context menu at the given position.

Parameters
[in]pointThe position for the context menu in widget coordinates.

◆ event()

bool SectionIconTab::event ( QEvent * event)
overrideprotected

Handles generic events such as palette changes and hover tracking.

Parameters
[in]eventThe event to process.
Returns
True if the event was handled.

References event().

Referenced by event(), and resizeEvent().

◆ getIcon()

QIcon SectionIconTab::getIcon ( ) const
overridevirtual

Returns the icon displayed on this tab.

Returns
The current QIcon.

Reimplemented from SectionTab.

◆ getTitle()

virtual TranslatedString SectionIconTab::getTitle ( ) const
overridevirtual

Returns the translated title text displayed on this tab.

Returns
The title as a TranslatedString.

Reimplemented from SectionTab.

◆ isDocked()

bool SectionIconTab::isDocked ( )
inline

Returns whether this tab is currently in a docked state.

Returns
True if docked, false if floating.

Definition at line 143 of file SectionIconTab.h.

References m_is_docked.

◆ minimumSizeHint()

QSize SectionIconTab::minimumSizeHint ( ) const
override

Returns the minimum recommended size for this tab widget.

Returns
The minimum size hint.

◆ mouseDoubleClickEvent()

void SectionIconTab::mouseDoubleClickEvent ( QMouseEvent * e)
override

Handles double-click events on the tab, typically toggling fullscreen.

Parameters
[in]eThe mouse double-click event.

◆ onVisible()

void SectionIconTab::onVisible ( bool is_visible)

Slot called when the visibility of the associated content changes.

Parameters
[in]is_visibleTrue if the content is now visible.

◆ preferredColorRoll()

QPalette::ColorRole SectionIconTab::preferredColorRoll ( ) const
protected

Returns the preferred palette color role for this tab's background.

Returns
The QPalette::ColorRole to use.

◆ resizeEvent()

void SectionIconTab::resizeEvent ( QResizeEvent * event)
override

Handles resize events to update icon sizes and layout.

Parameters
[in]eventThe resize event.

References event().

◆ setBackgroundColor()

void SectionIconTab::setBackgroundColor ( QColor color)

Sets the background color of this tab.

Parameters
[in]colorThe background color to apply.

◆ setDocked()

void SectionIconTab::setDocked ( bool is_docked)
inlineoverridevirtual

Sets whether this tab is in a docked state.

Parameters
[in]is_dockedTrue if docked, false if floating.

Implements SectionTab.

Definition at line 148 of file SectionIconTab.h.

References m_is_docked.

◆ setFlat()

void SectionIconTab::setFlat ( bool flat)

Sets whether the tab should render with a flat visual style.

Parameters
[in]flatTrue for a flat appearance, false for the default raised style.

◆ setFloatingWidget()

void SectionIconTab::setFloatingWidget ( FloatingWidget * widget)
overridevirtual

Assigns the floating widget that this tab is part of.

Parameters
[in]widgetThe floating widget, or nullptr if not floating.

Reimplemented from SectionTab.

◆ setFullscreen()

void SectionIconTab::setFullscreen ( bool fullscreen)
overridevirtual

Sets whether this tab is displayed in fullscreen mode.

Parameters
[in]fullscreenTrue if the content is displayed fullscreen.

Reimplemented from SectionTab.

◆ setIcon()

void SectionIconTab::setIcon ( const QIcon & icon)

Sets the icon displayed on this tab.

Parameters
[in]iconThe QIcon to display.

◆ setIconID()

void SectionIconTab::setIconID ( const String & icon)

Sets the icon by its resource identifier string.

Parameters
[in]iconThe icon resource identifier.

◆ setLocation()

void SectionIconTab::setLocation ( RibbonArea area,
bool is_docked )
overridevirtual

Updates the tab layout and appearance based on its dock location.

Parameters
[in]areaThe ribbon area where the tab is located.
[in]is_dockedTrue if the tab is docked, false if floating.

Implements SectionTab.

◆ setSelected()

void SectionIconTab::setSelected ( bool is_selected)
overridevirtual

Sets the selected state of this tab.

Parameters
[in]is_selectedTrue if this tab should appear selected.

Implements SectionTab.

◆ setTitle()

void SectionIconTab::setTitle ( const TranslatedString & title)

Sets the title text displayed on this tab.

Parameters
[in]titleThe translated title string.

◆ sizeHint()

QSize SectionIconTab::sizeHint ( ) const
override

Returns the recommended size for this tab widget.

Returns
The preferred size hint.

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