Merge branch 'mkirk/conventional-btn-names' of https://github.com/michaelkirk/abstreet into michaelkirk-mkirk/conventional-btn-names

This commit is contained in:
Dustin Carlino 2021-01-22 21:09:08 -08:00
commit 85effcad49
66 changed files with 358 additions and 380 deletions

View File

@ -35,7 +35,7 @@ impl FindHome {
)
.flex_wrap(ctx, Percent::int(50)),
ctx.style()
.btn_primary_dark_text("Search")
.btn_solid_dark_text("Search")
.hotkey(Key::Enter)
.build_def(ctx),
]))
@ -153,7 +153,7 @@ impl Results {
)
.draw_text(ctx),
ctx.style()
.btn_primary_dark_text("Back")
.btn_solid_dark_text("Back")
.hotkey(Key::Escape)
.build_def(ctx),
]))

View File

@ -274,7 +274,7 @@ fn build_panel(ctx: &mut EventCtx, app: &App, start: &Building, isochrone: &Isoc
rows.push(Widget::row(vec![
"Map:".draw_text(ctx),
ctx.style()
.btn_popup_light(nice_map_name(app.map.get_name()))
.btn_outline_light_popup(nice_map_name(app.map.get_name()))
.hotkey(lctrl(Key::L))
.build_widget(ctx, "change map"),
]));
@ -315,7 +315,7 @@ fn build_panel(ctx: &mut EventCtx, app: &App, start: &Building, isochrone: &Isoc
for (amenity, buildings) in isochrone.amenities_reachable.borrow() {
rows.push(
ctx.style()
.btn_secondary_light_text(&format!("{}: {}", amenity, buildings.len()))
.btn_outline_light_text(&format!("{}: {}", amenity, buildings.len()))
.build_widget(ctx, &format!("businesses: {}", amenity)),
);
}
@ -326,7 +326,7 @@ fn build_panel(ctx: &mut EventCtx, app: &App, start: &Building, isochrone: &Isoc
rows.push(options_to_controls(ctx, &isochrone.options));
rows.push(
ctx.style()
.btn_primary_light_text("Find your perfect home")
.btn_solid_light_text("Find your perfect home")
.build_def(ctx),
);
rows.push(Widget::row(vec![

View File

@ -161,7 +161,7 @@ fn make_panel(
Widget::custom_col(vec![
(make_task)(ctx),
ctx.style()
.btn_primary_light_text("Start")
.btn_solid_light_text("Start")
.hotkey(Key::Enter)
.build_def(ctx)
.centered_horiz()
@ -220,7 +220,7 @@ fn make_panel(
Widget::col(vec![
Widget::row(vec![prev.margin_right(40), next]).centered_horiz(),
ctx.style()
.btn_secondary_dark_text("Skip cutscene")
.btn_outline_dark_text("Skip cutscene")
.build_def(ctx)
.centered_horiz(),
])
@ -232,7 +232,7 @@ fn make_panel(
// TODO Can't get this to alignment to work
Widget::custom_row(vec![
ctx.style()
.btn_back_light("Home")
.btn_light_back("Home")
.build_widget(ctx, "quit")
.margin_right(100),
Line(name).big_heading_styled().draw(ctx),
@ -261,7 +261,7 @@ impl FYI {
Widget::custom_col(vec![
contents,
ctx.style()
.btn_primary_dark_text("Okay")
.btn_solid_dark_text("Okay")
.hotkey(hotkeys(vec![Key::Escape, Key::Space, Key::Enter]))
.build_def(ctx)
.centered_horiz()

View File

@ -133,7 +133,7 @@ impl ChallengesPicker {
let mut links = BTreeMap::new();
let mut master_col = vec![
ctx.style()
.btn_back_light("Home")
.btn_light_back("Home")
.hotkey(Key::Escape)
.build_widget(ctx, "back")
.align_left(),
@ -144,7 +144,7 @@ impl ChallengesPicker {
.draw(ctx)
.centered_horiz(),
ctx.style()
.btn_primary_dark_text("Introduction and tutorial")
.btn_solid_dark_text("Introduction and tutorial")
.build_def(ctx)
.centered_horiz()
.bg(app.cs.panel_bg)
@ -161,7 +161,7 @@ impl ChallengesPicker {
.unwrap_or(false);
flex_row.push(
ctx.style()
.btn_primary_dark_text(&name)
.btn_solid_dark_text(&name)
.disabled(is_current_stage)
.hotkey(Key::NUM_KEYS[idx])
.build_def(ctx),
@ -189,7 +189,7 @@ impl ChallengesPicker {
{
col.push(
ctx.style()
.btn_secondary_light_text(&stage.title)
.btn_outline_light_text(&stage.title)
.disabled(current == idx)
.build_def(ctx),
);
@ -215,7 +215,7 @@ impl ChallengesPicker {
let mut inner_col = vec![
txt.draw(ctx),
ctx.style()
.btn_secondary_light_text("Start!")
.btn_outline_light_text("Start!")
.hotkey(Key::Enter)
.build_def(ctx),
];

View File

@ -99,7 +99,7 @@ impl MinimapControls<App> for MinimapController {
fn make_tool_panel(ctx: &mut EventCtx, app: &App) -> Widget {
let buttons = ctx
.style()
.btn_primary_light()
.btn_solid_light()
.image_dims(ScreenDims::square(20.0))
// the default transparent button background is jarring for these buttons which are floating
// in a transparent panel.

View File

@ -120,7 +120,7 @@ impl DebugWarp {
.draw(ctx),
Widget::text_entry(ctx, String::new(), true).named("input"),
ctx.style()
.btn_secondary_light_text("Go!")
.btn_outline_light_text("Go!")
.hotkey(Key::Enter)
.build_def(ctx),
]))

View File

@ -59,56 +59,56 @@ impl DebugMode {
Checkbox::switch(ctx, "show route for all agents", Key::R, false),
Widget::col(vec![
ctx.style()
.btn_secondary_light_text("unhide everything")
.btn_outline_light_text("unhide everything")
.hotkey(lctrl(Key::H))
.build_def(ctx),
ctx.style()
.btn_secondary_light_text("screenshot everything (for leaflet)")
.btn_outline_light_text("screenshot everything (for leaflet)")
.build_def(ctx),
ctx.style()
.btn_secondary_light_text("screenshot all of the everything")
.btn_outline_light_text("screenshot all of the everything")
.build_def(ctx),
ctx.style()
.btn_secondary_light_text("search OSM metadata")
.btn_outline_light_text("search OSM metadata")
.hotkey(Key::Slash)
.build_def(ctx),
ctx.style()
.btn_secondary_light_text("clear OSM search results")
.btn_outline_light_text("clear OSM search results")
.hotkey(Key::Slash)
.build_def(ctx),
ctx.style()
.btn_secondary_light_text("save sim state")
.btn_outline_light_text("save sim state")
.hotkey(Key::O)
.build_def(ctx),
ctx.style()
.btn_secondary_light_text("load previous sim state")
.btn_outline_light_text("load previous sim state")
.hotkey(Key::Y)
.build_def(ctx),
ctx.style()
.btn_secondary_light_text("load next sim state")
.btn_outline_light_text("load next sim state")
.hotkey(Key::U)
.build_def(ctx),
ctx.style()
.btn_secondary_light_text("pick a savestate to load")
.btn_outline_light_text("pick a savestate to load")
.build_def(ctx),
ctx.style()
.btn_secondary_light_text("find bad traffic signals")
.btn_outline_light_text("find bad traffic signals")
.build_def(ctx),
ctx.style()
.btn_secondary_light_text("find degenerate roads")
.btn_outline_light_text("find degenerate roads")
.build_def(ctx),
ctx.style()
.btn_secondary_light_text("find large intersections")
.btn_outline_light_text("find large intersections")
.build_def(ctx),
ctx.style()
.btn_secondary_light_text("sim internal stats")
.btn_outline_light_text("sim internal stats")
.build_def(ctx),
ctx.style()
.btn_secondary_light_text("blocked-by graph")
.btn_outline_light_text("blocked-by graph")
.hotkey(Key::B)
.build_def(ctx),
ctx.style()
.btn_secondary_light_text("render to GeoJSON")
.btn_outline_light_text("render to GeoJSON")
.hotkey(Key::G)
.build_def(ctx),
]),

View File

@ -79,7 +79,7 @@ impl ViewKML {
)
.draw_text(ctx),
ctx.style()
.btn_secondary_light_text("load KML file")
.btn_outline_light_text("load KML file")
.hotkey(lctrl(Key::L))
.build_def(ctx),
Widget::row(vec![

View File

@ -33,29 +33,29 @@ impl DevToolsMode {
Widget::row(vec![
"Change map:".draw_text(ctx),
ctx.style()
.btn_popup_light(nice_map_name(app.primary.map.get_name()))
.btn_outline_light_popup(nice_map_name(app.primary.map.get_name()))
.hotkey(lctrl(Key::L))
.build_widget(ctx, "change map"),
]),
Widget::custom_row(vec![
ctx.style()
.btn_secondary_light_text("edit a polygon")
.btn_outline_light_text("edit a polygon")
.hotkey(Key::E)
.build_def(ctx),
ctx.style()
.btn_secondary_light_text("draw a polygon")
.btn_outline_light_text("draw a polygon")
.hotkey(Key::P)
.build_def(ctx),
ctx.style()
.btn_secondary_light_text("load scenario")
.btn_outline_light_text("load scenario")
.hotkey(Key::W)
.build_def(ctx),
ctx.style()
.btn_secondary_light_text("view KML")
.btn_outline_light_text("view KML")
.hotkey(Key::K)
.build_def(ctx),
ctx.style()
.btn_secondary_light_text("story maps")
.btn_outline_light_text("story maps")
.hotkey(Key::S)
.build_def(ctx),
if abstio::file_exists(abstio::path(format!(
@ -63,7 +63,7 @@ impl DevToolsMode {
app.primary.map.get_city_name()
))) {
ctx.style()
.btn_secondary_light_text("collisions")
.btn_outline_light_text("collisions")
.hotkey(Key::C)
.build_def(ctx)
} else {

View File

@ -33,7 +33,7 @@ impl PolygonEditor {
ctx.style().btn_close_widget(ctx),
]),
ctx.style()
.btn_secondary_light_text("export as an Osmosis polygon filter")
.btn_outline_light_text("export as an Osmosis polygon filter")
.hotkey(Key::X)
.build_def(ctx),
]))

View File

@ -55,7 +55,7 @@ impl ScenarioManager {
ctx.style().btn_close_widget(ctx),
]),
ctx.style()
.btn_secondary_light_text("popular destinations")
.btn_outline_light_text("popular destinations")
.hotkey(Key::D)
.build_def(ctx),
Text::from_multiline(vec![

View File

@ -313,11 +313,11 @@ fn make_panel(ctx: &mut EventCtx, story: &StoryMap, mode: &Mode, dirty: bool) ->
Line("Story map editor").small_heading().draw(ctx),
Widget::vert_separator(ctx, 30.0),
ctx.style()
.btn_popup_light(&story.name)
.btn_outline_light_popup(&story.name)
.hotkey(lctrl(Key::L))
.build_widget(ctx, "load"),
ctx.style()
.btn_primary_light_icon("system/assets/tools/save.svg")
.btn_solid_light_icon("system/assets/tools/save.svg")
.hotkey(lctrl(Key::S))
.disabled(!dirty)
.build_widget(ctx, "save"),
@ -511,12 +511,10 @@ impl Marker {
Line("Editing marker").small_heading().draw(ctx),
ctx.style().btn_close_widget(ctx),
]),
ctx.style()
.btn_secondary_light_text("delete")
.build_def(ctx),
ctx.style().btn_outline_light_text("delete").build_def(ctx),
Widget::text_entry(ctx, self.event.clone(), true).named("event"),
ctx.style()
.btn_secondary_light_text("confirm")
.btn_outline_light_text("confirm")
.hotkey(Key::Enter)
.build_def(ctx),
]))

View File

@ -33,24 +33,24 @@ fn make_select_panel(ctx: &mut EventCtx, selector: &RoadSelector) -> Panel {
selector.make_controls(ctx),
Widget::row(vec![
ctx.style()
.btn_secondary_light_text(&format!("Edit {} roads", selector.roads.len()))
.btn_outline_light_text(&format!("Edit {} roads", selector.roads.len()))
.disabled(selector.roads.is_empty())
.hotkey(hotkeys(vec![Key::E, Key::Enter]))
.build_widget(ctx, "edit roads"),
ctx.style()
.btn_secondary_light_text(&format!(
.btn_outline_light_text(&format!(
"Export {} roads to shared-row",
selector.roads.len()
))
.build_widget(ctx, "export roads to shared-row"),
ctx.style()
.btn_secondary_light_text("export one road to Streetmix")
.btn_outline_light_text("export one road to Streetmix")
.build_def(ctx),
ctx.style()
.btn_secondary_light_text("export list of roads")
.btn_outline_light_text("export list of roads")
.build_def(ctx),
ctx.style()
.btn_secondary_light_text("Cancel")
.btn_outline_light_text("Cancel")
.hotkey(Key::Escape)
.build_def(ctx),
])
@ -168,7 +168,7 @@ impl BulkEdit {
},
Widget::row(vec![
ctx.style()
.btn_primary_dark_text("Finish")
.btn_solid_dark_text("Finish")
.hotkey(Key::Enter)
.build_def(ctx),
ctx.style()

View File

@ -25,7 +25,7 @@ impl ClusterTrafficSignalEditor {
Box::new(ClusterTrafficSignalEditor {
panel: Panel::new(Widget::row(vec![ctx
.style()
.btn_secondary_light_text("Finish")
.btn_outline_light_text("Finish")
.hotkey(Key::Escape)
.build_def(ctx)]))
.aligned(HorizontalAlignment::Center, VerticalAlignment::Top)

View File

@ -87,7 +87,7 @@ impl LaneEditor {
"Type of lane".draw_text(ctx),
Widget::custom_row(row).centered(),
ctx.style()
.btn_secondary_light_text("reverse direction")
.btn_outline_light_text("reverse direction")
.hotkey(Key::F)
.build_def(ctx),
{
@ -104,11 +104,11 @@ impl LaneEditor {
])
},
ctx.style()
.btn_secondary_light_text("Change access restrictions")
.btn_outline_light_text("Change access restrictions")
.hotkey(Key::A)
.build_def(ctx),
ctx.style()
.btn_primary_dark_text("Finish")
.btn_solid_dark_text("Finish")
.hotkey(Key::Escape)
.build_def(ctx),
];

View File

@ -406,21 +406,21 @@ impl SaveEdits {
Widget::row(vec![
if discard {
ctx.style()
.btn_primary_destructive_text("Discard proposal")
.btn_solid_destructive_text("Discard proposal")
.build_def(ctx)
} else {
Widget::nothing()
},
if cancel.is_some() {
ctx.style()
.btn_primary_dark_text("Cancel")
.btn_solid_dark_text("Cancel")
.hotkey(Key::Escape)
.build_def(ctx)
} else {
Widget::nothing()
},
ctx.style()
.btn_primary_dark_text("Save")
.btn_solid_dark_text("Save")
.disabled(true)
.build_def(ctx),
])
@ -441,7 +441,7 @@ impl SaveEdits {
ctx,
"Save",
ctx.style()
.btn_primary_dark_text("Save")
.btn_solid_dark_text("Save")
.disabled(true)
.build_def(ctx),
);
@ -454,7 +454,7 @@ impl SaveEdits {
ctx,
"Save",
ctx.style()
.btn_primary_dark_text("Save")
.btn_solid_dark_text("Save")
.disabled(true)
.build_def(ctx),
);
@ -470,7 +470,7 @@ impl SaveEdits {
ctx,
"Save",
ctx.style()
.btn_primary_dark_text("Save")
.btn_solid_dark_text("Save")
.hotkey(Key::Enter)
.build_def(ctx),
);
@ -547,7 +547,7 @@ impl LoadEdits {
if MapEdits::load(&app.primary.map, path.clone(), &mut Timer::throwaway()).is_ok() {
proposals.push(
ctx.style()
.btn_secondary_light_text(&name)
.btn_outline_light_text(&name)
.build_widget(ctx, &path),
);
}
@ -561,7 +561,7 @@ impl LoadEdits {
ctx.style().btn_close_widget(ctx),
]),
ctx.style()
.btn_secondary_light_text("Start over with blank proposal")
.btn_outline_light_text("Start over with blank proposal")
.build_def(ctx),
Widget::row(vec![Widget::col(your_edits), Widget::col(proposals)]).evenly_spaced(),
]))
@ -650,7 +650,7 @@ fn make_topcenter(ctx: &mut EventCtx, app: &App) -> Panel {
.draw(ctx)
.centered_horiz(),
ctx.style()
.btn_primary_dark_text(&format!(
.btn_solid_dark_text(&format!(
"Finish & resume from {}",
app.primary
.suspended_sim
@ -780,7 +780,7 @@ fn make_changelist(ctx: &mut EventCtx, app: &App) -> Panel {
let mut col = vec![
Widget::row(vec![
ctx.style()
.btn_popup_light(&edits.edits_name)
.btn_outline_light_popup(&edits.edits_name)
.hotkey(lctrl(Key::P))
.build_widget(ctx, "manage proposals"),
"autosaved"
@ -865,11 +865,11 @@ impl ConfirmDiscard {
"Are you sure you want to discard changes you made?".draw_text(ctx),
Widget::row(vec![
ctx.style()
.btn_primary_dark_text("Cancel")
.btn_solid_dark_text("Cancel")
.hotkey(Key::Escape)
.build_def(ctx),
ctx.style()
.btn_primary_destructive_text("Yes, discard")
.btn_solid_destructive_text("Yes, discard")
.build_def(ctx),
])
.align_right(),

View File

@ -32,7 +32,7 @@ impl RouteEditor {
Spinner::new(ctx, (1, 120), 60).named("freq_mins"),
]),
ctx.style()
.btn_primary_dark_text("Apply")
.btn_solid_dark_text("Apply")
.hotkey(Key::Enter)
.build_def(ctx),
]))

View File

@ -52,7 +52,7 @@ impl StopSignEditor {
let panel = Panel::new(Widget::col(vec![
Line("Stop sign editor").small_heading().draw(ctx),
ctx.style()
.btn_secondary_light_text("reset to default")
.btn_outline_light_text("reset to default")
.hotkey(Key::R)
.disabled(
&ControlStopSign::new(&app.primary.map, id)
@ -60,14 +60,14 @@ impl StopSignEditor {
)
.build_def(ctx),
ctx.style()
.btn_secondary_light_text("close intersection for construction")
.btn_outline_light_text("close intersection for construction")
.hotkey(Key::C)
.build_def(ctx),
ctx.style()
.btn_secondary_light_text("convert to traffic signal")
.btn_outline_light_text("convert to traffic signal")
.build_def(ctx),
ctx.style()
.btn_secondary_light_text("Finish")
.btn_outline_light_text("Finish")
.hotkey(Key::Escape)
.build_def(ctx),
]))

View File

@ -95,7 +95,7 @@ impl ChangeDuration {
.secondary()
.draw(ctx),
ctx.style()
.btn_primary_dark_text("Apply")
.btn_solid_dark_text("Apply")
.hotkey(Key::Enter)
.build_def(ctx),
]))

View File

@ -495,11 +495,11 @@ impl State<App> for TrafficSignalEditor {
fn make_top_panel(ctx: &mut EventCtx, app: &App, can_undo: bool, can_redo: bool) -> Panel {
let row = vec![
ctx.style()
.btn_primary_dark_text("Finish")
.btn_solid_dark_text("Finish")
.hotkey(Key::Enter)
.build_def(ctx),
ctx.style()
.btn_primary_dark_text("Preview")
.btn_solid_dark_text("Preview")
.hotkey(lctrl(Key::P))
.build_def(ctx),
(if can_undo {
@ -547,7 +547,7 @@ fn make_top_panel(ctx: &mut EventCtx, app: &App, can_undo: bool, can_redo: bool)
Widget::row(row),
if app.opts.dev {
ctx.style()
.btn_secondary_light_text("Export")
.btn_outline_light_text("Export")
.tooltip(Text::from_multiline(vec![
Line("This will create a JSON file in traffic_signal_data/.").small(),
Line(
@ -620,14 +620,14 @@ fn make_side_panel(
if members.len() == 1 {
col.push(
ctx.style()
.btn_primary_dark_text("Edit entire signal")
.btn_solid_dark_text("Edit entire signal")
.hotkey(Key::E)
.build_def(ctx),
);
} else {
col.push(
ctx.style()
.btn_primary_dark_text("Tune offsets between signals")
.btn_solid_dark_text("Tune offsets between signals")
.hotkey(Key::O)
.build_def(ctx),
);
@ -645,12 +645,12 @@ fn make_side_panel(
let up_button = ctx
.style()
.btn_primary_light_icon("../widgetry/icons/arrow_up.svg")
.btn_solid_light_icon("../widgetry/icons/arrow_up.svg")
.disabled(idx == 0);
let down_button = ctx
.style()
.btn_primary_light_icon("../widgetry/icons/arrow_down.svg")
.btn_solid_light_icon("../widgetry/icons/arrow_down.svg")
.disabled(idx == canonical_signal.stages.len() - 1);
let stage_controls = Widget::row(vec![
@ -686,7 +686,7 @@ fn make_side_panel(
},
if canonical_signal.stages.len() > 1 {
ctx.style()
.btn_primary_destructive_icon("system/assets/tools/trash.svg")
.btn_solid_destructive_icon("system/assets/tools/trash.svg")
.build_widget(ctx, &format!("delete stage {}", idx + 1))
.align_right()
} else {
@ -707,7 +707,7 @@ fn make_side_panel(
col.push(
ctx.style()
.btn_primary_dark_text("Add a new stage")
.btn_solid_dark_text("Add a new stage")
.build_def(ctx)
.centered_horiz(),
);

View File

@ -253,7 +253,7 @@ impl TuneRelative {
.named("offset"),
]),
ctx.style()
.btn_primary_dark_text("Update offset")
.btn_solid_dark_text("Update offset")
.hotkey(Key::Enter)
.build_def(ctx),
]))

View File

@ -113,7 +113,7 @@ fn make_btn(ctx: &mut EventCtx, num: usize) -> Widget {
_ => format!("Edit {} signals", num),
};
ctx.style()
.btn_primary_dark_text(&title)
.btn_solid_dark_text(&title)
.disabled(num == 0)
.hotkey(hotkeys(vec![Key::Enter, Key::E]))
.build_widget(ctx, "edit")

View File

@ -26,7 +26,7 @@ impl PreviewTrafficSignal {
panel: Panel::new(Widget::col(vec![
"Previewing traffic signal".draw_text(ctx),
ctx.style()
.btn_secondary_light_text("back to editing")
.btn_outline_light_text("back to editing")
.hotkey(Key::Escape)
.build_def(ctx),
]))

View File

@ -64,11 +64,11 @@ impl ZoneEditor {
]),
Widget::custom_row(vec![
ctx.style()
.btn_secondary_light_text("Apply")
.btn_outline_light_text("Apply")
.hotkey(Key::Enter)
.build_def(ctx),
ctx.style()
.btn_secondary_light_text("Cancel")
.btn_outline_light_text("Cancel")
.hotkey(Key::Escape)
.build_def(ctx),
])

View File

@ -106,7 +106,7 @@ pub fn info(ctx: &mut EventCtx, app: &App, details: &mut Details, id: BuildingID
if app.opts.dev {
rows.push(
ctx.style()
.btn_primary_light_text("Open OSM")
.btn_solid_light_text("Open OSM")
.build_widget(ctx, &format!("open {}", b.orig_id)),
);
@ -155,7 +155,7 @@ pub fn people(ctx: &mut EventCtx, app: &App, details: &mut Details, id: Building
.insert(p.to_string(), Tab::PersonTrips(p, BTreeMap::new()));
let widget = Widget::col(vec![
ctx.style()
.btn_primary_light_text(&p.to_string())
.btn_solid_light_text(&p.to_string())
.build_def(ctx),
if let Some((t, mode)) = next_trip {
format!(

View File

@ -27,7 +27,7 @@ pub fn stop(ctx: &mut EventCtx, app: &App, details: &mut Details, id: BusStopID)
let label = format!("{} ({})", r.full_name, r.id);
rows.push(
ctx.style()
.btn_secondary_light_text(&format!("Route {}", r.short_name))
.btn_outline_light_text(&format!("Route {}", r.short_name))
.build_widget(ctx, &label),
);
details.hyperlinks.insert(label, Tab::BusRoute(r.id));
@ -107,7 +107,7 @@ pub fn bus_status(ctx: &mut EventCtx, app: &App, details: &mut Details, id: CarI
rows.push(
ctx.style()
.btn_secondary_light_text(&format!("Serves route {}", route.short_name))
.btn_outline_light_text(&format!("Serves route {}", route.short_name))
.build_def(ctx),
);
details.hyperlinks.insert(
@ -184,7 +184,7 @@ pub fn route(ctx: &mut EventCtx, app: &App, details: &mut Details, id: BusRouteI
if app.opts.dev {
rows.push(
ctx.style()
.btn_primary_light_text("Open OSM relation")
.btn_solid_light_text("Open OSM relation")
.build_widget(ctx, &format!("open {}", route.osm_rel_id)),
);
}
@ -197,7 +197,7 @@ pub fn route(ctx: &mut EventCtx, app: &App, details: &mut Details, id: BusRouteI
for (bus, _, _, pt) in buses {
rows.push(
ctx.style()
.btn_secondary_light_text(&bus.to_string())
.btn_outline_light_text(&bus.to_string())
.build_def(ctx),
);
details
@ -296,7 +296,7 @@ pub fn route(ctx: &mut EventCtx, app: &App, details: &mut Details, id: BusRouteI
{
rows.push(
ctx.style()
.btn_secondary_light_text("Edit schedule")
.btn_outline_light_text("Edit schedule")
.hotkey(Key::E)
.build_widget(ctx, &format!("edit {}", route.id)),
);

View File

@ -17,7 +17,7 @@ pub fn area(ctx: &EventCtx, app: &App, _: &mut Details, id: AreaID) -> Vec<Widge
if let Some(osm_id) = area.osm_id {
rows.push(
ctx.style()
.btn_primary_light_text("Open in OSM")
.btn_solid_light_text("Open in OSM")
.build_widget(ctx, &format!("open {}", osm_id)),
);
}

View File

@ -37,7 +37,7 @@ pub fn info(ctx: &EventCtx, app: &App, details: &mut Details, id: IntersectionID
if app.opts.dev {
rows.push(
ctx.style()
.btn_primary_light_text("Open OSM node")
.btn_solid_light_text("Open OSM node")
.build_widget(ctx, &format!("open {}", i.orig_id)),
);
}
@ -216,13 +216,13 @@ pub fn current_demand(
);
rows.push(
ctx.style()
.btn_secondary_light_text("Explore demand across all traffic signals")
.btn_outline_light_text("Explore demand across all traffic signals")
.build_def(ctx),
);
if app.opts.dev {
rows.push(
ctx.style()
.btn_secondary_light_text("Where are these agents headed?")
.btn_outline_light_text("Where are these agents headed?")
.build_widget(ctx, &format!("routes across {}", id)),
);
}

View File

@ -167,7 +167,7 @@ pub fn debug(ctx: &EventCtx, app: &App, details: &mut Details, id: LaneID) -> Ve
rows.push(
ctx.style()
.btn_primary_light_text("Open OSM way")
.btn_solid_light_text("Open OSM way")
.build_widget(ctx, &format!("open {}", r.orig_id.osm_way_id)),
);

View File

@ -375,7 +375,7 @@ impl InfoPanel {
cached_actions.push(key);
let button = ctx
.style()
.btn_hotkey_light(&label, key)
.btn_solid_light_hotkey(&label, key)
.build_widget(ctx, &label);
col.push(button);
}
@ -696,22 +696,22 @@ fn make_tabs(
for (name, link) in tabs {
row.push(
ctx.style()
.btn_primary_dark_text(name)
.btn_solid_dark_text(name)
// We use "disabled" to denote "currently selected", but we want to style it like
// normal
.disabled(current_tab.variant() == link.variant())
.bg_color(ctx.style().btn_primary_dark.bg, ControlState::Disabled)
.label_color(ctx.style().btn_primary_dark.fg, ControlState::Disabled)
.bg_color(ctx.style().btn_solid_dark.bg, ControlState::Disabled)
.label_color(ctx.style().btn_solid_dark.fg, ControlState::Disabled)
.outline(
2.0,
ctx.style().btn_primary_dark.bg_hover,
ctx.style().btn_solid_dark.bg_hover,
ControlState::Disabled,
)
// Hide the hit area for selectable tabs unless hovered
.bg_color(Color::CLEAR, ControlState::Default)
.outline(0.0, Color::CLEAR, ControlState::Default)
.bg_color(
ctx.style().btn_primary_dark.bg.alpha(0.6),
ctx.style().btn_solid_dark.bg.alpha(0.6),
ControlState::Hovered,
)
.build_def(ctx),

View File

@ -56,7 +56,7 @@ pub fn info(ctx: &mut EventCtx, app: &App, details: &mut Details, id: ParkingLot
if app.opts.dev {
rows.push(
ctx.style()
.btn_primary_light_text("Open OSM")
.btn_solid_light_text("Open OSM")
.build_widget(ctx, &format!("open {}", pl.osm_id)),
);
}

View File

@ -210,7 +210,7 @@ pub fn trips(
.to_geom(ctx, Some(0.3));
rows.push(
ctx.style()
.btn_primary_light()
.btn_solid_light()
.custom_batch(row_btn.clone(), ControlState::Default)
.custom_batch(
row_btn.color(RewriteColor::Change(app.cs.inner_panel, app.cs.hovering)),
@ -326,7 +326,7 @@ pub fn bio(
if app.primary.sim.lookup_parked_car(v.id).is_some() {
rows.push(
ctx.style()
.btn_primary_dark_text(&format!("Owner of {} (parked)", v.id))
.btn_solid_dark_text(&format!("Owner of {} (parked)", v.id))
.build_def(ctx),
);
details
@ -450,7 +450,7 @@ pub fn crowd(
rows.push(Widget::row(vec![
format!("{})", idx + 1).draw_text(ctx).centered_vert(),
ctx.style()
.btn_secondary_light_text(&person.to_string())
.btn_outline_light_text(&person.to_string())
.build_def(ctx),
]));
details.hyperlinks.insert(
@ -509,7 +509,7 @@ pub fn parked_car(
let p = app.primary.sim.get_owner_of_car(id).unwrap();
rows.push(
ctx.style()
.btn_primary_dark_text(&format!("Owned by {}", p))
.btn_solid_dark_text(&format!("Owned by {}", p))
.build_def(ctx),
);
details.hyperlinks.insert(

View File

@ -253,7 +253,7 @@ pub fn finished(
);
col.push(
ctx.style()
.btn_primary_light()
.btn_solid_light()
.label_styled_text(
Text::from_all(vec![
Line("After / "),
@ -274,7 +274,7 @@ pub fn finished(
);
col.push(
ctx.style()
.btn_primary_light()
.btn_solid_light()
.label_styled_text(
Text::from_all(vec![
Line("After / ").secondary(),

View File

@ -93,7 +93,7 @@ impl PickLayer {
};
let btn = |name: &str, key| {
ctx.style()
.btn_hotkey_light(name, key)
.btn_solid_light_hotkey(name, key)
.disabled(name == current)
.build_widget(ctx, name)
};

View File

@ -46,7 +46,7 @@ impl TitleScreen {
// TODO that nicer font
// TODO Any key
ctx.style()
.btn_primary_dark_text("Play")
.btn_solid_dark_text("Play")
.hotkey(hotkeys(vec![Key::Space, Key::Enter]))
.build_widget(ctx, "start game"),
])
@ -100,7 +100,7 @@ impl MainMenu {
Widget::row({
let btn_builder = ctx
.style()
.btn_primary_dark()
.btn_solid_dark()
.image_dims(ScreenDims::new(200.0, 100.0))
.font_size(40)
.font(Font::OverpassBold)
@ -154,7 +154,7 @@ impl MainMenu {
.centered(),
Widget::row(vec![
ctx.style()
.btn_secondary_light_text("Community Proposals")
.btn_outline_light_text("Community Proposals")
.tooltip({
let mut txt = Text::tooltip(ctx, Key::P, "Community Proposals");
txt.add(Line("See existing ideas for improving traffic").small());
@ -163,16 +163,16 @@ impl MainMenu {
.hotkey(Key::P)
.build_widget(ctx, "Community Proposals"),
ctx.style()
.btn_secondary_light_text("Internal Dev Tools")
.btn_outline_light_text("Internal Dev Tools")
.hotkey(Key::D)
.build_widget(ctx, "Internal Dev Tools"),
])
.centered(),
Widget::col(vec![
Widget::row(vec![
ctx.style().btn_secondary_light_text("About").build_def(ctx),
ctx.style().btn_outline_light_text("About").build_def(ctx),
ctx.style()
.btn_secondary_light_text("Feedback")
.btn_outline_light_text("Feedback")
.build_def(ctx),
]),
built_info::time().draw(ctx),
@ -255,7 +255,7 @@ impl About {
fn new(ctx: &mut EventCtx, app: &App) -> Box<dyn State<App>> {
let col = vec![
ctx.style()
.btn_back_light("Home")
.btn_light_back("Home")
.hotkey(Key::Escape)
.build_widget(ctx, "back")
.align_left(),
@ -289,7 +289,7 @@ impl About {
.padding(16)
},
ctx.style()
.btn_primary_dark_text("See full credits")
.btn_solid_dark_text("See full credits")
.build_def(ctx)
.centered_horiz(),
];
@ -363,20 +363,20 @@ impl Proposals {
if edits.proposal_link.is_some() {
current_tab.push(
ctx.style()
.btn_primary_dark_text("Read detailed write-up")
.btn_solid_dark_text("Read detailed write-up")
.build_def(ctx)
.margin_below(10),
);
}
current_tab.push(
ctx.style()
.btn_primary_dark_text("Try out this proposal")
.btn_solid_dark_text("Try out this proposal")
.build_def(ctx),
);
buttons.push(
ctx.style()
.btn_primary_dark_text(&edits.proposal_description[0])
.btn_solid_dark_text(&edits.proposal_description[0])
.disabled(true)
.build_def(ctx)
.margin_below(10),
@ -384,7 +384,7 @@ impl Proposals {
} else {
buttons.push(
ctx.style()
.btn_primary_dark_text(&edits.proposal_description[0])
.btn_solid_dark_text(&edits.proposal_description[0])
.no_tooltip()
.build_widget(ctx, &name)
.margin_below(10),
@ -413,7 +413,7 @@ impl Proposals {
proposals,
panel: Panel::new(Widget::custom_col(vec![
ctx.style()
.btn_back_light("Home")
.btn_light_back("Home")
.hotkey(Key::Escape)
.build_widget(ctx, "back")
.align_left()

View File

@ -173,7 +173,7 @@ impl TransitRoutes {
.map(|(boardings, alightings, waiting, name, id)| {
Widget::row(vec![
ctx.style()
.btn_secondary_light_text(&name)
.btn_outline_light_text(&name)
.build_widget(ctx, &id.to_string()),
format!(
"{} boardings, {} alightings, {} currently waiting",

View File

@ -587,11 +587,11 @@ fn trip_category_selector(ctx: &mut EventCtx, app: &App, tab: DashTab) -> Widget
let total = finished + cancelled + unfinished;
let btn = |dash, action, label| {
let mut button = ctx.style().btn_primary_light_text(label);
let mut button = ctx.style().btn_solid_light_text(label);
if dash == tab {
button = button
.disabled(true)
.bg_color(ctx.style().btn_primary_light.bg, ControlState::Disabled)
.bg_color(ctx.style().btn_solid_light.bg, ControlState::Disabled)
.label_styled_text(Text::from(Line(label).underlined()), ControlState::Default)
}
button.build_widget(ctx, action)

View File

@ -255,7 +255,7 @@ impl GameplayState for FixTrafficSignals {
.draw(ctx)
.centered_vert(),
ctx.style()
.btn_secondary_light_text("try again")
.btn_outline_light_text("try again")
.build_def(ctx),
]),
]))

View File

@ -107,26 +107,26 @@ impl GameplayState for Freeform {
Widget::vert_separator(ctx, 50.0),
"Map:".draw_text(ctx),
ctx.style()
.btn_popup_light(nice_map_name(app.primary.map.get_name()))
.btn_outline_light_popup(nice_map_name(app.primary.map.get_name()))
.hotkey(lctrl(Key::L))
.build_widget(ctx, "change map"),
"Scenario:".draw_text(ctx),
ctx.style()
.btn_popup_light("none")
.btn_outline_light_popup("none")
.hotkey(Key::S)
.build_widget(ctx, "change scenario"),
ctx.style()
.btn_secondary_light_icon_text("system/assets/tools/pencil.svg", "Edit map")
.btn_outline_light_icon_text("system/assets/tools/pencil.svg", "Edit map")
.hotkey(lctrl(Key::E))
.build_widget(ctx, "edit map"),
])
.centered(),
Widget::row(vec![
ctx.style()
.btn_secondary_light_text("Start a new trip")
.btn_outline_light_text("Start a new trip")
.build_def(ctx),
ctx.style()
.btn_secondary_light_text("Record trips as a scenario")
.btn_outline_light_text("Record trips as a scenario")
.build_def(ctx),
])
.centered(),
@ -206,7 +206,7 @@ impl ChangeScenario {
for (name, label, description) in choices {
let btn = ctx
.style()
.btn_primary_dark_text(&label)
.btn_solid_dark_text(&label)
.disabled(name == current_scenario);
col.push(
Widget::row(vec![
@ -221,7 +221,7 @@ impl ChangeScenario {
}
col.push(
ctx.style()
.btn_secondary_light_text("Import your own data")
.btn_outline_light_text("Import your own data")
.build_def(ctx),
);
@ -302,7 +302,7 @@ impl AgentSpawner {
Spinner::new(ctx, (1, 1000), 1).named("number"),
]),
ctx.style()
.btn_secondary_light_text("Confirm")
.btn_outline_light_text("Confirm")
.disabled(true)
.build_def(ctx),
]))
@ -388,7 +388,7 @@ impl State<App> for AgentSpawner {
ctx,
"Confirm",
ctx.style()
.btn_secondary_light_text("Confirm")
.btn_outline_light_text("Confirm")
.disabled(true)
.build_def(ctx),
);
@ -464,7 +464,7 @@ impl State<App> for AgentSpawner {
ctx,
"Confirm",
ctx.style()
.btn_secondary_light_text("Confirm")
.btn_outline_light_text("Confirm")
.hotkey(Key::Enter)
.build_def(ctx),
);

View File

@ -227,7 +227,7 @@ fn challenge_header(ctx: &mut EventCtx, title: &str) -> Widget {
.centered_vert(),
Widget::vert_separator(ctx, 50.0),
ctx.style()
.btn_secondary_light_icon_text("system/assets/tools/pencil.svg", "Edit map")
.btn_outline_light_icon_text("system/assets/tools/pencil.svg", "Edit map")
.hotkey(lctrl(Key::E))
.build_widget(ctx, "edit map")
.centered_vert(),
@ -268,20 +268,18 @@ impl FinalScore {
msg.draw_text(ctx),
// TODO Adjust wording
ctx.style()
.btn_primary_dark_text("Keep simulating")
.build_def(ctx),
ctx.style()
.btn_primary_dark_text("Try again")
.btn_solid_dark_text("Keep simulating")
.build_def(ctx),
ctx.style().btn_solid_dark_text("Try again").build_def(ctx),
if next_mode.is_some() {
ctx.style()
.btn_primary_dark_text("Next challenge")
.btn_solid_dark_text("Next challenge")
.build_def(ctx)
} else {
Widget::nothing()
},
ctx.style()
.btn_primary_dark_text("Back to challenges")
.btn_solid_dark_text("Back to challenges")
.build_def(ctx),
])
.outline(10.0, Color::BLACK)

View File

@ -116,16 +116,16 @@ impl GameplayState for PlayScenario {
Widget::vert_separator(ctx, 50.0),
"Map:".draw_text(ctx),
ctx.style()
.btn_popup_light(nice_map_name(app.primary.map.get_name()))
.btn_outline_light_popup(nice_map_name(app.primary.map.get_name()))
.hotkey(lctrl(Key::L))
.build_widget(ctx, "change map"),
"Scenario:".draw_text(ctx),
ctx.style()
.btn_popup_light(&self.scenario_name)
.btn_outline_light_popup(&self.scenario_name)
.hotkey(Key::S)
.build_widget(ctx, "change scenario"),
ctx.style()
.btn_secondary_light_icon_text("system/assets/tools/pencil.svg", "Edit map")
.btn_outline_light_icon_text("system/assets/tools/pencil.svg", "Edit map")
.hotkey(lctrl(Key::E))
.build_widget(ctx, "edit map"),
])
@ -133,7 +133,7 @@ impl GameplayState for PlayScenario {
if self.scenario_name != "empty" {
Widget::row(vec![
ctx.style()
.btn_primary_light_icon("system/assets/tools/pencil.svg")
.btn_solid_light_icon("system/assets/tools/pencil.svg")
.build_widget(ctx, "edit traffic patterns")
.centered_vert(),
format!("{} modifications to traffic patterns", self.modifiers.len())
@ -183,7 +183,7 @@ impl EditScenarioModifiers {
Widget::row(vec![
m.describe().draw_text(ctx).centered_vert(),
ctx.style()
.btn_primary_destructive_icon("system/assets/tools/trash.svg")
.btn_solid_destructive_icon("system/assets/tools/trash.svg")
.build_widget(ctx, &format!("delete modifier {}", idx + 1))
.align_right(),
])
@ -193,29 +193,29 @@ impl EditScenarioModifiers {
}
rows.push(
ctx.style()
.btn_primary_dark_text("Change trip mode")
.btn_solid_dark_text("Change trip mode")
.build_def(ctx),
);
rows.push(
ctx.style()
.btn_primary_dark_text("Add extra new trips")
.btn_solid_dark_text("Add extra new trips")
.build_def(ctx),
);
rows.push(Widget::row(vec![
Spinner::new(ctx, (2, 14), 2).named("repeat_days"),
ctx.style()
.btn_primary_dark_text("Repeat schedule multiple days")
.btn_solid_dark_text("Repeat schedule multiple days")
.build_def(ctx),
]));
rows.push(Widget::horiz_separator(ctx, 0.5));
rows.push(
Widget::row(vec![
ctx.style()
.btn_primary_dark_text("Apply")
.btn_solid_dark_text("Apply")
.hotkey(Key::Enter)
.build_def(ctx),
ctx.style()
.btn_primary_dark_text("Discard changes")
.btn_solid_dark_text("Discard changes")
.hotkey(Key::Escape)
.build_def(ctx),
])
@ -374,11 +374,11 @@ impl ChangeMode {
]),
Widget::row(vec![
ctx.style()
.btn_primary_dark_text("Apply")
.btn_solid_dark_text("Apply")
.hotkey(Key::Enter)
.build_def(ctx),
ctx.style()
.btn_primary_dark_text("Discard changes")
.btn_solid_dark_text("Discard changes")
.hotkey(Key::Escape)
.build_def(ctx),
])

View File

@ -742,7 +742,7 @@ impl TutorialState {
.btn_prev()
.disabled(self.current.stage == self.stages.len() - 1)
.build_widget(ctx, "next tutorial"),
ctx.style().btn_secondary_light_text("Quit").build_def(ctx),
ctx.style().btn_outline_light_text("Quit").build_def(ctx),
])
.centered()];
{
@ -772,7 +772,7 @@ impl TutorialState {
if edit_map {
col.push(
ctx.style()
.btn_secondary_light_icon_text("system/assets/tools/pencil.svg", "Edit map")
.btn_outline_light_icon_text("system/assets/tools/pencil.svg", "Edit map")
.hotkey(lctrl(Key::E))
.build_widget(ctx, "edit map"),
);
@ -833,7 +833,7 @@ impl TutorialState {
if self.current.part == self.stage().messages.len() - 1 {
controls.push(
ctx.style()
.btn_primary_dark_text("Try it")
.btn_solid_dark_text("Try it")
.hotkey(hotkeys(vec![Key::RightArrow, Key::Space, Key::Enter]))
.build_def(ctx),
);

View File

@ -156,7 +156,7 @@ fn make_btn(ctx: &mut EventCtx, num: usize) -> Widget {
_ => format!("Record {} intersections", num),
};
ctx.style()
.btn_primary_dark_text(&title)
.btn_solid_dark_text(&title)
.disabled(num == 0)
.hotkey(Key::Enter)
.build_widget(ctx, "record")

View File

@ -432,7 +432,7 @@ impl AgentMeter {
Widget::nothing()
},
ctx.style()
.btn_primary_light_icon("system/assets/meters/trip_histogram.svg")
.btn_solid_light_icon("system/assets/meters/trip_histogram.svg")
.hotkey(Key::Q)
.build_widget(ctx, "more data")
.align_right(),
@ -452,7 +452,7 @@ impl AgentMeter {
.centered_vert(),
format!("{} trips captured", prettyprint_usize(n)).draw_text(ctx),
ctx.style()
.btn_primary_dark_text("Stop")
.btn_solid_dark_text("Stop")
.build_def(ctx)
.align_right(),
]));

View File

@ -48,7 +48,7 @@ impl SpeedControls {
row.push({
let button = ctx
.style()
.btn_primary_light_icon("system/assets/speed/triangle.svg")
.btn_solid_light_icon("system/assets/speed/triangle.svg")
.hotkey(Key::Space);
Widget::custom_row(vec![if self.paused {
@ -80,10 +80,7 @@ impl SpeedControls {
.btn_plain_light()
.image_path("system/assets/speed/triangle.svg")
.image_dims(ScreenDims::new(16.0, 26.0))
.bg_color(
ctx.style().btn_primary_light.bg_hover,
ControlState::Hovered,
)
.bg_color(ctx.style().btn_solid_light.bg_hover, ControlState::Hovered)
.tooltip(txt)
.padding(EdgeInsets {
top: 8.0,
@ -101,7 +98,7 @@ impl SpeedControls {
if self.setting < s {
triangle_btn = triangle_btn.image_color(
ctx.style().btn_secondary_light.fg_disabled,
ctx.style().btn_outline_light.fg_disabled,
ControlState::Default,
)
}
@ -111,8 +108,8 @@ impl SpeedControls {
.collect(),
)
// Inner buttons, styled as one composite button w/ background/border
.bg(ctx.style().btn_primary_light.bg)
.outline(2.0, ctx.style().btn_primary_light.outline)
.bg(ctx.style().btn_solid_light.bg)
.outline(2.0, ctx.style().btn_solid_light.outline)
.margin_right(16),
);
@ -137,10 +134,7 @@ impl SpeedControls {
let buttons = ctx
.style()
.btn_plain_light()
.bg_color(
ctx.style().btn_primary_light.bg_hover,
ControlState::Hovered,
)
.bg_color(ctx.style().btn_solid_light.bg_hover, ControlState::Hovered)
.image_dims(ScreenDims::square(20.0));
Widget::custom_row(vec![
buttons
@ -157,8 +151,8 @@ impl SpeedControls {
])
}
// Inner buttons, styled as one composite button w/ background/border
.bg(ctx.style().btn_primary_light.bg)
.outline(2.0, ctx.style().btn_primary_light.outline),
.bg(ctx.style().btn_solid_light.bg)
.outline(2.0, ctx.style().btn_solid_light.outline),
);
self.panel = Panel::new(Widget::custom_row(row))

View File

@ -36,11 +36,11 @@ impl JumpToTime {
ctx.style().btn_close_widget(ctx),
Widget::custom_row(vec![
ctx.style()
.btn_primary_dark_text("Jump to time")
.btn_solid_dark_text("Jump to time")
.disabled(true)
.build_def(ctx),
ctx.style()
.btn_primary_dark_text("Jump to delay")
.btn_solid_dark_text("Jump to delay")
.hotkey(Key::D)
.build_def(ctx),
])
@ -171,11 +171,11 @@ impl JumpToDelay {
ctx.style().btn_close_widget(ctx),
Widget::custom_row(vec![
ctx.style()
.btn_primary_dark_text("Jump to time")
.btn_solid_dark_text("Jump to time")
.hotkey(Key::T)
.build_def(ctx),
ctx.style()
.btn_primary_dark_text("Jump to delay")
.btn_solid_dark_text("Jump to delay")
.disabled(true)
.build_def(ctx),
])
@ -296,7 +296,7 @@ impl TimeWarpScreen {
Widget::col(vec![
Text::new().draw(ctx).named("text"),
ctx.style()
.btn_primary_dark_text("stop now")
.btn_solid_dark_text("stop now")
.hotkey(Key::Escape)
.build_def(ctx)
.centered_horiz(),
@ -475,7 +475,7 @@ fn compare_count(after: usize, before: usize) -> String {
fn build_jump_to_time_btn(ctx: &EventCtx, target: Time) -> Widget {
ctx.style()
.btn_primary_dark_text(&format!("Jump to {}", target.ampm_tostring()))
.btn_solid_dark_text(&format!("Jump to {}", target.ampm_tostring()))
.hotkey(Key::Enter)
.build_widget(ctx, "jump to time")
.centered_horiz()
@ -484,7 +484,7 @@ fn build_jump_to_time_btn(ctx: &EventCtx, target: Time) -> Widget {
fn build_jump_to_delay_button(ctx: &EventCtx, delay: Duration) -> Widget {
ctx.style()
.btn_primary_dark_text(&format!("Jump to next {} delay", delay))
.btn_solid_dark_text(&format!("Jump to next {} delay", delay))
.hotkey(Key::Enter)
.build_widget(ctx, "jump to delay")
.centered_horiz()

View File

@ -35,19 +35,19 @@ impl UberTurnPicker {
ctx.style().btn_close_widget(ctx),
]),
ctx.style()
.btn_secondary_light_text("View uber-turns")
.btn_outline_light_text("View uber-turns")
.hotkey(Key::Enter)
.build_def(ctx),
ctx.style()
.btn_secondary_light_text("Edit")
.btn_outline_light_text("Edit")
.hotkey(Key::E)
.build_def(ctx),
ctx.style()
.btn_secondary_light_text("Detect all clusters")
.btn_outline_light_text("Detect all clusters")
.hotkey(Key::D)
.build_def(ctx),
ctx.style()
.btn_secondary_light_text("Preview merged intersection")
.btn_outline_light_text("Preview merged intersection")
.hotkey(Key::P)
.build_def(ctx),
]))

View File

@ -78,14 +78,14 @@ impl MainState {
Text::new().draw(ctx).named("current info"),
Widget::col(vec![
ctx.style()
.btn_secondary_light_text("quit")
.btn_outline_light_text("quit")
.hotkey(Key::Escape)
.build_def(ctx),
ctx.style()
.btn_secondary_light_text("export to OSM")
.btn_outline_light_text("export to OSM")
.build_def(ctx),
ctx.style()
.btn_secondary_light_text("preview all intersections")
.btn_outline_light_text("preview all intersections")
.hotkey(Key::G)
.build_def(ctx),
]),

View File

@ -260,7 +260,7 @@ impl OptionsPanel {
.bg(app.cs().section_bg)
.padding(8),
ctx.style()
.btn_primary_dark_text("Apply")
.btn_solid_dark_text("Apply")
.hotkey(Key::Enter)
.build_def(ctx)
.centered_horiz(),

View File

@ -62,7 +62,7 @@ impl<A: AppLike + 'static> CityPicker<A> {
let btn = ctx
.style()
.btn_secondary_light_text(nice_map_name(&name))
.btn_outline_light_text(nice_map_name(&name))
.label_color(color, ControlState::Default)
.no_tooltip();
@ -87,7 +87,7 @@ impl<A: AppLike + 'static> CityPicker<A> {
continue;
}
// If there's only one map in the city, make the button directly load it.
let button = ctx.style().btn_secondary_light_text(&city);
let button = ctx.style().btn_outline_light_text(&city);
let maps = MapName::list_all_maps_in_city(&city);
if maps.len() == 1 {
other_cities.push(button.build_widget(ctx, &maps[0].path()));
@ -97,7 +97,7 @@ impl<A: AppLike + 'static> CityPicker<A> {
}
other_cities.push(
ctx.style()
.btn_primary_dark_text("Search all maps")
.btn_solid_dark_text("Search all maps")
.hotkey(Key::Tab)
.build_def(ctx),
);
@ -134,7 +134,7 @@ impl<A: AppLike + 'static> CityPicker<A> {
]),
if cfg!(not(target_arch = "wasm32")) {
ctx.style()
.btn_secondary_light_text("Download more cities")
.btn_outline_light_text("Download more cities")
.build_def(ctx)
} else {
Widget::nothing()
@ -272,7 +272,7 @@ impl<A: AppLike + 'static> AllCityPicker<A> {
for name in MapName::list_all_maps() {
buttons.push(
ctx.style()
.btn_secondary_light_text(&name.describe())
.btn_outline_light_text(&name.describe())
.build_widget(ctx, &name.path())
.margin_right(10)
.margin_below(10),

View File

@ -32,7 +32,7 @@ impl Navigator {
)
.named("street"),
ctx.style()
.btn_secondary_light_text("Search by business name or address")
.btn_outline_light_text("Search by business name or address")
.hotkey(Key::Tab)
.build_def(ctx),
]))
@ -239,7 +239,7 @@ impl SearchBuildings {
)
.named("bldg"),
ctx.style()
.btn_secondary_light_text("Search for streets")
.btn_outline_light_text("Search for streets")
.hotkey(Key::Tab)
.build_def(ctx),
]))

View File

@ -84,7 +84,7 @@ impl<A: AppLike + 'static> PromptInput<A> {
]),
Widget::text_entry(ctx, String::new(), true).named("input"),
ctx.style()
.btn_secondary_light_text("confirm")
.btn_outline_light_text("confirm")
.hotkey(Key::Enter)
.build_def(ctx),
]))
@ -162,7 +162,7 @@ impl PopupMsg {
panel: Panel::new(Widget::col(vec![
txt.draw(ctx),
ctx.style()
.btn_primary_dark_text("OK")
.btn_solid_dark_text("OK")
.hotkey(hotkeys(vec![Key::Enter, Key::Escape]))
.build_def(ctx),
]))

View File

@ -48,11 +48,7 @@ impl<A: AppLike + 'static> Picker<A> {
prettyprint_bytes(bytes).draw_text(ctx).centered_vert(),
]));
}
col.push(
ctx.style()
.btn_primary_dark_text("Sync files")
.build_def(ctx),
);
col.push(ctx.style().btn_solid_dark_text("Sync files").build_def(ctx));
Box::new(Picker {
panel: Panel::new(Widget::col(col)).build(ctx),

View File

@ -53,7 +53,7 @@ impl Viewer {
Widget::row(vec![
"Change map:".draw_text(ctx),
ctx.style()
.btn_popup_light(nice_map_name(app.map.get_name()))
.btn_outline_light_popup(nice_map_name(app.map.get_name()))
.hotkey(lctrl(Key::L))
.build_widget(ctx, "change map"),
]),
@ -74,7 +74,7 @@ impl Viewer {
biz_search_panel.unwrap_or_else(|| b.render(ctx).named("Search for businesses"))
} else {
ctx.style()
.btn_primary_dark_text("Search for businesses")
.btn_solid_dark_text("Search for businesses")
.hotkey(Key::Tab)
.build_def(ctx)
},
@ -98,13 +98,13 @@ impl Viewer {
col.push(
Widget::row(vec![
ctx.style()
.btn_primary_dark_text(&format!(
.btn_solid_dark_text(&format!(
"Open OSM way {}",
r.orig_id.osm_way_id.0
))
.build_widget(ctx, &format!("open {}", r.orig_id.osm_way_id)),
ctx.style()
.btn_primary_dark_text("Edit OSM way")
.btn_solid_dark_text("Edit OSM way")
.build_widget(
ctx,
&format!(
@ -144,7 +144,7 @@ impl Viewer {
let i = app.map.get_i(i);
col.push(
ctx.style()
.btn_primary_dark_text(&format!("Open OSM node {}", i.orig_id.0))
.btn_solid_dark_text(&format!("Open OSM node {}", i.orig_id.0))
.build_widget(ctx, &format!("open {}", i.orig_id)),
);
}
@ -152,7 +152,7 @@ impl Viewer {
let b = app.map.get_b(b);
col.push(
ctx.style()
.btn_primary_dark_text(&format!("Open OSM ID {}", b.orig_id.inner()))
.btn_solid_dark_text(&format!("Open OSM ID {}", b.orig_id.inner()))
.build_widget(ctx, &format!("open {}", b.orig_id)),
);
@ -200,7 +200,7 @@ impl Viewer {
let pl = app.map.get_pl(pl);
col.push(
ctx.style()
.btn_primary_dark_text(&format!("Open OSM ID {}", pl.osm_id.inner()))
.btn_solid_dark_text(&format!("Open OSM ID {}", pl.osm_id.inner()))
.build_widget(ctx, &format!("open {}", pl.osm_id)),
);
@ -447,7 +447,7 @@ impl BusinessSearch {
let mut col = Vec::new();
col.push(
ctx.style()
.btn_primary_dark_text("Hide business search")
.btn_solid_dark_text("Hide business search")
.hotkey(Key::Tab)
.build_def(ctx),
);

View File

@ -135,7 +135,7 @@ impl ParkingMapper {
Widget::row(vec![
"Change map:".draw_text(ctx),
ctx.style()
.btn_popup_light(nice_map_name(map.get_name()))
.btn_outline_light_popup(nice_map_name(map.get_name()))
.build_widget(ctx, "change map"),
]),
format!(
@ -180,7 +180,7 @@ impl ParkingMapper {
]),
Checkbox::checkbox(ctx, "max 3 days parking (default in Seattle)", None, false),
ctx.style()
.btn_secondary_light_text("Generate OsmChange file")
.btn_outline_light_text("Generate OsmChange file")
.build_def(ctx),
"Select a road".draw_text(ctx).named("info"),
]))

View File

@ -96,7 +96,7 @@ impl Strategize {
let panel = Panel::new(Widget::col(vec![
txt.draw(ctx),
ctx.style()
.btn_primary_dark_text("Back to title screen")
.btn_solid_dark_text("Back to title screen")
.hotkey(Key::Enter)
.build_def(ctx),
Widget::row(vec![
@ -197,7 +197,7 @@ impl Results {
Panel::new(Widget::col(vec![
txt.draw(ctx),
ctx.style()
.btn_primary_dark_text("OK")
.btn_solid_dark_text("OK")
.hotkey(Key::Enter)
.build_def(ctx),
]))

View File

@ -300,7 +300,7 @@ fn make_upzone_panel(ctx: &mut EventCtx, app: &App, num_picked: usize) -> Panel
if app.session.upzones_unlocked == 0 {
return Panel::new(
ctx.style()
.btn_primary_dark_text("Start game")
.btn_solid_dark_text("Start game")
.hotkey(Key::Enter)
.build_def(ctx)
.container(),
@ -332,23 +332,23 @@ fn make_upzone_panel(ctx: &mut EventCtx, app: &App, num_picked: usize) -> Panel
]),
Widget::row(vec![
ctx.style()
.btn_secondary_light_text("Randomly choose upzones")
.btn_outline_light_text("Randomly choose upzones")
.disabled(num_picked == app.session.upzones_unlocked)
.build_def(ctx),
ctx.style()
.btn_secondary_light_text("Clear upzones")
.btn_outline_light_text("Clear upzones")
.disabled(num_picked == 0)
.build_def(ctx)
.align_right(),
]),
if num_picked == app.session.upzones_unlocked {
ctx.style()
.btn_primary_dark_text("Start game")
.btn_solid_dark_text("Start game")
.hotkey(Key::Enter)
.build_def(ctx)
} else {
ctx.style()
.btn_primary_dark_text("Finish upzoning before playing")
.btn_solid_dark_text("Finish upzoning before playing")
.disabled(true)
.build_def(ctx)
},

View File

@ -111,10 +111,10 @@ impl Inner {
Checkbox::new(
play_music,
ctx.style()
.btn_primary_light_icon("system/assets/tools/volume_off.svg")
.btn_solid_light_icon("system/assets/tools/volume_off.svg")
.build(ctx, "play music"),
ctx.style()
.btn_primary_light_icon("system/assets/tools/volume_on.svg")
.btn_solid_light_icon("system/assets/tools/volume_on.svg")
.build(ctx, "mute music"),
)
.named("play music")

View File

@ -24,7 +24,7 @@ impl TitleScreen {
SimpleState::new(
Panel::new(Widget::col(vec![
ctx.style()
.btn_secondary_light_icon_text("system/assets/tools/quit.svg", "Quit")
.btn_outline_light_icon_text("system/assets/tools/quit.svg", "Quit")
.hotkey(Key::Escape)
.build_widget(ctx, "quit")
.align_right()
@ -54,7 +54,7 @@ impl TitleScreen {
.centered_horiz(),
Widget::custom_row(level_buttons).flex_wrap(ctx, Percent::int(80)),
Widget::row(vec![
ctx.style().btn_primary_light_text("Credits").build_def(ctx),
ctx.style().btn_solid_light_text("Credits").build_def(ctx),
"Created by Dustin Carlino, Yuwen Li, & Michael Kirk"
.draw_text(ctx)
.container()
@ -181,7 +181,7 @@ impl Credits {
link(ctx, "Music from various sources", "https://github.com/dabreegster/abstreet/tree/master/data/system/assets/music/sources.md"),
link(ctx, "Fonts and icons by various sources", "https://dabreegster.github.io/abstreet/howto/#data-source-licensing"),
"Playtesting by Fridgehaus".draw_text(ctx),
ctx.style().btn_primary_dark_text("Back").hotkey(Key::Enter).build_def(ctx).centered_horiz(),
ctx.style().btn_solid_dark_text("Back").hotkey(Key::Enter).build_def(ctx).centered_horiz(),
]))
.build(ctx), Box::new(Credits))
}

View File

@ -4,65 +4,57 @@ use crate::{
};
pub trait StyledButtons<'a> {
fn btn_primary_dark(&self) -> ButtonBuilder<'a>;
fn btn_primary_dark_text(&self, text: &'a str) -> ButtonBuilder<'a> {
self.btn_primary_dark().label_text(text)
fn btn_solid_dark(&self) -> ButtonBuilder<'a>;
fn btn_solid_dark_text(&self, text: &'a str) -> ButtonBuilder<'a> {
self.btn_solid_dark().label_text(text)
}
fn btn_primary_dark_icon(&self, image_path: &'a str) -> ButtonBuilder<'a> {
icon_button(self.btn_primary_dark().image_path(image_path))
fn btn_solid_dark_icon(&self, image_path: &'a str) -> ButtonBuilder<'a> {
icon_button(self.btn_solid_dark().image_path(image_path))
}
fn btn_primary_dark_icon_text(&self, image_path: &'a str, text: &'a str) -> ButtonBuilder<'a> {
self.btn_primary_dark()
fn btn_solid_dark_icon_text(&self, image_path: &'a str, text: &'a str) -> ButtonBuilder<'a> {
self.btn_solid_dark()
.label_text(text)
.image_path(image_path)
.image_dims(ScreenDims::square(18.0))
}
fn btn_secondary_dark(&self) -> ButtonBuilder<'a>;
fn btn_secondary_dark_text(&self, text: &'a str) -> ButtonBuilder<'a> {
self.btn_secondary_dark().label_text(text)
fn btn_outline_dark(&self) -> ButtonBuilder<'a>;
fn btn_outline_dark_text(&self, text: &'a str) -> ButtonBuilder<'a> {
self.btn_outline_dark().label_text(text)
}
fn btn_secondary_dark_icon(&self, image_path: &'a str) -> ButtonBuilder<'a> {
icon_button(self.btn_secondary_dark().image_path(image_path))
fn btn_outline_dark_icon(&self, image_path: &'a str) -> ButtonBuilder<'a> {
icon_button(self.btn_outline_dark().image_path(image_path))
}
fn btn_secondary_dark_icon_text(
&self,
image_path: &'a str,
text: &'a str,
) -> ButtonBuilder<'a> {
self.btn_secondary_dark()
fn btn_outline_dark_icon_text(&self, image_path: &'a str, text: &'a str) -> ButtonBuilder<'a> {
self.btn_outline_dark()
.label_text(text)
.image_path(image_path)
.image_dims(ScreenDims::square(18.0))
}
fn btn_primary_light(&self) -> ButtonBuilder<'a>;
fn btn_primary_light_text(&self, text: &'a str) -> ButtonBuilder<'a> {
self.btn_primary_light().label_text(text)
fn btn_solid_light(&self) -> ButtonBuilder<'a>;
fn btn_solid_light_text(&self, text: &'a str) -> ButtonBuilder<'a> {
self.btn_solid_light().label_text(text)
}
fn btn_primary_light_icon(&self, image_path: &'a str) -> ButtonBuilder<'a> {
icon_button(self.btn_primary_light().image_path(image_path))
fn btn_solid_light_icon(&self, image_path: &'a str) -> ButtonBuilder<'a> {
icon_button(self.btn_solid_light().image_path(image_path))
}
fn btn_primary_light_icon_text(&self, image_path: &'a str, text: &'a str) -> ButtonBuilder<'a> {
self.btn_primary_light()
fn btn_solid_light_icon_text(&self, image_path: &'a str, text: &'a str) -> ButtonBuilder<'a> {
self.btn_solid_light()
.label_text(text)
.image_path(image_path)
.image_dims(ScreenDims::square(18.0))
}
fn btn_secondary_light(&self) -> ButtonBuilder<'a>;
fn btn_secondary_light_text(&self, text: &'a str) -> ButtonBuilder<'a> {
self.btn_secondary_light().label_text(text)
fn btn_outline_light(&self) -> ButtonBuilder<'a>;
fn btn_outline_light_text(&self, text: &'a str) -> ButtonBuilder<'a> {
self.btn_outline_light().label_text(text)
}
fn btn_secondary_light_icon(&self, image_path: &'a str) -> ButtonBuilder<'a> {
icon_button(self.btn_secondary_light().image_path(image_path))
fn btn_outline_light_icon(&self, image_path: &'a str) -> ButtonBuilder<'a> {
icon_button(self.btn_outline_light().image_path(image_path))
}
fn btn_secondary_light_icon_text(
&self,
image_path: &'a str,
text: &'a str,
) -> ButtonBuilder<'a> {
self.btn_secondary_light()
fn btn_outline_light_icon_text(&self, image_path: &'a str, text: &'a str) -> ButtonBuilder<'a> {
self.btn_outline_light()
.label_text(text)
.image_path(image_path)
.image_dims(ScreenDims::square(18.0))
@ -107,37 +99,37 @@ pub trait StyledButtons<'a> {
icon_button(self.btn_plain_destructive().image_path(image_path))
}
fn btn_primary_destructive(&self) -> ButtonBuilder<'a>;
fn btn_primary_destructive_text(&self, text: &'a str) -> ButtonBuilder<'a> {
self.btn_primary_destructive().label_text(text)
fn btn_solid_destructive(&self) -> ButtonBuilder<'a>;
fn btn_solid_destructive_text(&self, text: &'a str) -> ButtonBuilder<'a> {
self.btn_solid_destructive().label_text(text)
}
fn btn_primary_destructive_icon(&self, image_path: &'a str) -> ButtonBuilder<'a> {
icon_button(self.btn_primary_destructive().image_path(image_path))
fn btn_solid_destructive_icon(&self, image_path: &'a str) -> ButtonBuilder<'a> {
icon_button(self.btn_solid_destructive().image_path(image_path))
}
fn btn_primary_destructive_icon_text(
fn btn_solid_destructive_icon_text(
&self,
image_path: &'a str,
text: &'a str,
) -> ButtonBuilder<'a> {
self.btn_primary_destructive()
self.btn_solid_destructive()
.label_text(text)
.image_path(image_path)
.image_dims(ScreenDims::square(18.0))
}
fn btn_secondary_destructive(&self) -> ButtonBuilder<'a>;
fn btn_secondary_destructive_text(&self, text: &'a str) -> ButtonBuilder<'a> {
self.btn_secondary_destructive().label_text(text)
fn btn_outline_destructive(&self) -> ButtonBuilder<'a>;
fn btn_outline_destructive_text(&self, text: &'a str) -> ButtonBuilder<'a> {
self.btn_outline_destructive().label_text(text)
}
fn btn_secondary_destructive_icon(&self, image_path: &'a str) -> ButtonBuilder<'a> {
icon_button(self.btn_secondary_destructive().image_path(image_path))
fn btn_outline_destructive_icon(&self, image_path: &'a str) -> ButtonBuilder<'a> {
icon_button(self.btn_outline_destructive().image_path(image_path))
}
fn btn_secondary_destructive_icon_text(
fn btn_outline_destructive_icon_text(
&self,
image_path: &'a str,
text: &'a str,
) -> ButtonBuilder<'a> {
self.btn_secondary_destructive()
self.btn_outline_destructive()
.label_text(text)
.image_path(image_path)
.image_dims(ScreenDims::square(18.0))
@ -146,37 +138,37 @@ pub trait StyledButtons<'a> {
// Specific UI Elements
/// title: name of previous screen, which you'll return to
fn btn_back_light(&self, title: &'a str) -> ButtonBuilder<'a> {
fn btn_light_back(&self, title: &'a str) -> ButtonBuilder<'a> {
back_button(self.btn_plain_light(), title)
}
/// title: name of previous screen, which you'll return to
fn btn_back_dark(&self, title: &'a str) -> ButtonBuilder<'a> {
fn btn_dark_back(&self, title: &'a str) -> ButtonBuilder<'a> {
back_button(self.btn_plain_dark(), title)
}
fn btn_primary_light_dropdown(&self) -> ButtonBuilder<'a> {
dropdown_button(self.btn_primary_light())
fn btn_solid_light_dropdown(&self) -> ButtonBuilder<'a> {
dropdown_button(self.btn_solid_light())
}
fn btn_secondary_light_dropdown(&self) -> ButtonBuilder<'a> {
dropdown_button(self.btn_secondary_light())
fn btn_outline_light_dropdown(&self) -> ButtonBuilder<'a> {
dropdown_button(self.btn_outline_light())
}
fn btn_primary_dark_dropdown(&self) -> ButtonBuilder<'a> {
dropdown_button(self.btn_primary_dark())
fn btn_solid_dark_dropdown(&self) -> ButtonBuilder<'a> {
dropdown_button(self.btn_solid_dark())
}
fn btn_secondary_dark_dropdown(&self) -> ButtonBuilder<'a> {
dropdown_button(self.btn_secondary_dark())
fn btn_outline_dark_dropdown(&self) -> ButtonBuilder<'a> {
dropdown_button(self.btn_outline_dark())
}
fn btn_popup_light(&self, text: &'a str) -> ButtonBuilder<'a> {
self.btn_secondary_light_dropdown().label_text(text)
fn btn_outline_light_popup(&self, text: &'a str) -> ButtonBuilder<'a> {
self.btn_outline_light_dropdown().label_text(text)
}
fn btn_popup_dark(&self, text: &'a str) -> ButtonBuilder<'a> {
self.btn_secondary_dark_dropdown().label_text(text)
fn btn_outline_dark_popup(&self, text: &'a str) -> ButtonBuilder<'a> {
self.btn_outline_dark_dropdown().label_text(text)
}
/// A right facing caret, like ">", suitable for paging to the "next" set of results
@ -204,17 +196,17 @@ pub trait StyledButtons<'a> {
}
/// A button which renders its hotkey for discoverability along with its label.
fn btn_hotkey_light(&self, label: &str, key: Key) -> ButtonBuilder<'a>;
fn btn_solid_light_hotkey(&self, label: &str, key: Key) -> ButtonBuilder<'a>;
}
use crate::{Key, Line, Text};
impl<'a> StyledButtons<'a> for Style {
fn btn_hotkey_light(&self, label: &str, key: Key) -> ButtonBuilder<'a> {
fn btn_solid_light_hotkey(&self, label: &str, key: Key) -> ButtonBuilder<'a> {
let default = {
let mut txt = Text::new();
let key_txt = Line(key.describe()).fg(self.hotkey_color);
txt.append(key_txt);
let label_text = Line(format!(" - {}", label)).fg(self.btn_primary_light.fg);
let label_text = Line(format!(" - {}", label)).fg(self.btn_solid_light.fg);
txt.append(label_text);
txt
};
@ -223,59 +215,59 @@ impl<'a> StyledButtons<'a> for Style {
let mut txt = Text::new();
let key_txt = Line(key.describe()).fg(self.hotkey_color.alpha(0.3));
txt.append(key_txt);
let label_text = Line(format!(" - {}", label)).fg(self.btn_primary_light.fg_disabled);
let label_text = Line(format!(" - {}", label)).fg(self.btn_solid_light.fg_disabled);
txt.append(label_text);
txt
};
self.btn_primary_light()
self.btn_solid_light()
.label_styled_text(default, ControlState::Default)
.label_styled_text(disabled, ControlState::Disabled)
.hotkey(key)
}
fn btn_primary_dark(&self) -> ButtonBuilder<'a> {
let colors = &self.btn_primary_dark;
fn btn_solid_dark(&self) -> ButtonBuilder<'a> {
let colors = &self.btn_solid_dark;
plain_builder(colors).outline(2.0, colors.outline, ControlState::Default)
}
fn btn_secondary_dark(&self) -> ButtonBuilder<'a> {
let colors = &self.btn_secondary_dark;
fn btn_outline_dark(&self) -> ButtonBuilder<'a> {
let colors = &self.btn_outline_dark;
plain_builder(colors).outline(2.0, colors.outline, ControlState::Default)
}
fn btn_plain_dark(&self) -> ButtonBuilder<'a> {
let colors = &self.btn_secondary_dark;
let colors = &self.btn_outline_dark;
plain_builder(colors)
}
fn btn_primary_light(&self) -> ButtonBuilder<'a> {
let colors = &self.btn_primary_light;
fn btn_solid_light(&self) -> ButtonBuilder<'a> {
let colors = &self.btn_solid_light;
plain_builder(colors).outline(2.0, colors.outline, ControlState::Default)
}
fn btn_secondary_light(&self) -> ButtonBuilder<'a> {
let colors = &self.btn_secondary_light;
fn btn_outline_light(&self) -> ButtonBuilder<'a> {
let colors = &self.btn_outline_light;
plain_builder(colors).outline(2.0, colors.outline, ControlState::Default)
}
fn btn_plain_light(&self) -> ButtonBuilder<'a> {
let colors = &self.btn_secondary_light;
let colors = &self.btn_outline_light;
plain_builder(colors)
}
fn btn_plain_destructive(&self) -> ButtonBuilder<'a> {
let colors = &self.btn_secondary_destructive;
let colors = &self.btn_outline_destructive;
plain_builder(colors)
}
fn btn_primary_destructive(&self) -> ButtonBuilder<'a> {
let colors = &self.btn_primary_destructive;
fn btn_solid_destructive(&self) -> ButtonBuilder<'a> {
let colors = &self.btn_solid_destructive;
plain_builder(colors).outline(2.0, colors.outline, ControlState::Default)
}
fn btn_secondary_destructive(&self) -> ButtonBuilder<'a> {
let colors = &self.btn_secondary_destructive;
fn btn_outline_destructive(&self) -> ButtonBuilder<'a> {
let colors = &self.btn_outline_destructive;
plain_builder(colors).outline(2.0, colors.outline, ControlState::Default)
}
}

View File

@ -10,12 +10,12 @@ pub struct Style {
pub hotkey_color: Color,
pub hovering_color: Color,
pub loading_tips: Text,
pub btn_primary_dark: ButtonStyle,
pub btn_secondary_dark: ButtonStyle,
pub btn_primary_light: ButtonStyle,
pub btn_secondary_light: ButtonStyle,
pub btn_primary_destructive: ButtonStyle,
pub btn_secondary_destructive: ButtonStyle,
pub btn_solid_dark: ButtonStyle,
pub btn_outline_dark: ButtonStyle,
pub btn_solid_light: ButtonStyle,
pub btn_outline_light: ButtonStyle,
pub btn_solid_destructive: ButtonStyle,
pub btn_outline_destructive: ButtonStyle,
}
#[derive(Clone)]
@ -39,7 +39,7 @@ impl Style {
loading_tips: Text::new(),
// Buttons
btn_primary_dark: ButtonStyle {
btn_solid_dark: ButtonStyle {
fg: hex("#4C4C4C"),
fg_disabled: hex("#4C4C4C").alpha(0.3),
bg: Color::WHITE.alpha(0.8),
@ -47,7 +47,7 @@ impl Style {
bg_disabled: Color::grey(0.6),
outline: Color::WHITE.alpha(0.6),
},
btn_secondary_dark: ButtonStyle {
btn_outline_dark: ButtonStyle {
fg: hex("#4C4C4C"),
fg_disabled: hex("#4C4C4C").alpha(0.3),
bg: Color::CLEAR,
@ -55,7 +55,7 @@ impl Style {
bg_disabled: Color::grey(0.8),
outline: hex("#4C4C4C"),
},
btn_primary_light: ButtonStyle {
btn_solid_light: ButtonStyle {
fg: hex("#F2F2F2"),
fg_disabled: hex("#F2F2F2").alpha(0.3),
bg: hex("#003046").alpha(0.8),
@ -63,7 +63,7 @@ impl Style {
bg_disabled: Color::grey(0.1),
outline: hex("#003046").alpha(0.6),
},
btn_secondary_light: ButtonStyle {
btn_outline_light: ButtonStyle {
fg: hex("#F2F2F2"),
fg_disabled: hex("#F2F2F2").alpha(0.3),
bg: Color::CLEAR,
@ -71,7 +71,7 @@ impl Style {
bg_disabled: Color::grey(0.5),
outline: hex("#F2F2F2"),
},
btn_primary_destructive: ButtonStyle {
btn_solid_destructive: ButtonStyle {
fg: hex("#F2F2F2"),
fg_disabled: hex("#F2F2F2").alpha(0.3),
bg: hex("#FF5E5E").alpha(0.8),
@ -79,7 +79,7 @@ impl Style {
bg_disabled: Color::grey(0.1),
outline: hex("#FF5E5E").alpha(0.6),
},
btn_secondary_destructive: ButtonStyle {
btn_outline_destructive: ButtonStyle {
fg: hex("#FF5E5E"),
fg_disabled: hex("#FF5E5E").alpha(0.3),
bg: Color::CLEAR,

View File

@ -63,15 +63,15 @@ impl Checkbox {
.style()
.btn_plain_light()
.image_color(
RewriteColor::Change(Color::BLACK, ctx.style().btn_primary_light.bg),
RewriteColor::Change(Color::BLACK, ctx.style().btn_solid_light.bg),
ControlState::Default,
)
.image_color(
RewriteColor::Change(Color::BLACK, ctx.style().btn_primary_light.bg_hover),
RewriteColor::Change(Color::BLACK, ctx.style().btn_solid_light.bg_hover),
ControlState::Hovered,
)
.image_color(
RewriteColor::Change(Color::BLACK, ctx.style().btn_primary_light.bg_disabled),
RewriteColor::Change(Color::BLACK, ctx.style().btn_solid_light.bg_disabled),
ControlState::Disabled,
)
.label_text(label)
@ -106,15 +106,15 @@ impl Checkbox {
.style()
.btn_plain_light()
.image_color(
RewriteColor::Change(Color::BLACK, ctx.style().btn_primary_light.bg),
RewriteColor::Change(Color::BLACK, ctx.style().btn_solid_light.bg),
ControlState::Default,
)
.image_color(
RewriteColor::Change(Color::BLACK, ctx.style().btn_primary_light.bg_hover),
RewriteColor::Change(Color::BLACK, ctx.style().btn_solid_light.bg_hover),
ControlState::Hovered,
)
.image_color(
RewriteColor::Change(Color::BLACK, ctx.style().btn_primary_light.bg_disabled),
RewriteColor::Change(Color::BLACK, ctx.style().btn_solid_light.bg_disabled),
ControlState::Disabled,
)
.label_styled_text(Text::from_all(spans), ControlState::Default)
@ -200,7 +200,7 @@ impl Checkbox {
})
// TODO: make these clickable. Currently they would explode due to re-use of an action
.disabled(true)
.label_color(ctx.style().btn_secondary_light.fg, ControlState::Disabled)
.label_color(ctx.style().btn_outline_light.fg, ControlState::Disabled)
.bg_color(Color::CLEAR, ControlState::Disabled);
let right_text_button = left_text_button.clone().label_text(right_label);
Widget::row(vec![

View File

@ -176,7 +176,7 @@ impl<T: 'static + Clone> WidgetImpl for Dropdown<T> {
fn make_btn(ctx: &EventCtx, label: &str, tooltip: &str, is_persisten_split: bool) -> Button {
use crate::StyledButtons;
// If we want to make Dropdown configurable, pass in or expose its button builder?
let mut builder = ctx.style().btn_primary_light_dropdown();
let mut builder = ctx.style().btn_solid_light_dropdown();
if is_persisten_split {
// Quick hacks to make PersistentSplit's dropdown look a little better.
// It's not ideal, but we only use one persistent split in the whole app

View File

@ -71,7 +71,7 @@ impl<T: 'static + PartialEq + Clone + std::fmt::Debug> PersistentSplit<T> {
fn button_builder<'a>(ctx: &EventCtx) -> ButtonBuilder<'a> {
use crate::{ControlState, StyledButtons};
ctx.style()
.btn_primary_light()
.btn_solid_light()
.outline(0.0, Color::CLEAR, ControlState::Default)
}

View File

@ -101,7 +101,7 @@ impl<A, T, F> Table<A, T, F> {
.map(|col| {
if self.sort_by == col.name {
ctx.style()
.btn_primary_dark_icon_text("tmp", &col.name)
.btn_solid_dark_icon_text("tmp", &col.name)
.image_bytes(if self.descending {
include_labeled_bytes!("../../icons/arrow_down.svg")
} else {
@ -110,7 +110,7 @@ impl<A, T, F> Table<A, T, F> {
.label_first()
.build_widget(ctx, &col.name)
} else if let Col::Sortable(_) = col.col {
ctx.style().btn_primary_dark_text(&col.name).build_def(ctx)
ctx.style().btn_solid_dark_text(&col.name).build_def(ctx)
} else {
Line(&col.name).draw(ctx).centered_vert()
}

View File

@ -316,49 +316,49 @@ fn make_controls(ctx: &mut EventCtx) -> Panel {
Widget::row(vec![
Widget::col(vec![
Text::from(Line("Neutral Dark")).bg(Color::CLEAR).draw(ctx),
btn.btn_primary_dark_text("Primary")
.build_widget(ctx, "btn_primary_dark_text"),
btn.btn_solid_dark_text("Primary")
.build_widget(ctx, "btn_solid_dark_text"),
Widget::row(vec![
btn.btn_primary_dark_icon("system/assets/tools/map.svg")
.build_widget(ctx, "btn_primary_dark_icon_1"),
btn.btn_primary_dark_icon("system/assets/tools/layers.svg")
.build_widget(ctx, "btn_primary_dark_icon_2"),
btn.btn_solid_dark_icon("system/assets/tools/map.svg")
.build_widget(ctx, "btn_solid_dark_icon_1"),
btn.btn_solid_dark_icon("system/assets/tools/layers.svg")
.build_widget(ctx, "btn_solid_dark_icon_2"),
]),
btn.btn_primary_dark_icon_text("system/assets/tools/location.svg", "Primary")
.build_widget(ctx, "btn_primary_dark_icon_text"),
btn.btn_secondary_dark_text("Secondary")
.build_widget(ctx, "btn_secondary_dark_text"),
btn.btn_solid_dark_icon_text("system/assets/tools/location.svg", "Primary")
.build_widget(ctx, "btn_solid_dark_icon_text"),
btn.btn_outline_dark_text("Secondary")
.build_widget(ctx, "btn_outline_dark_text"),
Widget::row(vec![
btn.btn_secondary_dark_icon("system/assets/tools/map.svg")
.build_widget(ctx, "btn_secondary_dark_icon_1"),
btn.btn_secondary_dark_icon("system/assets/tools/layers.svg")
.build_widget(ctx, "btn_secondary_dark_icon_2"),
btn.btn_outline_dark_icon("system/assets/tools/map.svg")
.build_widget(ctx, "btn_outline_dark_icon_1"),
btn.btn_outline_dark_icon("system/assets/tools/layers.svg")
.build_widget(ctx, "btn_outline_dark_icon_2"),
]),
btn.btn_secondary_dark_icon_text("system/assets/tools/home.svg", "Secondary")
.build_widget(ctx, "btn_secondary_dark_icon_text"),
btn.btn_outline_dark_icon_text("system/assets/tools/home.svg", "Secondary")
.build_widget(ctx, "btn_outline_dark_icon_text"),
]),
Widget::col(vec![
Text::from(Line("Neutral Light")).bg(Color::CLEAR).draw(ctx),
btn.btn_primary_light_text("Primary")
.build_widget(ctx, "btn_primary_light_text"),
btn.btn_solid_light_text("Primary")
.build_widget(ctx, "btn_solid_light_text"),
Widget::row(vec![
btn.btn_primary_light_icon("system/assets/tools/home.svg")
.build_widget(ctx, "btn_primary_light_icon_1"),
btn.btn_primary_light_icon("system/assets/tools/location.svg")
.build_widget(ctx, "btn_primary_light_icon_2"),
btn.btn_solid_light_icon("system/assets/tools/home.svg")
.build_widget(ctx, "btn_solid_light_icon_1"),
btn.btn_solid_light_icon("system/assets/tools/location.svg")
.build_widget(ctx, "btn_solid_light_icon_2"),
]),
btn.btn_primary_light_icon_text("system/assets/tools/map.svg", "Primary")
.build_widget(ctx, "btn_primary_light_icon_text"),
btn.btn_secondary_light_text("Secondary")
.build_widget(ctx, "btn_secondary_light_text"),
btn.btn_solid_light_icon_text("system/assets/tools/map.svg", "Primary")
.build_widget(ctx, "btn_solid_light_icon_text"),
btn.btn_outline_light_text("Secondary")
.build_widget(ctx, "btn_outline_light_text"),
Widget::row(vec![
btn.btn_secondary_light_icon("system/assets/tools/home.svg")
.build_widget(ctx, "btn_secondary_light_icon_1"),
btn.btn_secondary_light_icon("system/assets/tools/location.svg")
.build_widget(ctx, "btn_secondary_light_icon_2"),
btn.btn_outline_light_icon("system/assets/tools/home.svg")
.build_widget(ctx, "btn_outline_light_icon_1"),
btn.btn_outline_light_icon("system/assets/tools/location.svg")
.build_widget(ctx, "btn_outline_light_icon_2"),
]),
btn.btn_secondary_light_icon_text("system/assets/tools/layers.svg", "Secondary")
.build_widget(ctx, "btn_secondary_light_icon_text"),
btn.btn_outline_light_icon_text("system/assets/tools/layers.svg", "Secondary")
.build_widget(ctx, "btn_outline_light_icon_text"),
]),
]),
Text::from(
@ -368,13 +368,13 @@ fn make_controls(ctx: &mut EventCtx) -> Panel {
)
.draw(ctx),
Widget::row(vec![
btn.btn_primary_light_icon("system/assets/tools/layers.svg")
btn.btn_solid_light_icon("system/assets/tools/layers.svg")
.build_widget(ctx, "btn_height_icon"),
btn.btn_primary_light_text("text")
btn.btn_solid_light_text("text")
.build_widget(ctx, "btn_height_text"),
btn.btn_secondary_light_icon_text("system/assets/tools/layers.svg", "icon+text")
btn.btn_outline_light_icon_text("system/assets/tools/layers.svg", "icon+text")
.build_widget(ctx, "btn_height_icon_text"),
btn.btn_popup_light("popup")
btn.btn_outline_light_popup("popup")
.build_widget(ctx, "btn_height_popup"),
widgetry::Spinner::new(ctx, (0, 11), 1),
]),
@ -382,7 +382,7 @@ fn make_controls(ctx: &mut EventCtx) -> Panel {
widgetry::Spinner::new(ctx, (0, 11), 1),
Widget::row(vec![
ctx.style()
.btn_secondary_light_text("New faces")
.btn_outline_light_text("New faces")
.hotkey(Key::F)
.build_widget(ctx, "generate new faces"),
Checkbox::switch(ctx, "Draw scrollable canvas", None, true),
@ -396,11 +396,11 @@ fn make_controls(ctx: &mut EventCtx) -> Panel {
Checkbox::new(
false,
ctx.style()
.btn_primary_light_text("Pause")
.btn_solid_light_text("Pause")
.hotkey(Key::Space)
.build(ctx, "pause the stopwatch"),
ctx.style()
.btn_primary_light_text("Resume")
.btn_solid_light_text("Resume")
.hotkey(Key::Space)
.build(ctx, "resume the stopwatch"),
)
@ -416,7 +416,7 @@ fn make_controls(ctx: &mut EventCtx) -> Panel {
],
),
ctx.style()
.btn_secondary_light_text("Reset Timer")
.btn_outline_light_text("Reset Timer")
.build_widget(ctx, "reset the stopwatch"),
])
.evenly_spaced(),
@ -455,7 +455,7 @@ fn make_controls(ctx: &mut EventCtx) -> Panel {
],
),
ctx.style()
.btn_secondary_light_text("Apply")
.btn_outline_light_text("Apply")
.build_widget(ctx, "apply"),
])
.margin_above(30),