mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-30 01:41:56 +03:00
show keybindings in info panel
This commit is contained in:
parent
0a5d945f20
commit
de21ee0727
@ -4,8 +4,8 @@ use crate::helpers::{rotating_color, ID};
|
||||
use crate::ui::UI;
|
||||
use abstutil::prettyprint_usize;
|
||||
use ezgui::{
|
||||
hotkey, Color, Composite, EventCtx, GfxCtx, Key, Line, ManagedWidget, Outcome, Plot, Series,
|
||||
Text,
|
||||
hotkey, Button, Color, Composite, EventCtx, GfxCtx, Key, Line, ManagedWidget, Outcome, Plot,
|
||||
Series, Text,
|
||||
};
|
||||
use geom::{Duration, Statistic, Time};
|
||||
use map_model::{IntersectionID, RoadID};
|
||||
@ -28,11 +28,17 @@ impl InfoPanel {
|
||||
])];
|
||||
|
||||
for (key, label) in ui.per_obj.consume() {
|
||||
col.push(crate::managed::Composite::text_button(
|
||||
ctx,
|
||||
&label,
|
||||
let mut txt = Text::new();
|
||||
txt.append(Line(key.describe()).fg(ezgui::HOTKEY_COLOR));
|
||||
txt.append(Line(format!(" - {}", label)));
|
||||
col.push(ManagedWidget::btn(Button::text(
|
||||
txt,
|
||||
Color::grey(0.5),
|
||||
Color::ORANGE,
|
||||
hotkey(key),
|
||||
));
|
||||
&label,
|
||||
ctx,
|
||||
)));
|
||||
}
|
||||
|
||||
col.push(ManagedWidget::draw_text(ctx, info_for(id.clone(), ui)));
|
||||
|
Loading…
Reference in New Issue
Block a user