diff options
| author | crupest <crupest@outlook.com> | 2022-01-29 21:07:48 +0800 |
|---|---|---|
| committer | crupest <crupest@outlook.com> | 2022-01-29 21:07:48 +0800 |
| commit | 30060773b06d93ae08a8c6fa5836c81e595594ed (patch) | |
| tree | f333e807eef86442eff0b489bb2460bfbf99e794 /src/theme_builder/components | |
| parent | 90261a333f251cc241f186f0ee6ed8e12787cc02 (diff) | |
| download | cru-30060773b06d93ae08a8c6fa5836c81e595594ed.tar.gz cru-30060773b06d93ae08a8c6fa5836c81e595594ed.tar.bz2 cru-30060773b06d93ae08a8c6fa5836c81e595594ed.zip | |
...
Diffstat (limited to 'src/theme_builder/components')
| -rw-r--r-- | src/theme_builder/components/MainWindow.cpp | 19 | ||||
| -rw-r--r-- | src/theme_builder/components/MainWindow.hpp | 22 |
2 files changed, 41 insertions, 0 deletions
diff --git a/src/theme_builder/components/MainWindow.cpp b/src/theme_builder/components/MainWindow.cpp new file mode 100644 index 00000000..3d521d44 --- /dev/null +++ b/src/theme_builder/components/MainWindow.cpp @@ -0,0 +1,19 @@ +#include "MainWindow.hpp" + +namespace cru::theme_builder { +using namespace cru::ui; +using namespace cru::ui::controls; +using namespace cru::platform::gui; + +MainWindow::MainWindow() { + window_ = Window::Create(); + window_->GetNativeWindow()->SetTitle(u"CruUI Theme Builder"); +} + +MainWindow::~MainWindow() { delete window_; } + +void MainWindow::Show() { + window_->GetNativeWindow()->SetVisibility(WindowVisibilityType::Show); + window_->GetNativeWindow()->SetToForeground(); +} +} // namespace cru::theme_builder diff --git a/src/theme_builder/components/MainWindow.hpp b/src/theme_builder/components/MainWindow.hpp new file mode 100644 index 00000000..fd7f7996 --- /dev/null +++ b/src/theme_builder/components/MainWindow.hpp @@ -0,0 +1,22 @@ +#pragma once +#include "cru/ui/components/Component.hpp" +#include "cru/ui/controls/Window.hpp" + +namespace cru::theme_builder { +class MainWindow : public ui::components::Component { + public: + MainWindow(); + + CRU_DELETE_COPY(MainWindow) + CRU_DELETE_MOVE(MainWindow) + + ~MainWindow() override; + + ui::controls::Control* GetRootControl() override { return window_; } + + void Show(); + + private: + ui::controls::Window* window_; +}; +} // namespace cru::theme_builder |
