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_ZOOM_ENTRY_H_INCLUDED |
8 | #define APP_UI_ZOOM_ENTRY_H_INCLUDED |
9 | #pragma once |
10 | |
11 | #include "render/zoom.h" |
12 | #include "ui/int_entry.h" |
13 | #include "ui/slider.h" |
14 | |
15 | namespace app { |
16 | |
17 | class ZoomEntry : public ui::IntEntry |
18 | , public ui::SliderDelegate { |
19 | public: |
20 | ZoomEntry(); |
21 | |
22 | void setZoom(const render::Zoom& zoom); |
23 | |
24 | obs::signal<void(const render::Zoom&)> ZoomChange; |
25 | |
26 | private: |
27 | // SliderDelegate impl |
28 | std::string onGetTextFromValue(int value) override; |
29 | int onGetValueFromText(const std::string& text) override; |
30 | |
31 | void onValueChange() override; |
32 | |
33 | bool m_locked; |
34 | }; |
35 | |
36 | } // namespace app |
37 | |
38 | #endif |
39 | |