diff options
author | crupest <crupest@outlook.com> | 2022-05-15 14:15:31 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-05-15 14:15:31 +0800 |
commit | 34a64e6ffefaab007578932ddbab931a25f1d56e (patch) | |
tree | 541fdb8279e829a129df62288d09916bf23c9200 /src/theme_builder/components/stylers/PreferredSizeStylerEditor.cpp | |
parent | 8ad2966933957ac5d6ff8dcd5e732736fd5e4dc6 (diff) | |
download | cru-34a64e6ffefaab007578932ddbab931a25f1d56e.tar.gz cru-34a64e6ffefaab007578932ddbab931a25f1d56e.tar.bz2 cru-34a64e6ffefaab007578932ddbab931a25f1d56e.zip |
...
Diffstat (limited to 'src/theme_builder/components/stylers/PreferredSizeStylerEditor.cpp')
-rw-r--r-- | src/theme_builder/components/stylers/PreferredSizeStylerEditor.cpp | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/src/theme_builder/components/stylers/PreferredSizeStylerEditor.cpp b/src/theme_builder/components/stylers/PreferredSizeStylerEditor.cpp deleted file mode 100644 index fb713c8c..00000000 --- a/src/theme_builder/components/stylers/PreferredSizeStylerEditor.cpp +++ /dev/null @@ -1,34 +0,0 @@ -#include "PreferredSizeStylerEditor.h" -#include "cru/ui/style/Styler.h" - -namespace cru::theme_builder::components::stylers { -PreferredSizeStylerEditor::PreferredSizeStylerEditor() { - SetLabel(u"Preferred Size Styler"); - GetContainer()->AddChild(width_editor_.GetRootControl()); - GetContainer()->AddChild(height_editor_.GetRootControl()); - - width_editor_.SetLabel(u"Width"); - height_editor_.SetLabel(u"Height"); - - ConnectChangeEvent(width_editor_); - ConnectChangeEvent(height_editor_); -} - -PreferredSizeStylerEditor::~PreferredSizeStylerEditor() {} - -ClonablePtr<ui::style::PreferredSizeStyler> -PreferredSizeStylerEditor::GetValue() { - return ui::style::PreferredSizeStyler::Create(ui::render::MeasureSize{ - width_editor_.GetValue(), height_editor_.GetValue()}); -} - -void PreferredSizeStylerEditor::SetValue(ui::style::PreferredSizeStyler* styler, - bool trigger_change) { - width_editor_.SetValue(styler->GetPreferredSize().width, false); - height_editor_.SetValue(styler->GetPreferredSize().height, false); - - if (trigger_change) { - RaiseChangeEvent(); - } -} -} // namespace cru::theme_builder::components::stylers |