RelocatableState

Trait RelocatableState 

Source
pub trait RelocatableState {
    // Required method
    fn relocate(&mut self, shift: (i16, i16), clip: Rect);

    // Provided method
    fn relocate_hidden(&mut self) { ... }
}
Expand description

Widgets can be rendered to a temporary Buffer that will be dumped to the main render Buffer at a later point.

This temporary Buffer can have its own coordinate system and output in the main render Buffer can happen anywhere.

Most rat-widgets store one or more areas during rendering for later mouse interactions. All these areas need to be adjusted whenever such a temporary Buffer is used.

This trait provides the entry point for such an adjustment.

Required Methods§

Source

fn relocate(&mut self, shift: (i16, i16), clip: Rect)

Relocate the areas in this widgets state.

  • shift: positions are moved by (x,y)
  • clip: areas must be clipped to the given Rect.

Provided Methods§

Source

fn relocate_hidden(&mut self)

Relocate all areas to a clip-rect (0,0+0x0).

Implementations on Foreign Types§

Source§

impl RelocatableState for ()

Source§

fn relocate(&mut self, _shift: (i16, i16), _clip: Rect)

Source§

impl RelocatableState for Rect

Source§

fn relocate(&mut self, shift: (i16, i16), clip: Rect)

Source§

impl RelocatableState for [Rect]

Source§

fn relocate(&mut self, shift: (i16, i16), clip: Rect)

Implementors§

Source§

impl RelocatableState for ButtonState

Source§

impl RelocatableState for CheckboxState

Source§

impl RelocatableState for ColorInputState

Source§

impl RelocatableState for ComboboxState

Source§

impl RelocatableState for DateInputState

Source§

impl RelocatableState for NumberInputState

Source§

impl RelocatableState for ParagraphState

Source§

impl RelocatableState for PopupCoreState

Source§

impl RelocatableState for ScrollState

Source§

impl RelocatableState for SplitState

Source§

impl RelocatableState for StatusLineState

Source§

impl RelocatableState for TabbedState

Source§

impl RelocatableState for TextInputState

Source§

impl RelocatableState for MaskedInputState

Source§

impl RelocatableState for TextAreaState

Source§

impl<S> RelocatableState for EditListState<S>

Source§

impl<S> RelocatableState for EditableTableState<S>

Source§

impl<S> RelocatableState for EditableTableVecState<S>

Source§

impl<Selection> RelocatableState for MonthState<Selection>

Source§

impl<Selection> RelocatableState for ListState<Selection>

Source§

impl<Selection> RelocatableState for TableState<Selection>

Source§

impl<T> RelocatableState for ChoiceState<T>
where T: PartialEq + Clone + Default,

Source§

impl<T> RelocatableState for RadioState<T>
where T: PartialEq + Clone + Default,

Source§

impl<T> RelocatableState for SliderState<T>
where T: RangeOp<Step: Copy + Debug> + MapRange<u16> + Debug + Default + Copy + PartialEq, u16: MapRange<T>,

Source§

impl<TS, US> RelocatableState for PairedState<'_, TS, US>

Source§

impl<const N: usize, Selection> RelocatableState for CalendarState<N, Selection>