DVUI

style

Returns an Options struct with color/style overrides for the hover and press state

Parameters

#
self:*ButtonWidget
*ButtonWidget

Source

Implementation

#
pub fn style(self: *ButtonWidget) Options {
    var opts = self.data().options.styleOnly();
    if (dvui.captured(self.data().id)) {
        opts.color_fill = self.data().options.color(.fill_press);
        opts.color_text = self.data().options.color(.text_press);
    } else if (self.hover) {
        opts.color_fill = self.data().options.color(.fill_hover);
        opts.color_text = self.data().options.color(.text_hover);
    }
    return opts;
}