class UI::Widget

Overview

A single widget declaration.

The model is extension-oriented rather than visual. It captures the widget's identity, a short summary, and the surfaces where the widget is expected to appear.

Defined in:

ui/widgets.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(title : String, identifier : String | Nil = nil, summary : String | Nil = nil, placements : Array(WidgetPlacement) | Nil = nil, is_enabled : Bool = true) #

[View source]

Instance Method Detail

def add_placement(surface : String, families : Array(String) | Nil = nil, timeline_intent : String = "snapshot", refresh_policy : String | Nil = nil, notes : String | Nil = nil, &block : WidgetPlacement -> Nil) : WidgetPlacement #

[View source]
def add_placement(surface : String, families : Array(String) | Nil = nil, timeline_intent : String = "snapshot", refresh_policy : String | Nil = nil, notes : String | Nil = nil) : WidgetPlacement #

[View source]
def add_placement(placement : WidgetPlacement) : WidgetPlacement #

[View source]
def export_widgetkit_scaffold(indent : String = " ") : String #

[View source]
def identifier : String #

[View source]
def identifier=(identifier : String) #

[View source]
def is_enabled : Bool #

[View source]
def is_enabled=(is_enabled : Bool) #

[View source]
def placements : Array(WidgetPlacement) #

[View source]
def placements=(placements : Array(WidgetPlacement)) #

[View source]
def summary : String | Nil #

[View source]
def summary=(summary : String | Nil) #

[View source]
def title : String #

[View source]
def title=(title : String) #

[View source]
def to_payload(json : JSON::Builder) : Nil #

[View source]
def widgetkit_entry_name : String #

[View source]
def widgetkit_provider_name : String #

[View source]
def widgetkit_struct_name : String #

[View source]
def widgetkit_supported_families : Array(String) #

[View source]
def widgetkit_view_name : String #

[View source]