Make members of Response public, but hide documentation

Discourage their direct use, but allow it
This commit is contained in:
Emil Ernerfeldt 2022-04-30 15:49:50 +02:00
parent c869f67066
commit b137f16472

View file

@ -34,40 +34,50 @@ pub struct Response {
/// Was the widget enabled? /// Was the widget enabled?
/// If `false`, there was no interaction attempted (not even hover). /// If `false`, there was no interaction attempted (not even hover).
pub(crate) enabled: bool, #[doc(hidden)]
pub enabled: bool,
// OUT: // OUT:
/// The pointer is hovering above this widget or the widget was clicked/tapped this frame. /// The pointer is hovering above this widget or the widget was clicked/tapped this frame.
pub(crate) hovered: bool, #[doc(hidden)]
pub hovered: bool,
/// The pointer clicked this thing this frame. /// The pointer clicked this thing this frame.
pub(crate) clicked: [bool; NUM_POINTER_BUTTONS], #[doc(hidden)]
pub clicked: [bool; NUM_POINTER_BUTTONS],
// TODO: `released` for sliders // TODO: `released` for sliders
/// The thing was double-clicked. /// The thing was double-clicked.
pub(crate) double_clicked: [bool; NUM_POINTER_BUTTONS], #[doc(hidden)]
pub double_clicked: [bool; NUM_POINTER_BUTTONS],
/// The thing was triple-clicked. /// The thing was triple-clicked.
pub(crate) triple_clicked: [bool; NUM_POINTER_BUTTONS], pub(crate) triple_clicked: [bool; NUM_POINTER_BUTTONS],
/// The widgets is being dragged /// The widgets is being dragged
pub(crate) dragged: bool, #[doc(hidden)]
pub dragged: bool,
/// The widget was being dragged, but now it has been released. /// The widget was being dragged, but now it has been released.
pub(crate) drag_released: bool, #[doc(hidden)]
pub drag_released: bool,
/// Is the pointer button currently down on this widget? /// Is the pointer button currently down on this widget?
/// This is true if the pointer is pressing down or dragging a widget /// This is true if the pointer is pressing down or dragging a widget
pub(crate) is_pointer_button_down_on: bool, #[doc(hidden)]
pub is_pointer_button_down_on: bool,
/// Where the pointer (mouse/touch) were when when this widget was clicked or dragged. /// Where the pointer (mouse/touch) were when when this widget was clicked or dragged.
/// `None` if the widget is not being interacted with. /// `None` if the widget is not being interacted with.
pub(crate) interact_pointer_pos: Option<Pos2>, #[doc(hidden)]
pub interact_pointer_pos: Option<Pos2>,
/// What the underlying data changed? /// What the underlying data changed?
///
/// e.g. the slider was dragged, text was entered in a [`TextEdit`](crate::TextEdit) etc. /// e.g. the slider was dragged, text was entered in a [`TextEdit`](crate::TextEdit) etc.
/// Always `false` for something like a [`Button`](crate::Button). /// Always `false` for something like a [`Button`](crate::Button).
pub(crate) changed: bool, #[doc(hidden)]
pub changed: bool,
} }
impl std::fmt::Debug for Response { impl std::fmt::Debug for Response {