blob: 0c78ef25a2b210f7a54843c1d307e4ad851541c1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
#include "MainWindow.h"
#include "cru/ui/Base.h"
#include "cru/ui/controls/StackLayout.h"
#include "cru/ui/controls/TextBlock.h"
namespace cru::theme_builder::components {
using namespace cru::ui;
using namespace cru::ui::controls;
using namespace cru::platform::gui;
MainWindow::MainWindow() {
window_.GetNativeWindow()->SetTitle(u"CruUI Theme Builder");
main_layout_.SetFlexDirection(FlexDirection::Horizontal);
window_.AddChild(&main_layout_);
main_layout_.AddChild(&preview_layout_);
preview_button_text_.SetText(u"Preview");
preview_button_.SetChild(&preview_button_text_);
preview_layout_.AddChild(&preview_button_);
preview_layout_.SetChildLayoutData(
0, StackChildLayoutData{Alignment::Center, Alignment::Center});
style_rule_set_editor_.BindStyleRuleSet(
preview_button_.GetStyleRuleSet()->GetParent());
main_layout_.AddChild(style_rule_set_editor_.GetRootControl());
main_layout_.SetChildLayoutData(0, {1, 0});
main_layout_.SetChildLayoutData(1, {0, 1});
}
MainWindow::~MainWindow() {}
void MainWindow::Show() {
window_.GetNativeWindow()->SetVisibility(WindowVisibilityType::Show);
window_.GetNativeWindow()->SetToForeground();
}
} // namespace cru::theme_builder::components
|