forked from AbleOS/ableos
adit: cleanup
This commit is contained in:
parent
a30802d1a3
commit
4a0fbafd2d
|
@ -27,11 +27,11 @@ Editor := struct {
|
||||||
stn.log.error("got no window")
|
stn.log.error("got no window")
|
||||||
die
|
die
|
||||||
}
|
}
|
||||||
return Self.(null, assets.Assets.new() true, .(.(0x88, 0xF4, 0xFC, 0x0), render.YELLOW, render.BLACK, 10), window)
|
return Self.(null, assets.Assets.new() true, theme.Theme.new(), window)
|
||||||
}
|
}
|
||||||
|
|
||||||
clear := fn(self:Self):void{
|
clear := fn(self:Self):void{
|
||||||
self.window.surface.clear(self.theme.bg_color)
|
// self.window.surface.clear(self.theme.bg_color)
|
||||||
}
|
}
|
||||||
|
|
||||||
frame_sync := fn(self: Self):void {
|
frame_sync := fn(self: Self):void {
|
||||||
|
@ -48,10 +48,12 @@ Editor := struct {
|
||||||
loop {
|
loop {
|
||||||
defer line += 1
|
defer line += 1
|
||||||
if line == line_end break
|
if line == line_end break
|
||||||
// TODO: Handle line text lining up
|
|
||||||
self.window.surface.put_hline(20 * line, 10, window_width - self.theme.padding, self.theme.bg_line_color)
|
self.window.surface.put_hline(20 * line, 10, window_width - self.theme.padding, self.theme.bg_line_color)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if self.theme.padding_line {
|
||||||
|
self.window.surface.put_vline(10, 20, 20 * line_end -20, self.theme.fg_padding_line_color)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
frame_render := fn(self: Self): void {
|
frame_render := fn(self: Self): void {
|
||||||
|
|
|
@ -4,5 +4,11 @@ Theme := struct {
|
||||||
bg_color: render.Color = render.Color.(0x88, 0xF4, 0xFC, 0x0),
|
bg_color: render.Color = render.Color.(0x88, 0xF4, 0xFC, 0x0),
|
||||||
bg_line_color: render.Color = render.YELLOW,
|
bg_line_color: render.Color = render.YELLOW,
|
||||||
fg_text_color: render.Color = render.BLACK,
|
fg_text_color: render.Color = render.BLACK,
|
||||||
|
fg_padding_line_color: render.Color = render.RED,
|
||||||
padding: uint = 10,
|
padding: uint = 10,
|
||||||
|
padding_line: bool= true,
|
||||||
|
|
||||||
|
new := fn():Self{
|
||||||
|
return Self.(.(0x88, 0xF4, 0xFC, 0x0), render.YELLOW, render.BLACK, render.RED, 10, true)
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue