const dvui = @import("dvui");
const WindowContext = @import("../WindowContext.zig");
const menu_bar = @import("menu_bar.zig");
const tab_bar = @import("tab_bar.zig");
const left_panel = @import("left_panel.zig");
const right_panel = @import("right_panel.zig");

pub fn guiFrame(ctx: *WindowContext) bool {
    for (dvui.events()) |*e| {
        if (e.evt == .window and e.evt.window.action == .close) return false;
        if (e.evt == .app and e.evt.app.action == .quit) return false;
    }

    var root = dvui.box(
        @src(),
        .{ .dir = .vertical },
        .{ .expand = .both, .background = true, .style = .window },
    );
    {
        menu_bar.menuBar(ctx);
        tab_bar.tabBar(ctx);

        var content_row = dvui.box(@src(), .{ .dir = .horizontal }, .{ .expand = .both });
        {
            left_panel.leftPanel(ctx);

            right_panel.rightPanel(ctx);
        }
        content_row.deinit();
    }
    root.deinit();

    return true;
}
