add a button to give feedback [rebuild]

This commit is contained in:
Dustin Carlino 2020-05-22 14:48:26 -07:00
parent 6bde4d231d
commit ce7d28b188
4 changed files with 41 additions and 6 deletions

17
Cargo.lock generated
View File

@ -1060,6 +1060,7 @@ dependencies = [
"serde 1.0.110 (registry+https://github.com/rust-lang/crates.io-index)",
"sim 0.1.0",
"walkdir 2.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"webbrowser 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
"xmltree 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -3943,6 +3944,15 @@ dependencies = [
"wasm-bindgen 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "webbrowser"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"widestring 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "webgl_generator"
version = "0.2.0"
@ -3977,6 +3987,11 @@ dependencies = [
"lalrpop-util 0.16.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "widestring"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "winapi"
version = "0.2.8"
@ -4549,9 +4564,11 @@ dependencies = [
"checksum wayland-scanner 0.23.6 (registry+https://github.com/rust-lang/crates.io-index)" = "93b02247366f395b9258054f964fe293ddd019c3237afba9be2ccbe9e1651c3d"
"checksum wayland-sys 0.23.6 (registry+https://github.com/rust-lang/crates.io-index)" = "d94e89a86e6d6d7c7c9b19ebf48a03afaac4af6bc22ae570e9a24124b75358f4"
"checksum web-sys 0.3.39 (registry+https://github.com/rust-lang/crates.io-index)" = "8bc359e5dd3b46cb9687a051d50a2fdd228e4ba7cf6fcf861a5365c3d671a642"
"checksum webbrowser 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "97d468a911faaaeb783693b004e1c62e0063e646b0afae5c146cd144e566e66d"
"checksum webgl_generator 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4d749d56274af7e25dfe9f7ed92d4f1e7452b2de3ea6208529f31048032b5895"
"checksum webgl_stdweb 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "04ce7301ae86629fd8d450c2c558a8faf3774d5500db4675bebbf97c5fbd2e30"
"checksum webidl 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d0f807f7488d680893f7188aa09d7672a3a0a8461975a098a2edf0a52e3fee29"
"checksum widestring 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "effc0e4ff8085673ea7b9b2e3c73f6bd4d118810c9009ed8f1e16bd96c331db6"
"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
"checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6"
"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"

View File

@ -29,6 +29,7 @@ rand_xorshift = "0.2.0"
reqwest = { version = "0.10.4", optional = true, default-features=false, features=["blocking", "default-tls"] }
serde = "1.0.110"
sim = { path = "../sim" }
webbrowser = "0.5.2"
xmltree = "0.10.0"
[build-dependencies]

View File

@ -159,6 +159,7 @@ impl OptionsPanel {
.margin(5)
.centered_horiz(),
])
.padding(10)
.bg(app.cs.panel_bg),
)
.build(ctx),

View File

@ -136,7 +136,10 @@ pub fn main_menu(ctx: &mut EventCtx, app: &App) -> Box<dyn State> {
])
.centered(),
Widget::col(vec![
Btn::text_bg2("About").build_def(ctx, None),
Widget::row(vec![
Btn::text_bg2("About").build_def(ctx, None).margin_right(20),
Btn::text_bg2("Feedback").build_def(ctx, None),
]),
built_info::time().draw(ctx),
])
.centered(),
@ -204,6 +207,13 @@ pub fn main_menu(ctx: &mut EventCtx, app: &App) -> Box<dyn State> {
"About",
Box::new(|ctx, _| Some(Transition::Push(about(ctx)))),
)
.cb(
"Feedback",
Box::new(|_, _| {
let _ = webbrowser::open("https://forms.gle/ocvbek1bTaZUr3k49");
None
}),
)
.cb(
"Community Proposals",
Box::new(|ctx, app| Some(Transition::Push(proposals_picker(ctx, app)))),
@ -234,10 +244,6 @@ fn about(ctx: &mut EventCtx) -> Box<dyn State> {
txt.add(Line("Created by Dustin Carlino, UX by Yuwen Li"));
txt.add(Line(""));
txt.add(Line("Map data from OpenStreetMap and King County GIS"));
// TODO Add more here
txt.add(Line(
"See full credits at https://github.com/dabreegster/abstreet#credits",
));
txt.add(Line(""));
// TODO Word wrapping please?
txt.add(Line(
@ -264,6 +270,9 @@ fn about(ctx: &mut EventCtx) -> Box<dyn State> {
txt.add(Line("Have the appropriate amount of fun."));
txt.draw(ctx).centered_horiz().align_vert_center()
},
Btn::text_bg2("See full credits")
.build_def(ctx, None)
.centered_horiz(),
];
ManagedGUIState::fullscreen(
@ -272,7 +281,14 @@ fn about(ctx: &mut EventCtx) -> Box<dyn State> {
.exact_size_percent(90, 85)
.build(ctx),
)
.cb("back", Box::new(|_, _| Some(Transition::Pop))),
.cb("back", Box::new(|_, _| Some(Transition::Pop)))
.cb(
"See full credits",
Box::new(|_, _| {
let _ = webbrowser::open("https://github.com/dabreegster/abstreet#credits");
None
}),
),
)
}