DVUI

Parameters

#
self:*FloatingWindowWidget
*FloatingWindowWidget

Source

Implementation

#
pub fn drawBackground(self: *FloatingWindowWidget) void {
    if (self.init_options.modal and !dvui.firstFrame(self.data().id)) {
        // paint over everything below
        var col = self.options.color(.text);
        col.a = self.init_options.modal_alpha orelse (if (dvui.themeGet().dark) 60 else 80);
        dvui.windowRectPixels().fill(.{}, .{ .color = col });
    }

    // we are using BoxWidget to do border/background
    self.layout = @as(BoxWidget, undefined);
    self.layout.?.init(@src(), .{ .dir = .vertical }, self.options.override(.{ .expand = .both, .name = "Box" }));
    self.layout.?.drawBackground();
}