-
Notifications
You must be signed in to change notification settings - Fork 0
/
xbrowser.kv
143 lines (124 loc) · 2.42 KB
/
xbrowser.kv
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
WindowManager:
EditorPage:
PreviewPage:
<HomePage>:
name: "Home"
GridLayout:
cols: 0
rows: 2
Label:
text: "Logo"
size_hint_y: None
height: 100
GridLayout:
cols: 2
Button:
text: "Open Existing Project"
font_size: "30sp"
on_release:
root.show_load()
Button:
text: "New Project"
font_size: "30sp"
on_release:
app.root.current = "Editor"
<EditorPage>:
name: "Editor"
BoxLayout:
orientation: 'vertical'
Header:
# Editor text input and preview windows
GridLayout:
cols: 2
SplitterRight:
# TODO: load path from directory
FileChooserListView:
id: filechooser
path: "./"
on_submit:
app.chooseFile(selection=filechooser.selection)
TextInput:
id: editor
background_color: (30/255., 30/255., 30/255., 1)
foreground_color: (212/255., 210/255., 208/255., 1)
text: "Select a Text File to get Started"
<PreviewPage>:
name: "Preview"
BoxLayout:
orientation: 'vertical'
Header:
# Browsers in a 2x2 grid
GridLayout:
rows: 2
cols: 2
Image:
source: "screenshots/Safari.png"
keep_ratio: False
allow_stretch: True
Image:
source: "screenshots/Chrome.png"
keep_ratio: False
allow_stretch: True
Image:
source: "screenshots/Firefox.png"
keep_ratio: False
allow_stretch: True
Image:
source: "screenshots/Opera.png"
keep_ratio: False
allow_stretch: True
SplitterTop:
Label:
text: "Browser Console"
<Header>:
cols: 5
size_hint_y: None
height: 50
Label:
text: "Logo"
size_hint_x: None
width: 100
Label:
Button:
text: "Save"
size_hint_x: None
width: 100
on_release:
print("Writing to file...")
app.saveFile()
print("Preview refreshing...")
Button:
text: "Launch Browser"
size_hint_x: None
width: 200
on_release:
print("Preview refreshing...")
on_press: root.generateBrowser()
Button:
text: "Toggle Mode"
size_hint_x: None
width: 200
on_release:
app.toggleMode()
<SplitterRight>:
sizable_from: 'right'
keep_within_parent: True
rescale_with_parent: True
min_size: 0
max_size: 10000
<SplitterTop>:
sizable_from: 'top'
keep_within_parent: True
rescale_with_parent: True
min_size: 0
max_size: 10000
<LoadDialog>:
BoxLayout:
size: root.size
pos: root.pos
orientation: "vertical"
FileChooserListView:
id: filechooser
path: "./"
dirselect: True
on_submit:app.loadDirectory(filechooser.selection)