aboutsummaryrefslogtreecommitdiff
path: root/src/ThemeBuilder/components/stylers/PreferredSizeStylerEditor.h
blob: 4a64da10359f13aad9490f63b121cf95323a7c82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#pragma once
#include "../properties/MeasureLengthPropertyEditor.h"
#include "StylerEditor.h"
#include "cru/common/ClonablePtr.h"
#include "cru/ui/style/Styler.h"

namespace cru::theme_builder::components::stylers {
class PreferredSizeStylerEditor : public StylerEditor {
 public:
  PreferredSizeStylerEditor();
  ~PreferredSizeStylerEditor() override;

  ClonablePtr<ui::style::PreferredSizeStyler> GetValue();
  void SetValue(ui::style::PreferredSizeStyler* styler,
                bool trigger_change = true);
  void SetValue(const ClonablePtr<ui::style::PreferredSizeStyler>& styler,
                bool trigger_change = true) {
    SetValue(styler.get(), trigger_change);
  }

  ClonablePtr<ui::style::Styler> GetStyler() override { return GetValue(); }

 private:
  properties::MeasureLengthPropertyEditor width_editor_;
  properties::MeasureLengthPropertyEditor height_editor_;
};
}  // namespace cru::theme_builder::components::stylers