ferroui_controls/primitives/
tab_strip_item.rs1use super::TemplatedControlImpl;
2use crate::{ContentControlImpl, ControlImpl, ListBoxItem};
3use ferroui_base::input::{FocusChangedEventArgs, InputElementImpl, InputElementImplExt};
4use ferroui_base::interactivity::InteractiveImpl;
5use ferroui_base::layout::LayoutableImpl;
6use ferroui_base::{
7 ferro_class, ferro_impl_classes, instantiate, FerroObjectImpl, Ref, StyledElementImpl, VisualImpl,
8};
9
10#[repr(C)]
12pub struct TabStripItem {
13 base: ListBoxItem,
14}
15
16ferro_class!(TabStripItem: ListBoxItem);
17ferroui_base::ferro_class_info!(TabStripItem { new: TabStripItem::new });
18ferro_impl_classes!(
19 TabStripItem: FerroObjectImpl,
20 StyledElementImpl,
21 VisualImpl,
22 LayoutableImpl,
23 InteractiveImpl,
24 ControlImpl,
25 TemplatedControlImpl,
26 ContentControlImpl
27);
28
29impl InputElementImpl for TabStripItem {
30 fn on_got_focus(this: &Self, e: &FocusChangedEventArgs) {
31 Self::parent_on_got_focus(this, e);
32 this.update_selection_from_event(e);
33 }
34}
35
36impl TabStripItem {
37 pub fn construct() -> Self {
39 Self { base: ListBoxItem::construct() }
40 }
41
42 pub fn new() -> Ref<Self> {
43 instantiate(Self::construct())
44 }
45}