-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.qml
101 lines (85 loc) · 2.08 KB
/
main.qml
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
import QtQuick 2.6
import QtQuick.Window 2.2
import Toou2D 1.0
import "./qml"
Window {
id:rootwindow
visible: true
width: 480
height: 700
/***
* T2DWorld是T2D框架中最重要的配置
***/
T2DWorld{
mouseAreaCursorShape: Qt.PointingHandCursor
appStartupTheme: "Dark"
appThemePaths: [
"qrc:/themes/"
]
}
TRectangle{
width: parent.width;
height: parent.height;
color: "#FFF"
x:menu.isopen ? 90 : 0;
Topbar{
id:topbar;
width: parent.width;
height: 45;
onShowMenu: menu.open();
}
Loader{
id:pageloader;
anchors{
left: parent.left;
right: parent.right;
top: topbar.bottom;
bottom: footerbar.top;
}
source: "qrc:/qml/Home.qml"
function begin(){
menu.open();
}
function toPage(uri,title){
source = uri;
topbar.title = title;
}
}
Menubar{
id:menu
width: 160;
height: rootwindow.height;
onTopage: {
if(title === "Github" || title === "Api docs"){
openurl_dialog.url = uri;
openurl_dialog.open();
}else{
pageloader.toPage(uri,title);
}
}
}
Footerbar{
id:footerbar
width: parent.width;
height: 45;
anchors.bottom: parent.bottom;
}
Behavior on x {
NumberAnimation {
duration: 100
}
}
}
Component.onCompleted: {
TToast.layoutY = 20;
}
TDialog{
id:openurl_dialog
titleText: "是否打开Url连接";
contentText: "前往查看更多详细的内容";
property string url;
onTriggered: {
Qt.openUrlExternally(url);
}
}
}