pub struct ComboBox<'ui, Label, Preview = &'static str> {
pub label: Label,
pub preview_value: Option<Preview>,
pub flags: ComboBoxFlags,
pub ui: &'ui Ui,
}
Expand description
Builder for a combo box widget
Fields§
§label: Label
§preview_value: Option<Preview>
§flags: ComboBoxFlags
§ui: &'ui Ui
Implementations§
source§impl<'ui, T: AsRef<str>, Preview: AsRef<str>> ComboBox<'ui, T, Preview>
impl<'ui, T: AsRef<str>, Preview: AsRef<str>> ComboBox<'ui, T, Preview>
pub fn preview_value<Preview2: AsRef<str>>( self, preview_value: Preview2 ) -> ComboBox<'ui, T, Preview2>
sourcepub fn flags(self, flags: ComboBoxFlags) -> Self
pub fn flags(self, flags: ComboBoxFlags) -> Self
Replaces all current settings with the given flags.
sourcepub fn popup_align_left(self, popup_align_left: bool) -> Self
pub fn popup_align_left(self, popup_align_left: bool) -> Self
Enables/disables aligning the combo box popup toward the left.
Disabled by default.
sourcepub fn height(self, height: ComboBoxHeight) -> Self
pub fn height(self, height: ComboBoxHeight) -> Self
Sets the combo box height.
Default: ComboBoxHeight::Regular
sourcepub fn preview_mode(self, preview_mode: ComboBoxPreviewMode) -> Self
pub fn preview_mode(self, preview_mode: ComboBoxPreviewMode) -> Self
Sets the combo box preview mode.
Default: ComboBoxPreviewMode::Full
sourcepub fn begin(self) -> Option<ComboBoxToken<'ui>>
pub fn begin(self) -> Option<ComboBoxToken<'ui>>
Creates a combo box and starts appending to it.
Returns Some(ComboBoxToken)
if the combo box is open. After content has been
rendered, the token must be ended by calling .end()
.
Returns None
if the combo box is not open and no content should be rendered.