From 72402c09d45b696cd58a65b4a141a804e1cd9371 Mon Sep 17 00:00:00 2001 From: crupest Date: Mon, 24 Jan 2022 20:26:58 +0800 Subject: ... --- include/cru/ui/style/StyleRule.hpp | 7 +++++++ include/cru/ui/style/Styler.hpp | 5 +++++ 2 files changed, 12 insertions(+) (limited to 'include/cru/ui/style') diff --git a/include/cru/ui/style/StyleRule.hpp b/include/cru/ui/style/StyleRule.hpp index e6035784..743aa759 100644 --- a/include/cru/ui/style/StyleRule.hpp +++ b/include/cru/ui/style/StyleRule.hpp @@ -10,6 +10,13 @@ namespace cru::ui::style { class StyleRule : public Object { public: + static ClonablePtr Create(ClonablePtr condition, + ClonablePtr styler, + String name = {}) { + return ClonablePtr(new StyleRule( + std::move(condition), std::move(styler), std::move(name))); + } + StyleRule(ClonablePtr condition, ClonablePtr styler, String name = {}); diff --git a/include/cru/ui/style/Styler.hpp b/include/cru/ui/style/Styler.hpp index 721a3bfd..3bf0b027 100644 --- a/include/cru/ui/style/Styler.hpp +++ b/include/cru/ui/style/Styler.hpp @@ -25,6 +25,11 @@ class CompoundStyler : public Styler { new CompoundStyler(std::vector>{std::move(s)...})); } + static ClonablePtr Create( + std::vector> stylers) { + return ClonablePtr(new CompoundStyler(std::move(stylers))); + } + explicit CompoundStyler(std::vector> stylers) : stylers_(std::move(stylers)) {} -- cgit v1.2.3