pub trait MinimapControls<A: AppLike> {
// Required method
fn has_zorder(&self, app: &A) -> bool;
// Provided methods
fn has_layer(&self, _: &A) -> bool { ... }
fn draw_extra(&self, _: &mut GfxCtx<'_>, _: &A) { ... }
fn make_unzoomed_panel(&self, ctx: &mut EventCtx<'_>, _: &A) -> Panel { ... }
fn make_legend(&self, _: &mut EventCtx<'_>, _: &A) -> Widget { ... }
fn make_zoomed_side_panel(&self, _: &mut EventCtx<'_>, _: &A) -> Widget { ... }
fn panel_clicked(
&self,
_: &mut EventCtx<'_>,
_: &mut A,
_: &str,
) -> Option<Transition<A>> { ... }
fn panel_changed(&self, _: &mut EventCtx<'_>, _: &mut A, _: &Panel) { ... }
}
Expand description
Customize the appearance and behavior of a minimap.
Required Methods§
Sourcefn has_zorder(&self, app: &A) -> bool
fn has_zorder(&self, app: &A) -> bool
Should the user be able to control the z-order visible? The control is only present when zoomed in, placed beneath the zoom column.
Provided Methods§
Sourcefn has_layer(&self, _: &A) -> bool
fn has_layer(&self, _: &A) -> bool
Is there some additional layer displayed on the minimap? If this changes, the panel gets recalculated.
Sourcefn draw_extra(&self, _: &mut GfxCtx<'_>, _: &A)
fn draw_extra(&self, _: &mut GfxCtx<'_>, _: &A)
Draw extra stuff on the minimap, just pulling from the app.
Sourcefn make_unzoomed_panel(&self, ctx: &mut EventCtx<'_>, _: &A) -> Panel
fn make_unzoomed_panel(&self, ctx: &mut EventCtx<'_>, _: &A) -> Panel
When unzoomed, display this panel. By default, no controls when unzoomed.
Sourcefn make_legend(&self, _: &mut EventCtx<'_>, _: &A) -> Widget
fn make_legend(&self, _: &mut EventCtx<'_>, _: &A) -> Widget
A row beneath the minimap in the zoomed view, usually used as a legend for things on the minimap.
Sourcefn make_zoomed_side_panel(&self, _: &mut EventCtx<'_>, _: &A) -> Widget
fn make_zoomed_side_panel(&self, _: &mut EventCtx<'_>, _: &A) -> Widget
Controls to be placed to the left to the zoomed-in panel
Sourcefn panel_clicked(
&self,
_: &mut EventCtx<'_>,
_: &mut A,
_: &str,
) -> Option<Transition<A>>
fn panel_clicked( &self, _: &mut EventCtx<'_>, _: &mut A, _: &str, ) -> Option<Transition<A>>
If a button is clicked that was produced by some method in this trait, respond to it here.
Sourcefn panel_changed(&self, _: &mut EventCtx<'_>, _: &mut A, _: &Panel)
fn panel_changed(&self, _: &mut EventCtx<'_>, _: &mut A, _: &Panel)
Called for Outcome::Changed
on the panel.