10#include "i18n/translate.hpp"
15namespace hi::inline v1 {
59 label &operator=(
label const &other)
noexcept =
default;
61 label &operator=(
label &&other)
noexcept =
default;
63 [[nodiscard]]
constexpr bool empty() const noexcept
65 return icon.empty() and text.empty();
68 constexpr explicit operator bool() const noexcept
80 return lhs.icon == rhs.icon and lhs.text == rhs.text;
90 return lhs << to_string(rhs);
98template<
typename CharT>
99struct std::formatter<hi::label, CharT> : std::formatter<std::string_view, CharT> {
100 auto format(hi::label
const &t,
auto &fc)
102 return std::formatter<std::string_view, CharT>::format(
to_string(t), fc);
This file includes required definitions.
A localizable message.
Definition translate.hpp:150
An image, in different formats.
Definition icon.hpp:19
A label consisting of localizable text and an icon.
Definition label.hpp:27
friend bool operator==(label const &lhs, label const &rhs) noexcept
Compare if both labels are equal.
Definition label.hpp:78
tr text
Localizable text.
Definition label.hpp:36
label(tr text) noexcept
Construct a new label from text.
Definition label.hpp:47
label(hi::icon icon) noexcept
Construct a new label from an icon.
Definition label.hpp:52
hi::icon icon
The icon.
Definition label.hpp:31
label(hi::icon icon, tr text) noexcept
Construct a new label from an icon and text.
Definition label.hpp:42
constexpr label() noexcept
Construct a empty label.
Definition label.hpp:56