client work

This commit is contained in:
core 2025-01-07 12:07:50 -05:00
parent d27ba95d32
commit 1ee6707d39
Signed by: core
GPG key ID: 9D0DAED5555DD0B4

View file

@ -115,19 +115,30 @@ impl eframe::App for WxboxApp {
.show(ui.ctx(), |ui| { .show(ui.ctx(), |ui| {
ui.horizontal(|ui| { ui.horizontal(|ui| {
ui.hyperlink_to(attribution.text, attribution.url); ui.hyperlink_to(attribution.text, attribution.url);
}) });
ui.horizontal(|ui| {
ui.label("wxbox is made with <3 by ");
ui.hyperlink_to("core", "https://coredoes.dev");
ui.label(" and ");
ui.hyperlink_to("tm85", "https://u8.lc");
});
}); });
Window::new("wxbox") Window::new("wxbox")
.resizable(false) .resizable(false)
.show(ui.ctx(), |ui| { .show(ui.ctx(), |ui| {
ui.label("Welcome to wxbox!") ui.heading("Welcome to wxbox!");
ui.label("We're glad you're here; Open up the Datasource panel to get started.");
ui.label("If you're using a mouse, you can click and drag to move around and Ctrl+Scroll to zoom.");
ui.label("On a touch-based device like a trackpad or touchscreen, you can tap/click and drag to move around and two-finger pinch to zoom.");
ui.label("You can close this window by clicking the arrow to the left of it's title.");
}); });
let mut need_to_reset_for_next_frame = false; let mut need_to_reset_for_next_frame = false;
Window::new("Datasource") Window::new("Datasource")
.resizable(false) .resizable(false)
.default_open(false)
.show(ui.ctx(), |ui| { .show(ui.ctx(), |ui| {
ui.collapsing("NOAA", |ui| { ui.collapsing("NOAA", |ui| {
ui.collapsing("Multi-Radar Multi-Sensor", |ui| { ui.collapsing("Multi-Radar Multi-Sensor", |ui| {
@ -150,43 +161,36 @@ impl eframe::App for WxboxApp {
} }
}); });
}); });
}); ui.separator();
egui::Grid::new("dsconfig_grid")
Window::new("Datasource Settings") .num_columns(2)
.resizable(false) .spacing([40.0, 4.0])
.show(ui.ctx(), |ui| { .striped(true)
let mut ui_builder = UiBuilder::new(); .show(ui, |ui| {
ui.scope_builder(ui_builder, |ui| { ui.label("Data opacity");
egui::Grid::new("dsconfig_grid") if ui.add(egui::Slider::new(&mut tile_request_options.data_transparency, 0.0..=1.0).suffix("%").custom_formatter(
.num_columns(2) |u, v| {
.spacing([40.0, 4.0]) egui::emath::format_with_decimals_in_range(u * 100.0, v)
.striped(true)
.show(ui, |ui| {
ui.label("Data opacity");
if ui.add(egui::Slider::new(&mut tile_request_options.data_transparency, 0.0..=1.0).suffix("%").custom_formatter(
|u, v| {
egui::emath::format_with_decimals_in_range(u * 100.0, v)
}
)).changed() {
need_to_reset_for_next_frame = true;
} }
ui.end_row(); )).changed() {
need_to_reset_for_next_frame = true;
}
ui.end_row();
ui.label("Show range folded areas"); ui.label("Show range folded areas");
if ui.add(toggle(&mut tile_request_options.show_range_folded)).changed() { if ui.add(toggle(&mut tile_request_options.show_range_folded)).changed() {
need_to_reset_for_next_frame = true; need_to_reset_for_next_frame = true;
} }
ui.end_row(); ui.end_row();
ui.label("Range folded color"); ui.label("Range folded color");
if ui.color_edit_button_srgba(rf_color).changed() { if ui.color_edit_button_srgba(rf_color).changed() {
let color = rf_color.to_array(); let color = rf_color.to_array();
let single_number = u32::from_be_bytes(color); let single_number = u32::from_be_bytes(color);
tile_request_options.range_folded_color = single_number; tile_request_options.range_folded_color = single_number;
need_to_reset_for_next_frame = true; need_to_reset_for_next_frame = true;
} }
}) })
})
}); });
if need_to_reset_for_next_frame { if need_to_reset_for_next_frame {