#pragma once #include "modern-qt/utility/theme/theme.hh" #include "modern-qt/utility/wrapper/common.hh" #include "modern-qt/utility/wrapper/widget.hh" #include namespace creeper::text::internal { class Text : public QLabel { using QLabel::QLabel; public: auto set_color_scheme(const ColorScheme& scheme) noexcept -> void { set_color(scheme.on_surface); } auto load_theme_manager(ThemeManager& manager) noexcept -> void { manager.append_handler(this, [this](const ThemeManager& manager) { set_color_scheme(manager.color_scheme()); }); } auto set_color(QColor color) noexcept -> void { const auto name = color.name(QColor::HexArgb); const auto style = QString("QLabel { color : %1; }"); setStyleSheet(style.arg(name)); } }; } namespace creeper::text::pro { using Token = common::Token; using Text = common::pro::Text; using Color = SetterProp; using WordWrap = SetterProp; using AdjustSize = ActionProp; using Alignment = SetterProp; template concept trait = std::derived_from; CREEPER_DEFINE_CHECKER(trait); using namespace widget::pro; using namespace theme::pro; } namespace creeper { using Text = Declarative>; }