class
UI::RatingIndicator
- UI::RatingIndicator
- UI::View
- Reference
- Object
Overview
A horizontal row of star symbols communicating a ranking level.
On macOS the renderer uses NSLevelIndicator with NSLevelIndicatorStyleRating (style constant 4), which produces the native star-row control identical to the one shown in the HIG illustration. On iOS there is no NSLevelIndicator equivalent; the UIKit renderer synthesises a UIStackView of UIImageView instances carrying SF Symbol names "star.fill" (for filled positions) and "star" (for empty positions), tinted with the resolved tint color.
HIG: "A rating indicator uses a series of horizontally arranged graphical symbols — by default, stars — to communicate a ranking level." — Rating indicators, abstract.
HIG: "A rating indicator doesn't display partial symbols; it rounds the value to display complete symbols only." — Rating indicators, abstract.
Defined in:
ui/views/rating_indicator.crConstructors
Instance Method Summary
-
#accept(visitor : PlatformVisitor)
Accept a platform visitor for rendering dispatch.
-
#max : Int32
Maximum number of stars (and the upper bound of the rating scale).
-
#max=(max : Int32)
Maximum number of stars (and the upper bound of the rating scale).
-
#tint_color : Color | Nil
Tint color for star symbols.
-
#tint_color=(tint_color : Color | Nil)
Tint color for star symbols.
-
#value : Float64
Current rating value.
-
#value=(value : Float64)
Current rating value.
Instance methods inherited from class UI::View
accept(visitor : PlatformVisitor)
accept,
accessibility_label : String | Nil
accessibility_label,
accessibility_label=(accessibility_label : String | Nil)
accessibility_label=,
background : Color | Nil
background,
background=(background : Color | Nil)
background=,
blur_radius : Float64
blur_radius,
blur_radius=(blur_radius : Float64)
blur_radius=,
border_color : Color | Nil
border_color,
border_color=(border_color : Color | Nil)
border_color=,
border_width : Float64
border_width,
border_width=(border_width : Float64)
border_width=,
clip_to_bounds : Bool
clip_to_bounds,
clip_to_bounds=(clip_to_bounds : Bool)
clip_to_bounds=,
container_query(name : String) : self
container_query,
container_query_name : String | Nil
container_query_name,
container_query_name=(container_query_name : String | Nil)
container_query_name=,
corner_radius : Float64
corner_radius,
corner_radius=(corner_radius : Float64)
corner_radius=,
fill_screen! : self
fill_screen!,
fluid_height(min : String | Number, ideal : String | Number, max : String | Number) : selffluid_height : UI::Fluid | Nil fluid_height, fluid_height=(fluid_height : UI::Fluid | Nil) fluid_height=, fluid_width(min : String | Number, ideal : String | Number, max : String | Number) : self
fluid_width : UI::Fluid | Nil fluid_width, fluid_width=(fluid_width : UI::Fluid | Nil) fluid_width=, hidden : Bool hidden, hidden=(hidden : Bool) hidden=, id : String | Nil id, id=(id : String | Nil) id=, maximum_height : Float64 | Nil maximum_height, maximum_height=(maximum_height : Float64 | Nil) maximum_height=, maximum_width : Float64 | Nil maximum_width, maximum_width=(maximum_width : Float64 | Nil) maximum_width=, minimum_height : Float64 | Nil minimum_height, minimum_height=(minimum_height : Float64 | Nil) minimum_height=, minimum_width : Float64 | Nil minimum_width, minimum_width=(minimum_width : Float64 | Nil) minimum_width=, opacity : Float64 opacity, opacity=(opacity : Float64) opacity=, padding : EdgeInsets padding, padding=(padding : EdgeInsets) padding=, root_fill : Bool root_fill, root_fill=(root_fill : Bool) root_fill=, shadow_color : Color | Nil shadow_color, shadow_color=(shadow_color : Color | Nil) shadow_color=, shadow_offset_x : Float64 shadow_offset_x, shadow_offset_x=(shadow_offset_x : Float64) shadow_offset_x=, shadow_offset_y : Float64 shadow_offset_y, shadow_offset_y=(shadow_offset_y : Float64) shadow_offset_y=, shadow_radius : Float64 shadow_radius, shadow_radius=(shadow_radius : Float64) shadow_radius=, swiftkit_state_handle : Pointer(Void) | Nil swiftkit_state_handle, swiftkit_state_handle=(swiftkit_state_handle : Pointer(Void) | Nil) swiftkit_state_handle=, test_id : String | Nil test_id, test_id=(test_id : String | Nil) test_id=
Constructor Detail
Instance Method Detail
Accept a platform visitor for rendering dispatch.
Each concrete view type calls visitor.visit(self).
Maximum number of stars (and the upper bound of the rating scale). Defaults to 5, matching the App Store and Music rating convention.
Maximum number of stars (and the upper bound of the rating scale). Defaults to 5, matching the App Store and Music rating convention.
Tint color for star symbols. When nil the renderer uses the system yellow/orange (NSColor.systemYellowColor on macOS, UIColor.systemYellowColor on iOS) which is the HIG default for rating stars.
Tint color for star symbols. When nil the renderer uses the system yellow/orange (NSColor.systemYellowColor on macOS, UIColor.systemYellowColor on iOS) which is the HIG default for rating stars.
Current rating value. Clamped to 0..max at render time. Fractional values are rounded to the nearest integer star.
Current rating value. Clamped to 0..max at render time. Fractional values are rounded to the nearest integer star.