map_gui::tools

Trait MinimapControls

Source
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§

Source

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§

Source

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

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

Source

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

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

Source

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

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

Source

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.

Source

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

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

Source

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.

Source

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

Called for Outcome::Changed on the panel.

Implementors§

impl MinimapControls<SimpleApp<()>> for MinimapController

impl MinimapControls<SimpleApp<Session>> for MinimapController