| 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 | #ifndef APP_UI_SKIN_SKIN_PROPERTY_H_INCLUDED | 
|---|
| 9 | #define APP_UI_SKIN_SKIN_PROPERTY_H_INCLUDED | 
|---|
| 10 | #pragma once | 
|---|
| 11 |  | 
|---|
| 12 | #include "ui/property.h" | 
|---|
| 13 |  | 
|---|
| 14 | #include <memory> | 
|---|
| 15 |  | 
|---|
| 16 | namespace ui { | 
|---|
| 17 | class Widget; | 
|---|
| 18 | } | 
|---|
| 19 |  | 
|---|
| 20 | namespace app { | 
|---|
| 21 | namespace skin { | 
|---|
| 22 |  | 
|---|
| 23 | enum LookType { | 
|---|
| 24 | NormalLook, | 
|---|
| 25 | MiniLook, | 
|---|
| 26 | WithoutBordersLook, | 
|---|
| 27 | }; | 
|---|
| 28 |  | 
|---|
| 29 | // Property to show widgets with a special look (e.g.: buttons or sliders with mini-borders) | 
|---|
| 30 | class SkinProperty : public ui::Property { | 
|---|
| 31 | public: | 
|---|
| 32 | static const char* Name; | 
|---|
| 33 |  | 
|---|
| 34 | SkinProperty(); | 
|---|
| 35 | ~SkinProperty(); | 
|---|
| 36 |  | 
|---|
| 37 | LookType getLook() const { return m_look; } | 
|---|
| 38 | void setLook(LookType look) { m_look = look; } | 
|---|
| 39 |  | 
|---|
| 40 | bool hasMiniFont() const { return m_miniFont; } | 
|---|
| 41 | void setMiniFont() { m_miniFont = true; } | 
|---|
| 42 |  | 
|---|
| 43 | private: | 
|---|
| 44 | LookType m_look; | 
|---|
| 45 | bool m_miniFont; | 
|---|
| 46 | }; | 
|---|
| 47 |  | 
|---|
| 48 | typedef std::shared_ptr<SkinProperty> SkinPropertyPtr; | 
|---|
| 49 |  | 
|---|
| 50 | SkinPropertyPtr get_skin_property(ui::Widget* widget); | 
|---|
| 51 |  | 
|---|
| 52 | } // namespace skin | 
|---|
| 53 | } // namespace app | 
|---|
| 54 |  | 
|---|
| 55 | #endif | 
|---|
| 56 |  | 
|---|