forked from hchenqi/ViewDesign
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBackground.cpp
More file actions
29 lines (26 loc) · 716 Bytes
/
Copy pathBackground.cpp
File metadata and controls
29 lines (26 loc) · 716 Bytes
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
#include <ViewDesign/view/widget/DefaultWindow.h>
#include <ViewDesign/view/frame/CenterFrame.h>
#include <ViewDesign/view/frame/BackgroundFrame.h>
#include <ViewDesign/view/control/TextView.h>
#include <ViewDesign/view/wrapper/Background.h>
using namespace ViewDesign;
struct TextViewStyle : TextView::Style {
TextViewStyle() {
font.size(75.0f).color(ColorCode::Black);
}
};
void App() {
desktop.AddWindow(
create<DefaultBackground<DefaultWindow>>(
DefaultWindow::Style(),
u"HelloWorld",
create<CenterFrame<Fixed, Fixed>>(
create<BackgroundFrame<Bounded, Bounded>>(
ColorCode::LightPink,
create<TextView>(TextViewStyle(), u"Hello World!")
)
)
)
);
desktop.EventLoop();
}