Label class new in Git master
#include <Magnum/Ui/Label.h>
Label widget.
Base classes
-
template<class UserInterface>class BasicWidget<UserInterface> new in Git master
- Templated abstract base for stateful widgets.
Constructors, destructors, conversion operators
-
Label(Anchor anchor,
Icon icon,
LabelStyle style = LabelStyle::
Default) explicit - Construct an icon label.
-
Label(Anchor anchor,
Containers::
StringView text, const TextProperties& textProperties, LabelStyle style = LabelStyle:: Default) explicit - Construct a text label.
-
Label(Anchor anchor,
Containers::
StringView text, LabelStyle style = LabelStyle:: Default) explicit -
Label(Anchor anchor,
const StorageQuery<Int>& query,
LabelStyle style = LabelStyle::
Default) explicit - Construct a label with an integer data binding.
-
Label(Anchor anchor,
const StorageQuery<UnsignedInt>& query,
LabelStyle style = LabelStyle::
Default) explicit -
Label(Anchor anchor,
const StorageQuery<Long>& query,
LabelStyle style = LabelStyle::
Default) explicit -
Label(Anchor anchor,
const StorageQuery<UnsignedLong>& query,
LabelStyle style = LabelStyle::
Default) explicit -
Label(Anchor anchor,
const StorageQuery<Int>& query,
const DecimalFormatter& formatter,
LabelStyle style = LabelStyle::
Default) explicit - Construct a label with an integer data binding and a custom decimal formatter.
-
Label(Anchor anchor,
const StorageQuery<UnsignedInt>& query,
const DecimalFormatter& formatter,
LabelStyle style = LabelStyle::
Default) explicit -
Label(Anchor anchor,
const StorageQuery<Long>& query,
const DecimalFormatter& formatter,
LabelStyle style = LabelStyle::
Default) explicit -
Label(Anchor anchor,
const StorageQuery<UnsignedLong>& query,
const DecimalFormatter& formatter,
LabelStyle style = LabelStyle::
Default) explicit -
Label(Anchor anchor,
const StorageQuery<Int>& query,
const HexadecimalFormatter& formatter,
LabelStyle style = LabelStyle::
Default) explicit - Construct a label with an integer data binding and a custom hexadecimal formatter.
-
Label(Anchor anchor,
const StorageQuery<UnsignedInt>& query,
const HexadecimalFormatter& formatter,
LabelStyle style = LabelStyle::
Default) explicit -
Label(Anchor anchor,
const StorageQuery<Long>& query,
const HexadecimalFormatter& formatter,
LabelStyle style = LabelStyle::
Default) explicit -
Label(Anchor anchor,
const StorageQuery<UnsignedLong>& query,
const HexadecimalFormatter& formatter,
LabelStyle style = LabelStyle::
Default) explicit -
Label(Anchor anchor,
const StorageQuery<Float>& query,
LabelStyle style = LabelStyle::
Default) explicit - Construct a label with a floating-point data binding.
-
Label(Anchor anchor,
const StorageQuery<Double>& query,
LabelStyle style = LabelStyle::
Default) explicit -
Label(Anchor anchor,
const StorageQuery<Float>& query,
const FloatFormatter& formatter,
LabelStyle style = LabelStyle::
Default) explicit - Construct a label with a float data binding and a custom formatter.
-
Label(Anchor anchor,
const StorageQuery<Double>& query,
const FloatFormatter& formatter,
LabelStyle style = LabelStyle::
Default) explicit -
Label(Anchor anchor,
const StorageQuery<Containers::
StringView>& query, LabelStyle style = LabelStyle:: Default) explicit - Construct a label with a string data binding.
-
Label(Anchor anchor,
const StorageQuery<Icon>& query,
LabelStyle style = LabelStyle::
Default) explicit - Construct a label with an icon data binding.
-
Label(NonOwnedT,
Anchor anchor,
Icon icon,
LabelStyle style = LabelStyle::
Default) explicit - Construct a non-owned icon label.
-
Label(NonOwnedT,
Anchor anchor,
Containers::
StringView text, const TextProperties& textProperties, LabelStyle style = LabelStyle:: Default) explicit - Construct a non-owned text label.
-
Label(NonOwnedT,
Anchor anchor,
Containers::
StringView text, LabelStyle style = LabelStyle:: Default) explicit -
Label(NonOwnedT,
Anchor anchor,
const StorageQuery<Int>& query,
LabelStyle style = LabelStyle::
Default) explicit - Construct a non-owned label with an integer data binding.
-
Label(NonOwnedT,
Anchor anchor,
const StorageQuery<UnsignedInt>& query,
LabelStyle style = LabelStyle::
Default) explicit -
Label(NonOwnedT,
Anchor anchor,
const StorageQuery<Long>& query,
LabelStyle style = LabelStyle::
Default) explicit -
Label(NonOwnedT,
Anchor anchor,
const StorageQuery<UnsignedLong>& query,
LabelStyle style = LabelStyle::
Default) explicit -
Label(NonOwnedT,
Anchor anchor,
const StorageQuery<Int>& query,
const DecimalFormatter& formatter,
LabelStyle style = LabelStyle::
Default) explicit - Construct a non-owned label with an integer data binding and a custom decimal formatter.
-
Label(NonOwnedT,
Anchor anchor,
const StorageQuery<UnsignedInt>& query,
const DecimalFormatter& formatter,
LabelStyle style = LabelStyle::
Default) explicit -
Label(NonOwnedT,
Anchor anchor,
const StorageQuery<Long>& query,
const DecimalFormatter& formatter,
LabelStyle style = LabelStyle::
Default) explicit -
Label(NonOwnedT,
Anchor anchor,
const StorageQuery<UnsignedLong>& query,
const DecimalFormatter& formatter,
LabelStyle style = LabelStyle::
Default) explicit -
Label(NonOwnedT,
Anchor anchor,
const StorageQuery<Int>& query,
const HexadecimalFormatter& formatter,
LabelStyle style = LabelStyle::
Default) explicit - Construct a non-owned label with an integer data binding and a custom hexadecimal formatter.
-
Label(NonOwnedT,
Anchor anchor,
const StorageQuery<UnsignedInt>& query,
const HexadecimalFormatter& formatter,
LabelStyle style = LabelStyle::
Default) explicit -
Label(NonOwnedT,
Anchor anchor,
const StorageQuery<Long>& query,
const HexadecimalFormatter& formatter,
LabelStyle style = LabelStyle::
Default) explicit -
Label(NonOwnedT,
Anchor anchor,
const StorageQuery<UnsignedLong>& query,
const HexadecimalFormatter& formatter,
LabelStyle style = LabelStyle::
Default) explicit -
Label(NonOwnedT,
Anchor anchor,
const StorageQuery<Float>& query,
LabelStyle style = LabelStyle::
Default) explicit - Construct a non-owned label with a float data binding.
-
Label(NonOwnedT,
Anchor anchor,
const StorageQuery<Double>& query,
LabelStyle style = LabelStyle::
Default) explicit -
Label(NonOwnedT,
Anchor anchor,
const StorageQuery<Float>& query,
const FloatFormatter& formatter,
LabelStyle style = LabelStyle::
Default) explicit - Construct a non-owned label with a float data binding and a custom formatter.
-
Label(NonOwnedT,
Anchor anchor,
const StorageQuery<Double>& query,
const FloatFormatter& formatter,
LabelStyle style = LabelStyle::
Default) explicit -
Label(NonOwnedT,
Anchor anchor,
const StorageQuery<Containers::
StringView>& query, LabelStyle style = LabelStyle:: Default) explicit - Construct a non-owned label with a string data binding.
-
Label(NonOwnedT,
Anchor anchor,
const StorageQuery<Icon>& query,
LabelStyle style = LabelStyle::
Default) explicit - Construct a non-owned label with an icon data binding.
- Label(NoCreateT) explicit
- Construct with no underlying node.
Public functions
- auto hasDataBinding() const -> bool
- Whether the label has a data binding.
- auto style() const -> LabelStyle
- Style.
- auto setStyle(LabelStyle style) -> Label&
- Set style.
- auto setStyle(LabelStyle style, Nanoseconds time) -> Label&
- Set style at given time.
- auto icon() const -> Icon
- Icon.
- auto setIcon(Icon icon) -> Label&
- Set icon.
-
auto setText(Containers::
StringView text, const TextProperties& textProperties = {}) -> Label& - Set text.
- auto textData() const -> DataHandle
- Icon / text data or DataHandle::
Null. - auto layoutData() const -> DataHandle
- Layout data.
- auto dataBindingData() const -> DataHandle
- Data binding data or DataHandle::
Null.
Function documentation
Magnum:: Ui:: Label:: Label(Anchor anchor,
Icon icon,
LabelStyle style = LabelStyle:: Default) explicit
Construct an icon label.
| Parameters | |
|---|---|
| anchor | Positioning anchor |
| icon | Label icon. Passing Icon:: |
| style | Label style |
The label can be subsequently converted to a text label using setText().
Magnum:: Ui:: Label:: Label(Anchor anchor,
Containers:: StringView text,
const TextProperties& textProperties,
LabelStyle style = LabelStyle:: Default) explicit
Construct a text label.
| Parameters | |
|---|---|
| anchor | Positioning anchor |
| text | Label text. Passing an empty string makes the label empty. |
| textProperties | Text shaping and layouting properties |
| style | Label style |
The label can be subsequently converted to an icon label using setIcon().
Magnum:: Ui:: Label:: Label(Anchor anchor,
Containers:: StringView text,
LabelStyle style = LabelStyle:: Default) explicit
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Magnum:: Ui:: Label:: Label(Anchor anchor,
const StorageQuery<Int>& query,
LabelStyle style = LabelStyle:: Default) explicit
Construct a label with an integer data binding.
| Parameters | |
|---|---|
| anchor | Positioning anchor |
| query | DataLayer storage query |
| style | Label style |
Formats the value with a default-constructed DecimalFormatter. Use the Label(Anchor, const StorageQuery<Int>&, const DecimalFormatter&, LabelStyle) or Label(Anchor, const StorageQuery<Int>&, const HexadecimalFormatter&, LabelStyle) constructors and their overloads to explicitly supply a configured DecimalFormatter or HexadecimalFormatter instance.
Note that it's not possible to supply custom TextProperties this way. If you need to override these, supply the query along with a lambda calling setText() to DataLayer::
Magnum:: Ui:: Label:: Label(Anchor anchor,
const StorageQuery<UnsignedInt>& query,
LabelStyle style = LabelStyle:: Default) explicit
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Magnum:: Ui:: Label:: Label(Anchor anchor,
const StorageQuery<Long>& query,
LabelStyle style = LabelStyle:: Default) explicit
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Magnum:: Ui:: Label:: Label(Anchor anchor,
const StorageQuery<UnsignedLong>& query,
LabelStyle style = LabelStyle:: Default) explicit
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Magnum:: Ui:: Label:: Label(Anchor anchor,
const StorageQuery<Int>& query,
const DecimalFormatter& formatter,
LabelStyle style = LabelStyle:: Default) explicit
Construct a label with an integer data binding and a custom decimal formatter.
| Parameters | |
|---|---|
| anchor | Positioning anchor |
| query | DataLayer storage query |
| formatter | Formatter instance |
| style | Label style |
Use the Label(Anchor, const StorageQuery<Int>&, const HexadecimalFormatter&, LabelStyle) constructor and its overloads to format the value as hexadecimal instead. Passing a default-constructed DecimalFormatter instance is equivalent to using the Label(Anchor, const StorageQuery<Int>&, LabelStyle) constructor.
Note that it's not possible to supply custom TextProperties this way. If you need to override these, supply the query along with a lambda calling setText() to DataLayer::
Magnum:: Ui:: Label:: Label(Anchor anchor,
const StorageQuery<UnsignedInt>& query,
const DecimalFormatter& formatter,
LabelStyle style = LabelStyle:: Default) explicit
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Magnum:: Ui:: Label:: Label(Anchor anchor,
const StorageQuery<Long>& query,
const DecimalFormatter& formatter,
LabelStyle style = LabelStyle:: Default) explicit
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Magnum:: Ui:: Label:: Label(Anchor anchor,
const StorageQuery<UnsignedLong>& query,
const DecimalFormatter& formatter,
LabelStyle style = LabelStyle:: Default) explicit
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Magnum:: Ui:: Label:: Label(Anchor anchor,
const StorageQuery<Int>& query,
const HexadecimalFormatter& formatter,
LabelStyle style = LabelStyle:: Default) explicit
Construct a label with an integer data binding and a custom hexadecimal formatter.
| Parameters | |
|---|---|
| anchor | Positioning anchor |
| query | DataLayer storage query |
| formatter | Formatter instance |
| style | Label style |
Use the Label(Anchor, const StorageQuery<Int>&, const DecimalFormatter&, LabelStyle) constructor and its overloads to format the value as decimal instead, or Label(Anchor, const StorageQuery<Int>&, LabelStyle) to use a default-constructed DecimalFormatter instance.
Note that it's not possible to supply custom TextProperties this way. If you need to override these, supply the query along with a lambda calling setText() to DataLayer::
Magnum:: Ui:: Label:: Label(Anchor anchor,
const StorageQuery<UnsignedInt>& query,
const HexadecimalFormatter& formatter,
LabelStyle style = LabelStyle:: Default) explicit
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Magnum:: Ui:: Label:: Label(Anchor anchor,
const StorageQuery<Long>& query,
const HexadecimalFormatter& formatter,
LabelStyle style = LabelStyle:: Default) explicit
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Magnum:: Ui:: Label:: Label(Anchor anchor,
const StorageQuery<UnsignedLong>& query,
const HexadecimalFormatter& formatter,
LabelStyle style = LabelStyle:: Default) explicit
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Magnum:: Ui:: Label:: Label(Anchor anchor,
const StorageQuery<Float>& query,
LabelStyle style = LabelStyle:: Default) explicit
Construct a label with a floating-point data binding.
| Parameters | |
|---|---|
| anchor | Positioning anchor |
| query | DataLayer storage query |
| style | Label style |
Formats the value with a default-constructed FloatFormatter. Use the Label(Anchor, const StorageQuery<Float>&, const FloatFormatter&, LabelStyle) constructor and its overloads to explicitly supply a configured FloatFormatter instance.
Note that it's not possible to supply custom TextProperties this way. If you need to override these, supply the query along with a lambda calling setText() to DataLayer::
Magnum:: Ui:: Label:: Label(Anchor anchor,
const StorageQuery<Double>& query,
LabelStyle style = LabelStyle:: Default) explicit
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Magnum:: Ui:: Label:: Label(Anchor anchor,
const StorageQuery<Float>& query,
const FloatFormatter& formatter,
LabelStyle style = LabelStyle:: Default) explicit
Construct a label with a float data binding and a custom formatter.
| Parameters | |
|---|---|
| anchor | Positioning anchor |
| query | DataLayer storage query |
| formatter | Formatter instance |
| style | Label style |
Passing a default-constructed FloatFormatter instance is equivalent to using the Label(Anchor, const StorageQuery<Float>&, LabelStyle) constructor overloads.
Note that it's not possible to supply custom TextProperties this way. If you need to override these, supply the query along with a lambda calling setText() to DataLayer::
Magnum:: Ui:: Label:: Label(Anchor anchor,
const StorageQuery<Double>& query,
const FloatFormatter& formatter,
LabelStyle style = LabelStyle:: Default) explicit
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Magnum:: Ui:: Label:: Label(Anchor anchor,
const StorageQuery<Containers:: StringView>& query,
LabelStyle style = LabelStyle:: Default) explicit
Construct a label with a string data binding.
| Parameters | |
|---|---|
| anchor | Positioning anchor |
| query | DataLayer storage query |
| style | Label style |
Note that it's not possible to supply custom TextProperties this way. If you need to override these, supply the query along with a lambda calling setText() to DataLayer::
Magnum:: Ui:: Label:: Label(Anchor anchor,
const StorageQuery<Icon>& query,
LabelStyle style = LabelStyle:: Default) explicit
Construct a label with an icon data binding.
| Parameters | |
|---|---|
| anchor | Positioning anchor |
| query | DataLayer storage query |
| style | Label style |
Note that it's not possible to supply custom TextProperties this way. If you need to override these, supply the query along with a lambda calling setIcon() to DataLayer::
Magnum:: Ui:: Label:: Label(NonOwnedT,
Anchor anchor,
Icon icon,
LabelStyle style = LabelStyle:: Default) explicit
Construct a non-owned icon label.
Like Label(Anchor, Icon, LabelStyle) but the widget node doesn't get removed on destruction. Instead, it gets removed either once any parent node is removed, or when AbstractUserInterface::
Magnum:: Ui:: Label:: Label(NonOwnedT,
Anchor anchor,
Containers:: StringView text,
const TextProperties& textProperties,
LabelStyle style = LabelStyle:: Default) explicit
Construct a non-owned text label.
Like Label(Anchor, Containers::
Magnum:: Ui:: Label:: Label(NonOwnedT,
Anchor anchor,
Containers:: StringView text,
LabelStyle style = LabelStyle:: Default) explicit
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Magnum:: Ui:: Label:: Label(NonOwnedT,
Anchor anchor,
const StorageQuery<Int>& query,
LabelStyle style = LabelStyle:: Default) explicit
Construct a non-owned label with an integer data binding.
Like Label(Anchor, const StorageQuery<Int>&, LabelStyle) but the widget node doesn't get removed on destruction. Instead, it gets removed either once any parent node is removed, or when AbstractUserInterface::
Magnum:: Ui:: Label:: Label(NonOwnedT,
Anchor anchor,
const StorageQuery<UnsignedInt>& query,
LabelStyle style = LabelStyle:: Default) explicit
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Magnum:: Ui:: Label:: Label(NonOwnedT,
Anchor anchor,
const StorageQuery<Long>& query,
LabelStyle style = LabelStyle:: Default) explicit
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Magnum:: Ui:: Label:: Label(NonOwnedT,
Anchor anchor,
const StorageQuery<UnsignedLong>& query,
LabelStyle style = LabelStyle:: Default) explicit
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Magnum:: Ui:: Label:: Label(NonOwnedT,
Anchor anchor,
const StorageQuery<Int>& query,
const DecimalFormatter& formatter,
LabelStyle style = LabelStyle:: Default) explicit
Construct a non-owned label with an integer data binding and a custom decimal formatter.
Like Label(Anchor, const StorageQuery<Int>&, const DecimalFormatter&, LabelStyle) but the widget node doesn't get removed on destruction. Instead, it gets removed either once any parent node is removed, or when AbstractUserInterface::
Magnum:: Ui:: Label:: Label(NonOwnedT,
Anchor anchor,
const StorageQuery<UnsignedInt>& query,
const DecimalFormatter& formatter,
LabelStyle style = LabelStyle:: Default) explicit
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Magnum:: Ui:: Label:: Label(NonOwnedT,
Anchor anchor,
const StorageQuery<Long>& query,
const DecimalFormatter& formatter,
LabelStyle style = LabelStyle:: Default) explicit
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Magnum:: Ui:: Label:: Label(NonOwnedT,
Anchor anchor,
const StorageQuery<UnsignedLong>& query,
const DecimalFormatter& formatter,
LabelStyle style = LabelStyle:: Default) explicit
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Magnum:: Ui:: Label:: Label(NonOwnedT,
Anchor anchor,
const StorageQuery<Int>& query,
const HexadecimalFormatter& formatter,
LabelStyle style = LabelStyle:: Default) explicit
Construct a non-owned label with an integer data binding and a custom hexadecimal formatter.
Like Label(Anchor, const StorageQuery<Int>&, const HexadecimalFormatter&, LabelStyle) but the widget node doesn't get removed on destruction. Instead, it gets removed either once any parent node is removed, or when AbstractUserInterface::
Magnum:: Ui:: Label:: Label(NonOwnedT,
Anchor anchor,
const StorageQuery<UnsignedInt>& query,
const HexadecimalFormatter& formatter,
LabelStyle style = LabelStyle:: Default) explicit
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Magnum:: Ui:: Label:: Label(NonOwnedT,
Anchor anchor,
const StorageQuery<Long>& query,
const HexadecimalFormatter& formatter,
LabelStyle style = LabelStyle:: Default) explicit
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Magnum:: Ui:: Label:: Label(NonOwnedT,
Anchor anchor,
const StorageQuery<UnsignedLong>& query,
const HexadecimalFormatter& formatter,
LabelStyle style = LabelStyle:: Default) explicit
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Magnum:: Ui:: Label:: Label(NonOwnedT,
Anchor anchor,
const StorageQuery<Float>& query,
LabelStyle style = LabelStyle:: Default) explicit
Construct a non-owned label with a float data binding.
Like Label(Anchor, const StorageQuery<Float>&, LabelStyle) but the widget node doesn't get removed on destruction. Instead, it gets removed either once any parent node is removed, or when AbstractUserInterface::
Magnum:: Ui:: Label:: Label(NonOwnedT,
Anchor anchor,
const StorageQuery<Double>& query,
LabelStyle style = LabelStyle:: Default) explicit
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Magnum:: Ui:: Label:: Label(NonOwnedT,
Anchor anchor,
const StorageQuery<Float>& query,
const FloatFormatter& formatter,
LabelStyle style = LabelStyle:: Default) explicit
Construct a non-owned label with a float data binding and a custom formatter.
Like Label(Anchor, const StorageQuery<Float>&, const FloatFormatter&, LabelStyle) but the widget node doesn't get removed on destruction. Instead, it gets removed either once any parent node is removed, or when AbstractUserInterface::
Magnum:: Ui:: Label:: Label(NonOwnedT,
Anchor anchor,
const StorageQuery<Double>& query,
const FloatFormatter& formatter,
LabelStyle style = LabelStyle:: Default) explicit
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Magnum:: Ui:: Label:: Label(NonOwnedT,
Anchor anchor,
const StorageQuery<Containers:: StringView>& query,
LabelStyle style = LabelStyle:: Default) explicit
Construct a non-owned label with a string data binding.
Like Label(Anchor, const StorageQuery<Containers::
Magnum:: Ui:: Label:: Label(NonOwnedT,
Anchor anchor,
const StorageQuery<Icon>& query,
LabelStyle style = LabelStyle:: Default) explicit
Construct a non-owned label with an icon data binding.
Like Label(Anchor, const StorageQuery<Icon>&, LabelStyle) but the widget node doesn't get removed on destruction. Instead, it gets removed either once any parent node is removed, or when AbstractUserInterface::
bool Magnum:: Ui:: Label:: hasDataBinding() const
Whether the label has a data binding.
Returns true if the label was constructed using a StorageQuery, false otherwise.
Label& Magnum:: Ui:: Label:: setStyle(LabelStyle style)
Set style.
| Returns | Reference to self (for method chaining) |
|---|
Note that calling this function doesn't change the font if the new style uses a different one, you have to call setText() afterwards to make it pick it up. This is the case especially when switching to or from LabelStyle::
Label& Magnum:: Ui:: Label:: setStyle(LabelStyle style,
Nanoseconds time)
Set style at given time.
| Returns | Reference to self (for method chaining) |
|---|
Compared to setStyle(LabelStyle) may animate the style transition if the theme defines an animation for it. The style() getter is however updated immediately always.
Icon Magnum:: Ui:: Label:: icon() const
Icon.
If the label is text-only or has neither an icon nor a text, returns Icon::
Label& Magnum:: Ui:: Label:: setIcon(Icon icon)
Set icon.
| Returns | Reference to self (for method chaining) |
|---|
Expects that the label doesn't have a data binding, as in that case the label updates are driven from outside. If the label had a text before, it's replaced with the icon. Passing Icon::
Label& Magnum:: Ui:: Label:: setText(Containers:: StringView text,
const TextProperties& textProperties = {})
Set text.
| Returns | Reference to self (for method chaining) |
|---|
Expects that the label doesn't have a data binding, as in that case the label updates are driven from outside. If the label had an icon before, it's replaced with a text. Passing an empty text makes the label empty.
DataHandle Magnum:: Ui:: Label:: textData() const
Icon / text data or DataHandle::
Exposed mainly for testing purposes, not meant to be modified directly.
DataHandle Magnum:: Ui:: Label:: layoutData() const
Layout data.
Exposed mainly for testing purposes, not meant to be modified directly.
DataHandle Magnum:: Ui:: Label:: dataBindingData() const
Data binding data or DataHandle::
Exposed mainly for testing purposes, not meant to be modified directly.