| 1 | // Aseprite |
|---|---|
| 2 | // Copyright (C) 2022 Igara Studio S.A. |
| 3 | // Copyright (C) 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_SEPARATOR_IN_VIEW_H_INCLUDED |
| 9 | #define APP_UI_SEPARATOR_IN_VIEW_H_INCLUDED |
| 10 | #pragma once |
| 11 | |
| 12 | #include "app/ui/skin/skin_theme.h" |
| 13 | #include "ui/separator.h" |
| 14 | |
| 15 | namespace app { |
| 16 | |
| 17 | class SeparatorInView : public ui::Separator { |
| 18 | public: |
| 19 | SeparatorInView(const std::string& text = std::string(), |
| 20 | int align = ui::HORIZONTAL) |
| 21 | : Separator(text, align) { |
| 22 | InitTheme.connect( |
| 23 | [this]{ |
| 24 | auto theme = skin::SkinTheme::get(this); |
| 25 | setStyle(theme->styles.separatorInView()); |
| 26 | if (this->text().empty()) |
| 27 | setBorder(border() + gfx::Border(0, 2, 0, 2)*ui::guiscale()); |
| 28 | }); |
| 29 | initTheme(); |
| 30 | } |
| 31 | }; |
| 32 | |
| 33 | } // namespace app |
| 34 | |
| 35 | #endif |
| 36 |