diff --git a/sysdata/libraries/horizon_api/src/widgets.hb b/sysdata/libraries/horizon_api/src/widgets.hb index 9bf56f7..1fa04b5 100644 --- a/sysdata/libraries/horizon_api/src/widgets.hb +++ b/sysdata/libraries/horizon_api/src/widgets.hb @@ -40,12 +40,18 @@ render_label_to_surface := fn(surface: Surface, label: Label, font: Font, pos: V render.put_text(label.surface, font, .(0, 0), render.white, label.text) } render.put_surface(surface, label.surface, pos, false) - render.sync(surface) } new_label := fn(text: ^u8): Label { - text_surface := render.new_surface(100, 20) + text_surface := render.new_surface(1000, 20) text_length := string.length(text) label := Label.(true, text_surface, text, text_length) return label +} + +VerticalLayout := 0 +HorizontalLayout := 1 + +Container := struct { + layout: uint, } \ No newline at end of file diff --git a/sysdata/programs/horizon/src/main.hb b/sysdata/programs/horizon/src/main.hb index c33882e..ed405bb 100644 --- a/sysdata/programs/horizon/src/main.hb +++ b/sysdata/programs/horizon/src/main.hb @@ -77,6 +77,15 @@ main := fn(): int { // TODO: Get windows out of a collection and iter through render.put_rect(screen, .(0, 0), .(screen.width - 1, screen.height - 1), render.white) + { + // Scroll bar :ThumbsUp: + render.put_rect(screen, .(100, 100), .(100, 10), render.white) + render.put_filled_rect(screen, .(110, 100), .(20, 10), render.white) + + render.put_rect(screen, .(90, 110), .(10, 100), render.white) + render.put_filled_rect(screen, .(90, 120), .(10, 20), render.white) + } + { pos := Vec2(uint).(1, screen.height - 21) render_label_to_surface(screen, text_label, font, pos)