Krotos Modules 3
Loading...
Searching...
No Matches
krotos::DragComponent Class Reference

A component designed to represent a draggable element with a visual representation. More...

#include <DragComponent.h>

Inheritance diagram for krotos::DragComponent:

Classes

struct  ColourDefinitions
 
struct  Layout
 

Public Member Functions

 DragComponent (const String &labelText)
 
void paint (Graphics &g) override
 

Private Member Functions

int calculateTextWidth (const String &text) const
 

Private Attributes

struct krotos::DragComponent::ColourDefinitions m_colours
 
int m_textWidth
 
std::unique_ptr< Drawable > m_dragIconImage
 
String m_labelText
 

Detailed Description

A component designed to represent a draggable element with a visual representation.

This component is used for displaying and managing a draggable interface element, like the label of a Slider which includes a background, border, optional icon, and text.

Constructor & Destructor Documentation

◆ DragComponent()

krotos::DragComponent::DragComponent ( const String & labelText)

Constructor

Parameters
labelTextThe text to display within the drag component.

Member Function Documentation

◆ calculateTextWidth()

int krotos::DragComponent::calculateTextWidth ( const String & text) const
private

◆ paint()

void krotos::DragComponent::paint ( Graphics & g)
override

Member Data Documentation

◆ m_colours

struct krotos::DragComponent::ColourDefinitions krotos::DragComponent::m_colours
private

◆ m_dragIconImage

std::unique_ptr<Drawable> krotos::DragComponent::m_dragIconImage
private

◆ m_labelText

String krotos::DragComponent::m_labelText
private

◆ m_textWidth

int krotos::DragComponent::m_textWidth
private

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