DVUI

Combine

Allow two CellStyles to be used together. Returns the result of style1.override(style2) for cellOptions() and options()

Parameters

#
T1:type
type
T2:type
type

Functions

#

Source

Implementation

#
pub fn Combine(T1: type, T2: type) type {
    return struct {
        const Self = @This();
        style1: T1,
        style2: T2,

        pub fn init(style1: T1, style2: T2) Self {
            return .{ .style1 = style1, .style2 = style2 };
        }

        pub fn cellOptions(self: Self, cell: Cell) CellOptions {
            return self.style1.cellOptions(cell).override(self.style2.cellOptions(cell));
        }

        pub fn options(self: Self, cell: Cell) Options {
            return self.style1.options(cell).override(self.style2.options(cell));
        }
    };
}