Commit Graph

27 Commits

Author SHA1 Message Date
Michael Kirk
af079c24e6 rename txt.add -> txt.add_line 2021-03-19 17:48:30 -07:00
Michael Kirk
affd582093 more concise Text / tooltip() 2021-03-19 16:48:54 -07:00
Dustin Carlino
65d7bc5c8e Rename {Text,TextSpan}::draw to into_widget, for consistency. #253 2021-03-09 09:59:30 -08:00
Dustin Carlino
a4a20ce1e5 draw_text renamed to text_widget, for consistency. #253 2021-03-09 09:56:41 -08:00
Michael Kirk
86799e2832 Remove StyledButtons - instead implement everything on the individual
ButtonStyle
2021-02-27 21:08:26 -08:00
Dustin Carlino
378122a329 Specify trip purpose when importing external scenario data. 2021-02-25 11:00:43 -08:00
Michael Kirk
d774aeae44 rename toggle/checkbox 2021-02-24 14:59:47 -08:00
Michael Kirk
3ab7fc4361
Fix tooltips and hotkey for day-theme (#528) 2021-02-24 10:52:57 -08:00
Michael Kirk
e6ed2e67de Collapse button styles to be theme specified (no visible changes).
Button colors are now determined by the color scheme, but for now all
schemes are hardcoded to use the same "night" button colors. Read on for
rationale...

Previously, which button colors to use (dark/light) was specified inline
while building the UI.

Eventually we want to live in a world where color scheme determines:
- panel colors
- button colors
- text colors

The theme could already choose panel colors easily enough, but because
the buttons and text were not determined by theme, choosing anything
other than a black or dark grey panel color makes the buttons and text
unreadable.

This PR tackled the themeable "button colors" portion, but all themes
continue to use the "night" colors for now, because using the actual
"day" colors would still make the text unreadable.

next up: themeable text!

The one intentional regression is within the pregame tutorial,
which has always been styled differently from the rest of the app. An
expeditious hack has caused the prev/next/continue buttons to lose their
visible hover state. I'll restore this upon completing the day theme
work.
2021-02-23 09:52:33 -08:00
Dustin Carlino
73e405e382 Upgrade most dependencies 2021-02-03 18:13:06 -08:00
Dustin Carlino
ca07c522ea Remove the exit buttons from the 15 min tool, osm viewer, and parking
mapper. Closes #482

The X buttons are confusingly no-ops on the web, and redundant on
native, since people know how to close a window.

Also fix up a few button styles in the smaller tools.
2021-01-28 09:58:47 -08:00
Dustin Carlino
341ce834e3 Based on startup params, display an extra 'study area' on the map. cyipt/actdev#44 2021-01-27 13:00:48 -08:00
Michael Kirk
1990642dee More conventional button names
This was all done by search/replace, and should not affect
functionality.

Goals:

- be consistent with the figma terminology.
- consistently order:
  "btn_{solid|outline|plain}_{dark|light}_{text|image|dropdown|back|etc}"
2021-01-22 13:11:42 -06:00
Dustin Carlino
c9c6f240ae Remove timer.{note, warn, error} in favor of the log crate. #262
Originally, the intention of the deleted calls was to not interrupt
Timer progress bars with warnings. But the output of things like the
importer is impossible to read anyway. Strongly considering explicitly
sending logs and timing info to separate places and using something like
multitail for live progress.

Unplumb timer from LOADS of places that just needed it for logging.
2021-01-21 19:22:02 -08:00
Michael Kirk
a2c5ce0fb3 regex upgrade Btn::text_fg: No hotkeys, inline &str
Btn\:\:text_fg\("([^"]*)"\).build_def\(ctx, None\)
ctx.style().btn_secondary_light_text("$1").build_def(ctx)
2021-01-21 15:25:46 -08:00
Michael Kirk
bfb190a730 manually update remaining Btn::text_bg2 2021-01-21 15:25:46 -08:00
Michael Kirk
ea39fecf03 replace Btn::pop_up 2021-01-21 15:25:46 -08:00
Michael Kirk
52880c68d8 replace Btn::custom in switch and checkboxes
(also add SVG checkboxes!)
2021-01-21 09:08:41 -08:00
Michael Kirk
743b74510d
replace Btn::close with new style (#463) 2021-01-19 16:17:11 -08:00
Dustin Carlino
b1dda3628f Start all UI apps except for game by loading a map using the async interface. This lets someone on the web immediately start with any map based on URL params. And it's one step towards removing the montlake file from being hardcoded in the wasm. #344
Demo: http://0.0.0.0:8000/?salzburg/maps/south.bin when running the 15m
tool locally
2021-01-09 14:45:33 -08:00
Dustin Carlino
e99def9124 Switch all error handling to anyhow. Nothing consumes our code as a
library yet, so this is a step forward from string errors. Manually
tested how errors show up (including the nice with_context bit).
2021-01-05 11:35:03 -08:00
Dustin Carlino
bfa208ce6a Parameterize widgetry on a way to read SVG files. This is one of the last steps to remove the dependency on abstio. #253 2021-01-04 09:53:24 -08:00
Dustin Carlino
965d999199 Upgrade misc other dependencies 2021-01-03 20:01:27 -08:00
Dustin Carlino
df04fd7e18 Give SimpleApp a way to stash session-wide state. First use case is high scores for the experiment. 2020-12-04 15:08:15 -08:00
Dustin Carlino
f3ff910c37 Cleanup from the great app split:
- move show_zorder into DrawMap
- reorganize modules in map_gui

Next is to reorganize/collapse modules in game.
2020-11-23 17:58:32 -08:00
Dustin Carlino
6568c9e959 Add mouseover to the split parking mapper, sadly just by copying a simpler version of the code... 2020-11-23 17:58:32 -08:00
Dustin Carlino
ad0d1ae7a4 Split out the OSM parking mapper into a separate app, temporarily
WITHOUT mouseover.
2020-11-23 17:58:32 -08:00