[][src]Trait map_gui::tools::MinimapControls

pub trait MinimapControls<A: AppLike> {
    fn has_zorder(&self, app: &A) -> bool;

    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) { ... } }

Customize the appearance and behavior of a minimap.

Required methods

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.

Loading content...

Provided methods

fn has_layer(&self, _: &A) -> bool

Is there some additional layer displayed on the minimap? If this changes, the panel gets recalculated.

fn draw_extra(&self, _: &mut GfxCtx<'_>, _: &A)

Draw extra stuff on the minimap, just pulling from the app.

fn make_unzoomed_panel(&self, ctx: &mut EventCtx<'_>, _: &A) -> Panel

When unzoomed, display this panel. By default, no controls when unzoomed.

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.

fn make_zoomed_side_panel(&self, _: &mut EventCtx<'_>, _: &A) -> Widget

Controls to be placed to the left to the zoomed-in panel

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.

fn panel_changed(&self, _: &mut EventCtx<'_>, _: &mut A, _: &Panel)

Called for Outcome::Changed on the panel.

Loading content...

Implementors

Loading content...