1
0
Fork 0
forked from AbleOS/ableos

adit: cleanup

This commit is contained in:
Able 2025-02-17 17:24:14 -06:00
parent a30802d1a3
commit 4a0fbafd2d
2 changed files with 11 additions and 3 deletions
sysdata/programs/adit/src

View file

@ -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 {

View file

@ -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)
}
} }