Krotos Modules 3
Loading...
Searching...
No Matches
AttachedLabel.cpp
Go to the documentation of this file.
1namespace krotos
2{
3 AttachedLabel::AttachedLabel(const String& labelText)
4 {
5 setComponentID(labelText);
6
7 addAndMakeVisible(m_label);
9 m_label.setText(labelText, dontSendNotification);
10 m_label.setJustificationType(Justification::centred);
11 }
12
14 {
15 auto bounds = getLocalBounds();
16 const int padding = 0;
17 Rectangle<int> labelBounds;
18 int labelHeight = static_cast<int>(getHeight());
19 labelBounds = bounds;
20
21 auto fontSize = 0.9f * labelHeight;
22
23 m_label.setFont(Font(fontSize));
24 m_label.setBounds(labelBounds);
25 }
26
28
29 std::unique_ptr<LabelCustomParameterAttachment>& AttachedLabel::getAttachment() { return m_attachment; }
30
31} // namespace krotos
std::unique_ptr< LabelCustomParameterAttachment > & getAttachment()
Definition AttachedLabel.cpp:29
std::unique_ptr< LabelCustomParameterAttachment > m_attachment
Definition AttachedLabel.h:27
void resized() override
Definition AttachedLabel.cpp:13
KrotosLabel m_label
Definition AttachedLabel.h:26
KrotosLabel & getLabel()
Definition AttachedLabel.cpp:27
AttachedLabel(const String &labelText)
Definition AttachedLabel.cpp:3
This class was initally created to add right-click edit functionality to labels.
Definition KrotosLabel.h:9
void setEditable(bool editOnSingleClick, bool editOnDoubleClick=false, bool editOnRightClick=false, bool lossOfFocusDiscards=false)
Definition KrotosLabel.cpp:5
Definition AirAbsorptionFilter.cpp:2