34#include <NDEVR/RibbonLayoutMode.h>
35#include <NDEVR/Buffer.h>
36#include <NDEVR/String.h>
37#include <NDEVR/Dictionary.h>
114 bool event(QEvent* ev)
override;
160 void resizeEvent(QResizeEvent* resize_event)
override;
The equivelent of std::vector but with a bit more control.
A hash-based key-value store, useful for quick associative lookups.
Displays translated text.
bool hasSubGroup(const TranslatedString &sub_group) const
Checks whether a sub-group with the given name exists.
void setFixedNumOfRows(uint01 fixed_num_of_rows)
Sets a fixed number of rows for the layout.
RibbonSubGroup * removeSubGroup(const String &sub_group)
Removes the sub-group with the given string key.
int currentSecondaryDimension() const
Returns the current size along the secondary layout axis.
uint01 m_fixed_num_of_rows
Fixed number of rows, or 0 for automatic.
bool m_is_vertical
Whether the layout is vertical.
RibbonSubGroup * addSubGroup(const TranslatedString &sub_group_name)
Adds a new sub-group with the given name.
int largeButtonWidth() const
Returns the width of a large button in the current layout.
int mediumButtonWidth() const
Returns the width of a medium button in the current layout.
void removeSubGroup(const TranslatedString &sub_group)
Removes the sub-group with the given translated name.
void updateLayout(QSize size)
Updates the internal layout to fit the given size.
uint04 maxNumOfColumns() const
Returns the maximum number of columns across all sub-groups.
void layoutSubGroups()
Slot that performs the layout of all sub-groups within this ribbon group.
Dictionary< String, RibbonSubGroup * > m_sub_group_lookup
Sub-groups indexed by name.
uint04 m_row_num
Current number of layout rows.
Vector< 2, int > minSize() const
Returns the minimum size as a 2D vector (primary, secondary).
Buffer< QFrame * > m_separators
Visual separators between sub-groups.
int marginThickness() const
Returns the margin thickness around the ribbon group content.
void setNumberOfRows(uint04 number_of_rows)
Sets the number of rows used for laying out buttons.
int m_last_width
The last known width, used to detect resize changes.
QBoxLayout * m_layout
The box layout managing sub-group arrangement.
void setVertical(bool is_vertical)
Sets whether the ribbon group layout is vertical.
int currentPrimaryDimension() const
Returns the current size along the primary layout axis (width or height).
Buffer< QWidget * > m_sub_groups
Ordered list of sub-group widgets.
RibbonGroup(QWidget *parent=nullptr)
Constructs a ribbon group widget.
void cleanupEmpty()
Removes any empty sub-groups.
void ribbonResizeEvent(int primary, int secondary)
Notifies the group of a ribbon resize, triggering sub-group relayout.
void addSubGroup(QWidget *sub_group)
Adds an existing widget as a sub-group.
bool isEmpty() const
Returns whether this ribbon group has no sub-groups or all are empty.
void adjustButtonsToFit(int primary, int secondary)
Adjusts button sizes and states to fit within the given dimensions.
RibbonLayoutMode m_layout_mode
The current layout mode.
void resetButtonStates()
Resets all button states in all sub-groups to their defaults.
QSize minimumSizeHint() const override
Returns the minimum recommended size for this ribbon group.
void setupSeparator(QFrame *seperator) const
Configures a separator frame for visual separation between sub-groups.
RibbonSubGroup & operator[](const TranslatedString &location)
Returns the sub-group with the given name, creating it if it does not exist.
Represents a sub-section of "Tab" of a ribbon representing a grouping of buttons or widgets within a ...
The core String class for the NDEVR API.
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
A fixed-size array with N dimensions used as the basis for geometric and mathematical types.
The primary namespace for the NDEVR SDK.
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
RibbonLayoutMode
The orientations a ribbon can take on.