Document ui crate traits

This commit is contained in:
Nate Butler 2024-01-09 14:15:25 -05:00
parent 46065c2621
commit e020d7ca11
7 changed files with 21 additions and 5 deletions

View file

@ -4,10 +4,12 @@ use smallvec::SmallVec;
use crate::prelude::*;
/// A trait for buttons that can be Selected. Enables setting the [ButtonStyle] of a button when it is selected.
pub trait SelectableButton: Selectable {
fn selected_style(self, style: ButtonStyle) -> Self;
}
/// A common set of traits all buttons must implement.
pub trait ButtonCommon: Clickable + Disableable {
/// A unique element ID to identify the button.
fn id(&self) -> &ElementId;