Skip to content

Commit 9e415ea

Browse files
committed
run v fmt -w . with latest v
1 parent 1e79ed0 commit 9e415ea

File tree

179 files changed

+3139
-3151
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

179 files changed

+3139
-3151
lines changed

apps/editor/editor.v

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ pub fn (mut app AppUI) make_layout() {
4040
dirs = dirs.map(os.real_path(it))
4141
app.line_numbers = true
4242
app.layout = ui.row(
43-
id: ui.id(app.id, 'layout')
44-
widths: [ui.stretch, ui.stretch * 2]
43+
id: ui.id(app.id, 'layout')
44+
widths: [ui.stretch, ui.stretch * 2]
4545
children: [
4646
uic.hideable_stack(
47-
id: ui.id(app.id, 'hmenu')
47+
id: ui.id(app.id, 'hmenu')
4848
layout: uic.menufile_stack(
49-
id: ui.id(app.id, 'menu')
50-
dirs: dirs
49+
id: ui.id(app.id, 'menu')
50+
dirs: dirs
5151
on_file_changed: fn [mut app] (mut mf uic.MenuFileComponent) {
5252
mf.layout.ui.window.set_title('V UI Edit: ${mf.file}')
5353
// reinit textbox scrollview
@@ -65,11 +65,11 @@ pub fn (mut app AppUI) make_layout() {
6565
}
6666
tb.tv.sh.set_lang(os.file_ext(mf.file))
6767
}
68-
on_new: fn (mf &uic.MenuFileComponent) {
68+
on_new: fn (mf &uic.MenuFileComponent) {
6969
// println("new $mf.file!!!")
7070
os.write_file(mf.file, '') or {}
7171
}
72-
on_save: fn (mf &uic.MenuFileComponent) {
72+
on_save: fn (mf &uic.MenuFileComponent) {
7373
// println("save $mf.file")
7474
tb := mf.layout.ui.window.get_or_panic[ui.TextBox]('edit')
7575
// println("text: <${*tb.text}>")
@@ -78,14 +78,14 @@ pub fn (mut app AppUI) make_layout() {
7878
)
7979
),
8080
ui.textbox(
81-
mode: .multiline
82-
id: 'edit'
83-
z_index: 20
84-
height: 200
81+
mode: .multiline
82+
id: 'edit'
83+
z_index: 20
84+
height: 200
8585
line_height_factor: 1.0 // double the line_height
86-
text_size: 24
87-
text_font_name: 'fixed'
88-
bg_color: gx.hex(0xfcf4e4ff) // gx.rgb(252, 244, 228)
86+
text_size: 24
87+
text_font_name: 'fixed'
88+
bg_color: gx.hex(0xfcf4e4ff) // gx.rgb(252, 244, 228)
8989
),
9090
]
9191
)

apps/explorer/events.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub mut:
2121

2222
pub fn new(p AppEventsParams) &AppEvents {
2323
mut app := &AppEvents{
24-
id: p.id
24+
id: p.id
2525
users: p.users
2626
}
2727
app.make_layout()

apps/users/users.v

Lines changed: 73 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -42,22 +42,22 @@ pub mut:
4242
users []User = [
4343
User{
4444
first_name: 'Sam'
45-
last_name: 'Johnson'
46-
age: 29
47-
country: 'United States'
45+
last_name: 'Johnson'
46+
age: 29
47+
country: 'United States'
4848
},
4949
User{
5050
first_name: 'Kate'
51-
last_name: 'Williams'
52-
age: 26
53-
country: 'Canada'
51+
last_name: 'Williams'
52+
age: 26
53+
country: 'Canada'
5454
},
5555
]
5656
}
5757

5858
pub fn new(p AppUIParams) &AppUI {
5959
mut app := &AppUI{
60-
id: p.id
60+
id: p.id
6161
users: p.users
6262
}
6363
app.make_layout()
@@ -75,96 +75,96 @@ pub fn (mut app AppUI) make_layout() {
7575
logo = 'img/logo.png'
7676
}
7777
app.country = ui.radio(
78-
width: 200
78+
width: 200
7979
values: ['United States', 'Canada', 'United Kingdom', 'Australia']
80-
title: 'Country'
80+
title: 'Country'
8181
)
8282
app.pbar = ui.progressbar(
8383
width: 170
84-
max: 10
85-
val: 2
84+
max: 10
85+
val: 2
8686
// theme: "red"
8787
)
8888
app.label = ui.label(id: 'counter', text: '2/10', text_font_name: 'fixed_bold_italic')
8989
app.layout = ui.row(
90-
id: ui.id(app.id, 'layout')
90+
id: ui.id(app.id, 'layout')
9191
bg_color: gx.white
92-
margin_: .02
93-
spacing: .02
94-
widths: [ui.compact, ui.stretch] // 1.0 == .64 + .3 + .02 + 2 * .02
92+
margin_: .02
93+
spacing: .02
94+
widths: [ui.compact, ui.stretch] // 1.0 == .64 + .3 + .02 + 2 * .02
9595
children: [
9696
ui.column(
97-
spacing: 10
98-
widths: ui.compact
99-
heights: ui.compact
97+
spacing: 10
98+
widths: ui.compact
99+
heights: ui.compact
100100
scrollview: true
101-
children: [
101+
children: [
102102
ui.textbox(
103-
max_len: 20
104-
width: 200
103+
max_len: 20
104+
width: 200
105105
placeholder: 'First name'
106-
text: &app.first_name
106+
text: &app.first_name
107107
// is_focused: &app.started
108-
is_error: &app.is_error
108+
is_error: &app.is_error
109109
is_focused: true
110110
),
111111
ui.textbox(
112-
max_len: 50
113-
width: 200
112+
max_len: 50
113+
width: 200
114114
placeholder: 'Last name'
115-
text: &app.last_name
116-
is_error: &app.is_error
115+
text: &app.last_name
116+
is_error: &app.is_error
117117
),
118118
ui.textbox(
119-
max_len: 3
120-
width: 200
119+
max_len: 3
120+
width: 200
121121
placeholder: 'Age'
122-
is_numeric: true
123-
text: &app.age
124-
is_error: &app.is_error
122+
is_numeric: true
123+
text: &app.age
124+
is_error: &app.is_error
125125
),
126126
ui.textbox(
127-
width: 200
127+
width: 200
128128
placeholder: 'Password'
129129
is_password: true
130-
max_len: 20
131-
text: &app.password
130+
max_len: 20
131+
text: &app.password
132132
),
133133
ui.checkbox(
134134
checked: true
135-
text: 'Online registration'
135+
text: 'Online registration'
136136
),
137137
ui.checkbox(text: 'Subscribe to the newsletter'),
138138
app.country,
139139
ui.row(
140-
id: 'btn_row'
141-
widths: ui.compact
142-
heights: 20.0
143-
spacing: 80
140+
id: 'btn_row'
141+
widths: ui.compact
142+
heights: 20.0
143+
spacing: 80
144144
children: [
145145
ui.button(
146-
width: 60
147-
text: 'Add user'
148-
tooltip: 'Required fields:\n * First name\n * Last name\n * Age'
146+
width: 60
147+
text: 'Add user'
148+
tooltip: 'Required fields:\n * First name\n * Last name\n * Age'
149149
on_click: app.btn_add_click
150-
radius: .0
150+
radius: .0
151151
),
152152
ui.button(
153-
width: 40
154-
tooltip: 'about'
155-
text: '?'
153+
width: 40
154+
tooltip: 'about'
155+
text: '?'
156156
on_click: btn_help_click
157-
radius: .3
157+
radius: .3
158158
),
159159
]
160160
),
161161
ui.row(
162-
spacing: 10
163-
widths: [
162+
spacing: 10
163+
widths: [
164164
150.0,
165165
40,
166166
]
167-
heights: ui.compact
167+
heights: ui.compact
168168
children: [
169169
app.pbar,
170170
app.label,
@@ -178,32 +178,32 @@ pub fn (mut app AppUI) make_layout() {
178178
center: [
179179
0,
180180
]
181-
right: [
181+
right: [
182182
1,
183183
]
184184
}
185-
widths: [
185+
widths: [
186186
ui.stretch,
187187
ui.compact,
188188
]
189-
heights: [
189+
heights: [
190190
ui.stretch,
191191
ui.compact,
192192
]
193-
children: [
193+
children: [
194194
ui.canvas_plus(
195-
width: 400
196-
height: 275
197-
on_draw: app.draw
198-
bg_color: gx.Color{255, 220, 220, 150}
195+
width: 400
196+
height: 275
197+
on_draw: app.draw
198+
bg_color: gx.Color{255, 220, 220, 150}
199199
bg_radius: 10
200200
// text_size: 20
201201
),
202202
ui.picture(
203-
id: 'logo'
204-
width: 50
203+
id: 'logo'
204+
width: 50
205205
height: 50
206-
path: logo
206+
path: logo
207207
),
208208
]
209209
),
@@ -234,9 +234,9 @@ fn (mut app AppUI) btn_add_click(b &ui.Button) {
234234
}
235235
new_user := User{
236236
first_name: app.first_name // first_name.text
237-
last_name: app.last_name // .text
238-
age: app.age.int()
239-
country: app.country.selected_value()
237+
last_name: app.last_name // .text
238+
age: app.age.int()
239+
country: app.country.selected_value()
240240
}
241241
app.users << new_user
242242
app.pbar.val++
@@ -252,21 +252,17 @@ fn (mut app AppUI) btn_add_click(b &ui.Button) {
252252
fn (app &AppUI) draw(mut d ui.DrawDevice, c &ui.CanvasLayout) {
253253
marginx, marginy := 20, 20
254254
for i, user in app.users {
255-
y := marginy + i * users.cell_height
255+
y := marginy + i * cell_height
256256
// Outer border
257-
c.draw_device_rect_empty(d, marginx, y, users.table_width, users.cell_height,
258-
gx.gray)
257+
c.draw_device_rect_empty(d, marginx, y, table_width, cell_height, gx.gray)
259258
// Vertical separators
260-
c.draw_device_line(d, users.cell_width, y, users.cell_width, y + users.cell_height,
261-
gx.gray)
262-
c.draw_device_line(d, users.cell_width * 2, y, users.cell_width * 2, y + users.cell_height,
263-
gx.gray)
264-
c.draw_device_line(d, users.cell_width * 3, y, users.cell_width * 3, y + users.cell_height,
265-
gx.gray)
259+
c.draw_device_line(d, cell_width, y, cell_width, y + cell_height, gx.gray)
260+
c.draw_device_line(d, cell_width * 2, y, cell_width * 2, y + cell_height, gx.gray)
261+
c.draw_device_line(d, cell_width * 3, y, cell_width * 3, y + cell_height, gx.gray)
266262
// Text values
267263
c.draw_device_text(d, marginx + 5, y + 5, user.first_name)
268-
c.draw_device_text(d, marginx + 5 + users.cell_width, y + 5, user.last_name)
269-
c.draw_device_text(d, marginx + 5 + users.cell_width * 2, y + 5, user.age.str())
270-
c.draw_device_text(d, marginx + 5 + users.cell_width * 3, y + 5, user.country)
264+
c.draw_device_text(d, marginx + 5 + cell_width, y + 5, user.last_name)
265+
c.draw_device_text(d, marginx + 5 + cell_width * 2, y + 5, user.age.str())
266+
c.draw_device_text(d, marginx + 5 + cell_width * 3, y + 5, user.country)
271267
}
272268
}

0 commit comments

Comments
 (0)