1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 22:30:03 -04:00

Add more doc-links in docstrings (#1419)

This commit is contained in:
4JX
2022-04-03 18:18:35 +02:00
committed by GitHub
parent 861b0e11ba
commit 6091370962
60 changed files with 257 additions and 257 deletions

View File

@@ -22,7 +22,7 @@ pub fn drag_source(ui: &mut Ui, id: Id, body: impl FnOnce(&mut Ui)) {
// Normally you need to decide a location for a widget first,
// because otherwise that widget cannot interact with the mouse.
// However, a dragged component cannot be interacted with anyway
// (anything with `Order::Tooltip` always gets an empty `Response`)
// (anything with `Order::Tooltip` always gets an empty [`Response`])
// So this is fine!
if let Some(pointer_pos) = ui.ctx().pointer_interact_pos() {

View File

@@ -18,7 +18,7 @@ pub fn password_ui(ui: &mut egui::Ui, password: &mut String) -> egui::Response {
let state_id = ui.id().with("show_plaintext");
// Get state for this widget.
// You should get state by value, not by reference to avoid borrowing of `Memory`.
// You should get state by value, not by reference to avoid borrowing of [`Memory`].
let mut show_plaintext = ui.data().get_temp::<bool>(state_id).unwrap_or(false);
// Process ui, change a local copy of the state

View File

@@ -159,7 +159,7 @@ impl super::View for ManualLayoutTest {
ui.add(crate::__egui_github_link_file!());
// Showing how to place a widget anywhere in the `Ui`:
// Showing how to place a widget anywhere in the [`Ui`]:
match *widget_type {
WidgetType::Button => {
ui.put(widget_rect, egui::Button::new("Example button"));

View File

@@ -93,7 +93,7 @@ impl super::View for TextEdit {
let ccursor = egui::text::CCursor::new(0);
state.set_ccursor_range(Some(egui::text::CCursorRange::one(ccursor)));
state.store(ui.ctx(), text_edit_id);
ui.ctx().memory().request_focus(text_edit_id); // give focus back to the `TextEdit`.
ui.ctx().memory().request_focus(text_edit_id); // give focus back to the [`TextEdit`].
}
}
@@ -103,7 +103,7 @@ impl super::View for TextEdit {
let ccursor = egui::text::CCursor::new(text.chars().count());
state.set_ccursor_range(Some(egui::text::CCursorRange::one(ccursor)));
state.store(ui.ctx(), text_edit_id);
ui.ctx().memory().request_focus(text_edit_id); // give focus back to the `TextEdit`.
ui.ctx().memory().request_focus(text_edit_id); // give focus back to the [`TextEdit`].
}
}
});

View File

@@ -12,7 +12,7 @@ enum RunMode {
/// For instance, a GUI for a thermostat need to repaint each time the temperature changes.
/// To ensure the UI is up to date you need to call `egui::Context::request_repaint()` each
/// time such an event happens. You can also chose to call `request_repaint()` once every second
/// or after every single frame - this is called "Continuous" mode,
/// or after every single frame - this is called [`Continuous`](RunMode::Continuous) mode,
/// and for games and interactive tools that need repainting every frame anyway, this should be the default.
Reactive,
@@ -47,7 +47,7 @@ pub struct BackendPanel {
pub open: bool,
#[cfg_attr(feature = "serde", serde(skip))]
// go back to `Reactive` mode each time we start
// go back to [`Reactive`] mode each time we start
run_mode: RunMode,
/// current slider value for current gui scale

View File

@@ -66,7 +66,7 @@ impl epi::App for WrapApp {
}
fn clear_color(&self) -> egui::Rgba {
egui::Rgba::TRANSPARENT // we set a `CentralPanel` fill color in `demo_windows.rs`
egui::Rgba::TRANSPARENT // we set a [`CentralPanel`] fill color in `demo_windows.rs`
}
fn update(&mut self, ctx: &egui::Context, frame: &mut epi::Frame) {