pub struct RatingStars { /* private fields */ }Expand description
Five stars (see the module).
Need (input): a star rating.
Implementations§
Source§impl RatingStars
impl RatingStars
pub fn new(value: u8) -> RatingStars
Sourcepub fn label(self, label: impl Into<String>) -> RatingStars
pub fn label(self, label: impl Into<String>) -> RatingStars
Its accessible name (“Rating” by default); a read-only rating is named by its value (“3 of 5”).
Sourcepub fn size(self, size: f32) -> RatingStars
pub fn size(self, size: f32) -> RatingStars
One star’s size in points (default: the inline icon size, at least 12, plus 4).
Sourcepub fn read_only(self, read_only: bool) -> RatingStars
pub fn read_only(self, read_only: bool) -> RatingStars
Shown, not edited: no preview, no click, no focus, drawn by the
kit’s rating-star-display. A disabled Ui gives the same.
Sourcepub fn empty(self, empty: EmptyStars) -> RatingStars
pub fn empty(self, empty: EmptyStars) -> RatingStars
When empty stars show (EmptyStars::Always by default).
Sourcepub fn item_hovered(self, hovered: bool) -> RatingStars
pub fn item_hovered(self, hovered: bool) -> RatingStars
Whether the item the stars rate is under the pointer (a
thumbnail’s cell), for EmptyStars::OnHover.
Sourcepub fn focusable(self, focusable: bool) -> RatingStars
pub fn focusable(self, focusable: bool) -> RatingStars
Whether the stars take the keyboard focus (true by default): 0 to 5 set the rating, the arrows step it, Home and End go to the ends. A view with its own keys (a thumbnail grid) turns it off.
Sourcepub fn id(self, id: Id) -> RatingStars
pub fn id(self, id: Id) -> RatingStars
The id of the stars’ row, for RatingStars::show_at (default:
the Ui’s next automatic id).
Sourcepub fn show(self, ui: &mut Ui) -> RatingResponse
pub fn show(self, ui: &mut Ui) -> RatingResponse
Lays the stars out in ui, one star’s size high.
Sourcepub fn show_at(self, ui: &mut Ui, rect: Rect) -> RatingResponse
pub fn show_at(self, ui: &mut Ui, rect: Rect) -> RatingResponse
Puts the stars in rect (laid out by the caller: an overlay),
five equal slots across it.
Trait Implementations§
Source§impl Clone for RatingStars
impl Clone for RatingStars
Source§fn clone(&self) -> RatingStars
fn clone(&self) -> RatingStars
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for RatingStars
impl RefUnwindSafe for RatingStars
impl Send for RatingStars
impl Sync for RatingStars
impl Unpin for RatingStars
impl UnsafeUnpin for RatingStars
impl UnwindSafe for RatingStars
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more