| 1 | // Aseprite |
| 2 | // Copyright (C) 2001-2017 David Capello |
| 3 | // |
| 4 | // This program is distributed under the terms of |
| 5 | // the End-User License Agreement for Aseprite. |
| 6 | |
| 7 | #ifndef APP_UI_PALETTES_LISTBOX_H_INCLUDED |
| 8 | #define APP_UI_PALETTES_LISTBOX_H_INCLUDED |
| 9 | #pragma once |
| 10 | |
| 11 | #include "app/ui/resources_listbox.h" |
| 12 | #include "obs/connection.h" |
| 13 | #include "ui/tooltips.h" |
| 14 | |
| 15 | namespace doc { |
| 16 | class Palette; |
| 17 | } |
| 18 | |
| 19 | namespace app { |
| 20 | |
| 21 | class PalettesListBox : public ResourcesListBox { |
| 22 | public: |
| 23 | PalettesListBox(); |
| 24 | |
| 25 | const doc::Palette* selectedPalette(); |
| 26 | |
| 27 | obs::signal<void(const doc::Palette*)> PalChange; |
| 28 | |
| 29 | protected: |
| 30 | virtual ResourceListItem* onCreateResourceItem(Resource* resource) override; |
| 31 | virtual void onResourceChange(Resource* resource) override; |
| 32 | virtual void onPaintResource(ui::Graphics* g, gfx::Rect& bounds, Resource* resource) override; |
| 33 | virtual void onResourceSizeHint(Resource* resource, gfx::Size& size) override; |
| 34 | |
| 35 | ui::TooltipManager m_tooltips; |
| 36 | obs::scoped_connection m_extPaletteChanges; |
| 37 | obs::scoped_connection m_extPresetsChanges; |
| 38 | }; |
| 39 | |
| 40 | } // namespace app |
| 41 | |
| 42 | #endif |
| 43 | |