From b137f16472d2da8864aa786f9f577bfa742fb02d Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Sat, 30 Apr 2022 15:49:50 +0200 Subject: [PATCH] Make members of `Response` public, but hide documentation Discourage their direct use, but allow it --- egui/src/response.rs | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/egui/src/response.rs b/egui/src/response.rs index df79b690..ca3f3e02 100644 --- a/egui/src/response.rs +++ b/egui/src/response.rs @@ -34,40 +34,50 @@ pub struct Response { /// Was the widget enabled? /// If `false`, there was no interaction attempted (not even hover). - pub(crate) enabled: bool, + #[doc(hidden)] + pub enabled: bool, // OUT: /// 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. - pub(crate) clicked: [bool; NUM_POINTER_BUTTONS], + #[doc(hidden)] + pub clicked: [bool; NUM_POINTER_BUTTONS], // TODO: `released` for sliders /// 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. pub(crate) triple_clicked: [bool; NUM_POINTER_BUTTONS], /// 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. - pub(crate) drag_released: bool, + #[doc(hidden)] + pub drag_released: bool, /// Is the pointer button currently down on this 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. /// `None` if the widget is not being interacted with. - pub(crate) interact_pointer_pos: Option, + #[doc(hidden)] + pub interact_pointer_pos: Option, /// What the underlying data changed? + /// /// e.g. the slider was dragged, text was entered in a [`TextEdit`](crate::TextEdit) etc. /// Always `false` for something like a [`Button`](crate::Button). - pub(crate) changed: bool, + #[doc(hidden)] + pub changed: bool, } impl std::fmt::Debug for Response {