Commit Graph

377 Commits

Author SHA1 Message Date
Dustin Carlino
002b41816d Actually, generalize UnzoomedLines to handle circles too. Make the route sketcher nicer to use at all zoom levels! 2021-10-18 17:54:58 -07:00
Dustin Carlino
749a7384c1 Make the route sketcher tool use UnzoomedLines, making it much easier to see the route on large maps.
Note the draggable waypoint circles are still a fixed size; you can't
easily manipulate the route when unzoomed far.
2021-10-18 17:54:58 -07:00
Dustin Carlino
b5cca3f18c Refactor a helper to draw unzoomed thick lines at a constant width.
To start, just make the bike network use this.
2021-10-18 17:54:58 -07:00
Dustin Carlino
a643c35014 Long overdue round of clippy 2021-10-18 13:52:10 -07:00
Dustin Carlino
7d57deb8ae Move the focus state from Panel up to widgetry in general, so two different panels don't clash 2021-10-14 17:57:03 -07:00
Dustin Carlino
698e26a831 Use Outcome::Focused to match existing semantics better 2021-10-14 17:57:03 -07:00
Dustin Carlino
b024fa958a It's hard to focus...
While dragging a card or using a dropdown or persistent split menu,
prevent other widgets in the same panel from handling events.
2021-10-14 17:57:03 -07:00
Michael Kirk
56323116e1 Don't show details widget until 2+ waypoints
Otherwise there's no route, also this helps focus on the "add waypoint"
instructions.
2021-10-11 19:42:03 -07:00
Michael Kirk
738c4ab865 clean up set_hovering tooltip style 2021-10-11 16:03:05 -07:00
Michael Kirk
476f19142f
Consistent panel width (#772)
* reorder tabs: plan trip before adding lanes

This order of tasks should be more logical for most people.

* Copy tweaks

"trip" is better than "route" since you don't pick the route, only the
start/end points. The route is inferred based on the available roads.

* Smaller elevation plot

it was much wider than any other UI element, meaning the column
dramatically jumps sizes when switching to this tab.

* better align line-plot x-axis

* Avoid jittering UI while switching through tabs.

* fixup! Avoid jittering UI while switching through tabs.

* fixup! Copy tweaks

* fixup! reorder tabs: plan trip before adding lanes

* fixup! Copy tweaks
2021-10-11 15:02:41 -07:00
Dustin Carlino
a8e9a1fd08 Variable rename for more clear code; feedback from #764 2021-10-07 14:51:28 -07:00
Dustin Carlino
ddbadd2da3 Make waypoints and routes coexist in the same World. #763 [rebuild] [release]
The pattern is somewhat similar to how different components share a
Panel. The "outer-most" piece owns the World, calls into InputWaypoints
to fill out the World, and plumbs un-handled events to it.

Also handle a tricky low-level bug with ctx.normal_left_click() and
detecting drags vs clicks.

Now finally there's no buggy conflicts between dragging waypoints and
hovering on the alternate routes!
2021-10-03 14:28:44 -07:00
Dustin Carlino
41465c341b Convert the new bike routing tool to use World. #763
This one is the most complicated, and it's still not done, but it's not
any buggier than the ad-hoc implementation. I still need to figure out
how to merge the two worlds of waypoints and routes.

This one also required a large, but mechanical, refactor to lift
ToggleZoomed and the concept of unzoomed/zoomed from map_gui to
widgetry.
2021-10-03 14:28:44 -07:00
Dustin Carlino
43f8a6d1e7 Convert the signal demand dashboard to World. #763 2021-10-03 14:28:44 -07:00
Dustin Carlino
5a37e223c0 Cut over the story map tool to the brave new World. #763
Figure out how to make objects both clickable and draggable!
2021-10-03 14:28:44 -07:00
Dustin Carlino
8524cfce12 Create a new map-space World abstraction, and change the polygon editor to use it. #763 2021-10-03 14:28:44 -07:00
Dustin Carlino
4ddfe66afd Finally clean up txt.with_bg. The last few uses were actually illegible from the default color! 2021-09-29 13:34:46 -07:00
Dustin Carlino
c4d38ca591 A humble start to showing an alternate, low-stress route. #743 2021-09-27 13:13:11 -07:00
Dustin Carlino
d365213948 Small refactor: {road, lane}.length() 2021-09-26 11:08:44 -07:00
Dustin Carlino
632a527dbc Consolidate the route results panel on the left side, as a first step towards Mara's design. #743 2021-09-21 09:09:34 -07:00
Dustin Carlino
f14b7eb9e7 Calculating and showing network gaps, wiring up filters. #448 2021-09-20 14:42:02 -07:00
Gedalia Kott
d833f82c73 Fix Issue #692:settings for metric VS imperial distance units are repsected for distance 2021-09-18 14:06:32 -07:00
Dustin Carlino
dd49caec4a When dragging the canvas is interrupted, clean up the state properly, cancelling the drag. #754 2021-09-17 14:05:14 -07:00
Dustin Carlino
cca701fb3e Show traffic signals along route. #743 2021-09-17 12:27:00 -07:00
Michael Kirk
83ebc96bb1 drag/drop uses system grabbable/grabbing cursor 2021-09-10 15:17:15 -07:00
Michael Kirk
577192bb89 style row header 2021-09-10 15:17:15 -07:00
Michael Kirk
09fcca8533 left-align vertical drag/drops 2021-09-10 15:17:15 -07:00
Michael Kirk
3b1ed1f82f fix button v alignment,
Also: use standard interaction color when dragging, not the primary
orange color.
2021-09-10 15:17:15 -07:00
Michael Kirk
84b3d87c37 refactor uninted to be builder method, not constructor. it composes better this way 2021-09-10 15:17:15 -07:00
Michael Kirk
a0ea2ba14e use btn_close instead of "X"s 2021-09-10 15:17:15 -07:00
Dustin Carlino
8147f49093 Work around widgetry focus problem -- allow space or enter to choose a menu entry. Proper fix started and problem described more in #739. 2021-09-10 13:54:47 -07:00
Dustin Carlino
2598f2a15d Workaround spinners with f64s that wind up with 0.0000001 drift 2021-09-08 08:00:49 -07:00
Dustin Carlino
27a712bcc3 Remove buttons from map_editor map loader -- very slow and not useful 2021-09-07 15:39:55 -07:00
Dustin Carlino
b231ba602f Drag-n-drop for waypoints! #743
Also some drag-n-drop API tweaks:
- Don't require the caller to set `named()`
- Vertical card layout!

Some UX issues:
- deletion button alignment
- horizontal card alignment off
- sync up highlighting between map and cards
- selection state for a waypoint is meaningless
2021-09-03 13:23:17 -07:00
Dustin Carlino
1c756befa8 Hover on route, to show elevation on line plot. #743
Some messiness, but step forward.
2021-09-01 18:20:48 -07:00
Dustin Carlino
30a114a483 Improve the bike network tool's colors. Always draw the fog-of-war, and
highlight road types better.  #743
2021-09-01 17:07:57 -07:00
Dustin Carlino
ba6f9f4a14 When hovering on the elevation line plot, show the equivalent position
on the route. #743
2021-09-01 13:18:30 -07:00
Dustin Carlino
69d965ea3e Use the new drag-drop widget for traffic signal editor stages! 2021-08-30 09:02:00 -07:00
Dustin Carlino
e924e9d7df Simplify the buttons for picking a stage in the traffic signal editor,
in preparation for dragon-drop.

These were using MultiButtons, a widgetry concept kind of redundant with
DrawWithTooltips. I think at some point we had more visual mapping
between the stage icon and the intersection on the map, to help when
synchronizing many intersections. But the functionality remaining today
just looks like clicking one intersection inside the icon, which is
barely noticeable and not helpful, so sacrifice this to proceed.
2021-08-30 08:41:29 -07:00
Dustin Carlino
1c9aaac17f Show drop position on the map while dragging lane cards 2021-08-29 16:40:54 -07:00
Dustin Carlino
93fb9a274f
Organize bike lane buffer types into a dropdown (#724)
Organize lane types in the editor. All buffer types expressed as a dropdown, and lanes for moving/not moving are grouped.
2021-08-25 14:12:17 -07:00
Michael Kirk
ae80eb2509
road editor design tweaks (#737)
- regroup sections to avoid undesirable inner rounding
- move panel away from edge
- make tabs more obvious with "shadow" on bottom of unselected tabs
2021-08-25 12:21:05 -07:00
Dustin Carlino
9761373c4b Don't recalculate map hover state in the middle of dragging 2021-08-25 11:47:10 -07:00
Dustin Carlino
6c3ce23e5f Use a cross-hatch pattern to show edited roads, instead of that bizarre
cyan.

For the moment, just to simplify things, bake the edited color into the
bike network layer. Probably will split it out later, maybe moving the
proposal management to the legend row.
2021-08-24 15:50:19 -07:00
Dustin Carlino
78222ffadb Preserve the same Layers object through all the states of the ungap tool. Do this by a "new" Transition that's allowed to consume the current state.
Alternatives considered:
- put Layers in the App struct, since it's shared -- but only for the
  ungap tool. It'd be nice to split it into its own standalone crate now,
  but it'll be some work to refactor edit mode out of game.
- put Layers in App session
2021-08-24 14:37:16 -07:00
Dustin Carlino
bddbe8af99 Followup to #728: highlight lanes on map when hovering on the cards 2021-08-24 10:58:04 -07:00
Dustin Carlino
b5015143cb Small drag-and-drop typo fixes 2021-08-24 10:27:43 -07:00
Michael Kirk
4e93b34ded restore proper shape/size/color/highlights of lane cards 2021-08-24 10:27:43 -07:00
Michael Kirk
03b15fae43 widgetry: dont grow widget as you're dragging
Otherwise the screen bizarrely grows/shrinks as you're dragging.
2021-08-24 10:27:43 -07:00
Michael Kirk
161e962bbc widgetry: dragondrop inserts at proper place, not swap, fixes offset 2021-08-24 10:27:43 -07:00