1 | // Aseprite |
---|---|
2 | // Copyright (C) 2019 Igara Studio S.A. |
3 | // Copyright (C) 2001-2017 David Capello |
4 | // |
5 | // This program is distributed under the terms of |
6 | // the End-User License Agreement for Aseprite. |
7 | |
8 | #ifdef HAVE_CONFIG_H |
9 | #include "config.h" |
10 | #endif |
11 | |
12 | #include "app/ui/skin/skin_property.h" |
13 | |
14 | #include "ui/widget.h" |
15 | |
16 | namespace app { |
17 | namespace skin { |
18 | |
19 | const char* SkinProperty::Name = "SkinProperty"; |
20 | |
21 | SkinProperty::SkinProperty() |
22 | : Property(Name) |
23 | { |
24 | m_look = NormalLook; |
25 | m_miniFont = false; |
26 | } |
27 | |
28 | SkinProperty::~SkinProperty() |
29 | { |
30 | } |
31 | |
32 | SkinPropertyPtr get_skin_property(ui::Widget* widget) |
33 | { |
34 | auto skinProp = |
35 | std::static_pointer_cast<SkinProperty>(widget->getProperty(SkinProperty::Name)); |
36 | if (!skinProp) { |
37 | skinProp = std::make_shared<SkinProperty>(); |
38 | widget->setProperty(skinProp); |
39 | } |
40 | return skinProp; |
41 | } |
42 | |
43 | } // namespace skin |
44 | } // namespace app |
45 |