mirror of
https://github.com/Astatin3/unshell.git
synced 2026-06-08 22:38:01 -06:00
Add tiling windows
This commit is contained in:
Generated
+29
@@ -751,6 +751,25 @@ dependencies = [
|
|||||||
"winit",
|
"winit",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "egui_tiles"
|
||||||
|
version = "0.14.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ebfac3ca35f5e4fe217d3b03312111b234fe55ce059faf62b4cb47f7cf6d54f1"
|
||||||
|
dependencies = [
|
||||||
|
"ahash",
|
||||||
|
"egui",
|
||||||
|
"itertools",
|
||||||
|
"log",
|
||||||
|
"serde",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "either"
|
||||||
|
version = "1.15.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "emath"
|
name = "emath"
|
||||||
version = "0.33.2"
|
version = "0.33.2"
|
||||||
@@ -1300,6 +1319,15 @@ dependencies = [
|
|||||||
"windows-sys 0.61.2",
|
"windows-sys 0.61.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "itertools"
|
||||||
|
version = "0.14.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285"
|
||||||
|
dependencies = [
|
||||||
|
"either",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "itoa"
|
name = "itoa"
|
||||||
version = "1.0.15"
|
version = "1.0.15"
|
||||||
@@ -2686,6 +2714,7 @@ dependencies = [
|
|||||||
"eframe",
|
"eframe",
|
||||||
"egui",
|
"egui",
|
||||||
"egui_extras",
|
"egui_extras",
|
||||||
|
"egui_tiles",
|
||||||
"log",
|
"log",
|
||||||
"pretty_env_logger",
|
"pretty_env_logger",
|
||||||
"rand 0.9.2",
|
"rand 0.9.2",
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ log = "0.4.27"
|
|||||||
serde = { version = "1.0.219", features = ["derive"] }
|
serde = { version = "1.0.219", features = ["derive"] }
|
||||||
egui_extras = "0.33.2"
|
egui_extras = "0.33.2"
|
||||||
rand = "0.9.2"
|
rand = "0.9.2"
|
||||||
|
egui_tiles = "0.14.0"
|
||||||
|
|
||||||
# native:
|
# native:
|
||||||
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
||||||
|
|||||||
@@ -1,30 +1,37 @@
|
|||||||
use crate::{config::Config, flowchart::FlowChart};
|
use egui::Frame;
|
||||||
|
use egui_tiles::Tree;
|
||||||
|
|
||||||
|
use crate::app::{AppState, windows::WindowWrapper};
|
||||||
|
|
||||||
/// We derive Deserialize/Serialize so we can persist app state on shutdown.
|
/// We derive Deserialize/Serialize so we can persist app state on shutdown.
|
||||||
#[derive(serde::Deserialize, serde::Serialize)]
|
#[derive(serde::Deserialize, serde::Serialize)]
|
||||||
#[serde(default)] // if we add new fields, give them default values when deserializing old state
|
#[serde(default)] // if we add new fields, give them default values when deserializing old state
|
||||||
pub struct TemplateApp {
|
pub struct TemplateApp {
|
||||||
tab: Tab,
|
// tab: Tab,
|
||||||
|
state: AppState,
|
||||||
flowchart: FlowChart,
|
tree: Tree<WindowWrapper>,
|
||||||
config: Config,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(serde::Deserialize, serde::Serialize, PartialEq, Eq)]
|
|
||||||
pub enum Tab {
|
|
||||||
Flowchart,
|
|
||||||
Test,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for TemplateApp {
|
impl Default for TemplateApp {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
|
// let mut tiles = egui_tiles::Tiles::default();
|
||||||
|
|
||||||
|
// let invis_1 = tiles.insert_pane(WindowWrapper {
|
||||||
|
// nr: 0,
|
||||||
|
// window: AppWindow::None,
|
||||||
|
// });
|
||||||
|
// let invis_2 = tiles.insert_pane(WindowWrapper {
|
||||||
|
// nr: 0,
|
||||||
|
// window: AppWindow::None,
|
||||||
|
// });
|
||||||
|
|
||||||
|
// tiles.set_visible(invis_1, false);
|
||||||
|
// tiles.set_visible(invis_2, false);
|
||||||
|
// let root = tiles.insert_horizontal_tile(vec![invis_1]);
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
tab: Tab::Flowchart,
|
state: AppState::default(),
|
||||||
// Example stuff:
|
tree: egui_tiles::Tree::new_horizontal("tree_root", Vec::new()),
|
||||||
// label: "Hello World!".to_owned(),
|
|
||||||
// value: 2.7,
|
|
||||||
flowchart: FlowChart::new(),
|
|
||||||
config: Config::new(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -67,24 +74,14 @@ impl eframe::App for TemplateApp {
|
|||||||
ui.menu_button("View", |ui| {
|
ui.menu_button("View", |ui| {
|
||||||
ui.label("View");
|
ui.label("View");
|
||||||
|
|
||||||
if ui
|
self.state.labels(&mut self.tree, ui);
|
||||||
.selectable_label(self.tab == Tab::Flowchart, "Network")
|
|
||||||
.clicked()
|
|
||||||
{
|
|
||||||
self.tab = Tab::Flowchart;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ui
|
|
||||||
.selectable_label(self.tab == Tab::Test, self.config.title())
|
|
||||||
.clicked()
|
|
||||||
{
|
|
||||||
self.tab = Tab::Test;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| {
|
ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| {
|
||||||
egui::widgets::global_theme_preference_switch(ui);
|
egui::widgets::global_theme_preference_switch(ui);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// ui.style
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -95,13 +92,8 @@ impl eframe::App for TemplateApp {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
egui::CentralPanel::default().show(ctx, |ui| match self.tab {
|
egui::CentralPanel::default()
|
||||||
Tab::Flowchart => {
|
.frame(Frame::central_panel(&ctx.style()).inner_margin(0))
|
||||||
self.flowchart.paint(ui);
|
.show(ctx, |ui| self.tree.ui(&mut self.state, ui));
|
||||||
}
|
|
||||||
Tab::Test => {
|
|
||||||
self.config.update(ui);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,125 @@
|
|||||||
|
mod app;
|
||||||
|
mod windows;
|
||||||
|
|
||||||
|
use std::collections::HashMap;
|
||||||
|
|
||||||
|
pub use app::TemplateApp;
|
||||||
|
use egui_tiles::{TileId, Tree};
|
||||||
|
use log::info;
|
||||||
|
|
||||||
|
use crate::{app::windows::WindowWrapper, config::Config, flowchart::FlowChart};
|
||||||
|
|
||||||
|
#[derive(Default, serde::Deserialize, serde::Serialize)]
|
||||||
|
struct AppState {
|
||||||
|
pub open_windows: HashMap<AppWindow, TileId>,
|
||||||
|
|
||||||
|
pub flowchart: FlowChart,
|
||||||
|
pub config: Config,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl AppState {
|
||||||
|
pub fn labels(&mut self, tree: &mut Tree<WindowWrapper>, ui: &mut egui::Ui) {
|
||||||
|
for (i, (key, name)) in (vec![
|
||||||
|
(AppWindow::Flowchart, "Flowchart"),
|
||||||
|
(AppWindow::Config, "Config"),
|
||||||
|
])
|
||||||
|
.iter()
|
||||||
|
.enumerate()
|
||||||
|
{
|
||||||
|
let enabled = self.open_windows.contains_key(&key);
|
||||||
|
|
||||||
|
if ui.selectable_label(enabled, *name).clicked() {
|
||||||
|
// if enabled {
|
||||||
|
// let tid = *self.open_windows.get(&key).unwrap();
|
||||||
|
// tree.remove_recursively(tid);
|
||||||
|
// tree.tiles.remove(tid);
|
||||||
|
// self.open_windows.remove(&key);
|
||||||
|
|
||||||
|
// // if self.open_windows.is_empty()
|
||||||
|
// } else {
|
||||||
|
let tid = tree.tiles.insert_pane(WindowWrapper {
|
||||||
|
nr: i + 1,
|
||||||
|
window: *key,
|
||||||
|
});
|
||||||
|
|
||||||
|
match self.open_windows.len() {
|
||||||
|
0 => {
|
||||||
|
tree.root = Some(tid);
|
||||||
|
}
|
||||||
|
1 => {
|
||||||
|
let old_root = tree.root.unwrap();
|
||||||
|
let tab_id = tree.tiles.insert_tab_tile(vec![old_root, tid]);
|
||||||
|
tree.root = Some(tab_id);
|
||||||
|
}
|
||||||
|
_ => {
|
||||||
|
let pid = tree.tiles.insert_tab_tile(vec![tid]);
|
||||||
|
tree.move_tile_to_container(pid, tree.root.unwrap().clone(), 0, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
self.open_windows.insert(key.clone(), tid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// if ui
|
||||||
|
// .selectable_label(
|
||||||
|
// self.open_windows.contains_key(&AppWindow::Flowchart),
|
||||||
|
// "Network",
|
||||||
|
// )
|
||||||
|
// .clicked()
|
||||||
|
// {
|
||||||
|
// // self.open_windows. = Tab::Flowchart;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// if ui
|
||||||
|
// .selectable_label(self.open_windows.contains_key(&AppWindow::Config), "Config")
|
||||||
|
// .clicked()
|
||||||
|
// {
|
||||||
|
// // self.open_windows. = Tab::Flowchart;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// if ui
|
||||||
|
// .selectable_label(self.tab == Tab::Test, self.config.title())
|
||||||
|
// .clicked()
|
||||||
|
// {
|
||||||
|
// self.tab = Tab::Test;
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
// fn contains(&self, key: &AppWindow)
|
||||||
|
|
||||||
|
// fn toggle(&mut self, key: &AppWindow) {
|
||||||
|
// if self.
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
// impl Default for AppState {
|
||||||
|
// fn default() -> Self {
|
||||||
|
// Self {
|
||||||
|
// open_windows: HashMap::from([
|
||||||
|
// (AppWindow::Flowchart, false),
|
||||||
|
// (AppWindow::Config, false),
|
||||||
|
// ]),
|
||||||
|
|
||||||
|
// flowchart: Default::default(),
|
||||||
|
// config: Default::default(),
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
#[derive(Clone, Copy, serde::Deserialize, serde::Serialize, PartialEq, Eq, Hash)]
|
||||||
|
enum AppWindow {
|
||||||
|
None,
|
||||||
|
Flowchart,
|
||||||
|
Config,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl AppWindow {
|
||||||
|
fn update(&self, state: &mut AppState, ui: &mut egui::Ui) {
|
||||||
|
match self {
|
||||||
|
AppWindow::None => {}
|
||||||
|
AppWindow::Flowchart => state.flowchart.paint(ui),
|
||||||
|
AppWindow::Config => state.config.update(ui),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
use crate::app::{AppState, AppWindow};
|
||||||
|
|
||||||
|
#[derive(serde::Deserialize, serde::Serialize)]
|
||||||
|
pub struct WindowWrapper {
|
||||||
|
pub nr: usize,
|
||||||
|
pub window: AppWindow,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl egui_tiles::Behavior<WindowWrapper> for AppState {
|
||||||
|
fn tab_title_for_pane(&mut self, pane: &WindowWrapper) -> egui::WidgetText {
|
||||||
|
format!("Pane {}", pane.nr).into()
|
||||||
|
}
|
||||||
|
|
||||||
|
fn pane_ui(
|
||||||
|
&mut self,
|
||||||
|
ui: &mut egui::Ui,
|
||||||
|
_tile_id: egui_tiles::TileId,
|
||||||
|
pane: &mut WindowWrapper,
|
||||||
|
) -> egui_tiles::UiResponse {
|
||||||
|
let mut ret = egui_tiles::UiResponse::None;
|
||||||
|
|
||||||
|
ui.horizontal(|ui| {
|
||||||
|
let titlebar = ui.interact(
|
||||||
|
ui.max_rect(),
|
||||||
|
ui.id().with(&format!("Pane_{}_sense", pane.nr)),
|
||||||
|
egui::Sense::drag(),
|
||||||
|
);
|
||||||
|
|
||||||
|
if titlebar.drag_started() {
|
||||||
|
ret = egui_tiles::UiResponse::DragStarted;
|
||||||
|
}
|
||||||
|
if titlebar.hovered() {
|
||||||
|
ui.ctx().set_cursor_icon(egui::CursorIcon::Grab);
|
||||||
|
}
|
||||||
|
|
||||||
|
let color = egui::epaint::Hsva::new(0.103 * pane.nr as f32, 0.5, 0.5, 1.0);
|
||||||
|
ui.painter().rect_filled(ui.max_rect(), 0.0, color);
|
||||||
|
|
||||||
|
ui.label("Test");
|
||||||
|
});
|
||||||
|
|
||||||
|
pane.window.update(self, ui);
|
||||||
|
|
||||||
|
ret
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -15,8 +15,8 @@ enum ConfigState {
|
|||||||
EditConfig(usize, PayloadConfig),
|
EditConfig(usize, PayloadConfig),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Config {
|
impl Default for Config {
|
||||||
pub fn new() -> Self {
|
fn default() -> Self {
|
||||||
Self {
|
Self {
|
||||||
state: ConfigState::Base,
|
state: ConfigState::Base,
|
||||||
current_payloads: vec![PayloadConfig {
|
current_payloads: vec![PayloadConfig {
|
||||||
@@ -26,14 +26,16 @@ impl Config {
|
|||||||
}],
|
}],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn title(&self) -> &str {
|
impl Config {
|
||||||
match self.state {
|
// pub fn title(&self) -> &str {
|
||||||
ConfigState::Base => "Config",
|
// match self.state {
|
||||||
ConfigState::NewConfig(..) => "Config/New",
|
// ConfigState::Base => "Config",
|
||||||
ConfigState::EditConfig(..) => "Config/Edit",
|
// ConfigState::NewConfig(..) => "Config/New",
|
||||||
}
|
// ConfigState::EditConfig(..) => "Config/Edit",
|
||||||
}
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
pub fn update(&mut self, ui: &mut Ui) {
|
pub fn update(&mut self, ui: &mut Ui) {
|
||||||
match &mut self.state {
|
match &mut self.state {
|
||||||
|
|||||||
@@ -35,10 +35,6 @@ impl DraggableContainer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_pos(&self, center: &Pos2) -> Pos2 {
|
|
||||||
center.clone() + self.pos
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn show<R>(
|
pub fn show<R>(
|
||||||
&mut self,
|
&mut self,
|
||||||
ui: &mut egui::Ui,
|
ui: &mut egui::Ui,
|
||||||
@@ -82,17 +78,6 @@ impl DraggableContainer {
|
|||||||
let new_center = pointer_pos + self.drag_offset;
|
let new_center = pointer_pos + self.drag_offset;
|
||||||
self.pos = new_center - clip_center;
|
self.pos = new_center - clip_center;
|
||||||
}
|
}
|
||||||
|
|
||||||
// egui::Frame::default()
|
|
||||||
// .stroke(ui.visuals().widgets.noninteractive.bg_stroke)
|
|
||||||
// .corner_radius(ui.visuals().widgets.noninteractive.corner_radius)
|
|
||||||
// .show(ui, |ui| {
|
|
||||||
// ui.label(egui::RichText::new("Content").color(egui::Color32::WHITE));
|
|
||||||
// // self.frame.show(ui, |ui| {
|
|
||||||
// // ui.style_mut().wrap_mode = Some(egui::TextWrapMode::Extend);
|
|
||||||
// // ui.label(egui::RichText::new("Content").color(egui::Color32::WHITE));
|
|
||||||
// // });
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if response.drag_stopped() {
|
if response.drag_stopped() {
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
use egui::Scene;
|
use egui::{Color32, Painter, Pos2, Rect, Scene, Shape, Ui};
|
||||||
use egui::Shape;
|
|
||||||
use egui::Ui;
|
|
||||||
use egui::Vec2;
|
|
||||||
use egui::{Color32, Painter, Pos2, Rect};
|
|
||||||
|
|
||||||
use crate::flowchart::CONNECTION_STROKE;
|
use crate::flowchart::CONNECTION_STROKE;
|
||||||
use crate::flowchart::GROUP_BORDER_MARGIN;
|
use crate::flowchart::GROUP_BORDER_MARGIN;
|
||||||
@@ -19,8 +15,8 @@ pub struct FlowChart {
|
|||||||
pub groups: Vec<Vec<usize>>,
|
pub groups: Vec<Vec<usize>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl FlowChart {
|
impl Default for FlowChart {
|
||||||
pub fn new() -> Self {
|
fn default() -> Self {
|
||||||
let mut this = Self {
|
let mut this = Self {
|
||||||
scene_rect: Rect::ZERO,
|
scene_rect: Rect::ZERO,
|
||||||
containers: vec![
|
containers: vec![
|
||||||
@@ -41,7 +37,9 @@ impl FlowChart {
|
|||||||
|
|
||||||
this
|
this
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl FlowChart {
|
||||||
fn paint_bg(rect: &Rect, painter: &Painter) {
|
fn paint_bg(rect: &Rect, painter: &Painter) {
|
||||||
let h_start = (rect.min.x / TARGET_LINE_GAP).round() as i32;
|
let h_start = (rect.min.x / TARGET_LINE_GAP).round() as i32;
|
||||||
let h_end = ((rect.min.x + rect.width()) / TARGET_LINE_GAP).round() as i32 + 1;
|
let h_end = ((rect.min.x + rect.width()) / TARGET_LINE_GAP).round() as i32 + 1;
|
||||||
@@ -56,19 +54,13 @@ impl FlowChart {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn paint_groups(
|
fn paint_groups(groups: &Vec<Vec<usize>>, containers: &Vec<DraggableContainer>, ui: &mut Ui) {
|
||||||
rect: &Rect,
|
|
||||||
groups: &Vec<Vec<usize>>,
|
|
||||||
containers: &Vec<DraggableContainer>,
|
|
||||||
ui: &mut Ui,
|
|
||||||
) {
|
|
||||||
let center = rect.center();
|
|
||||||
for group in groups {
|
for group in groups {
|
||||||
let mut points = Vec::new();
|
let mut points = Vec::new();
|
||||||
|
|
||||||
for n in group {
|
for n in group {
|
||||||
let container = &containers[*n];
|
let container = &containers[*n];
|
||||||
let pos = container.get_pos(&Pos2::ZERO);
|
let pos = container.pos.to_pos2();
|
||||||
let size = container.size;
|
let size = container.size;
|
||||||
points.append(&mut vec![
|
points.append(&mut vec![
|
||||||
Pos2 {
|
Pos2 {
|
||||||
@@ -114,16 +106,11 @@ impl FlowChart {
|
|||||||
let response = scene
|
let response = scene
|
||||||
.show(ui, &mut self.scene_rect, |mut ui| {
|
.show(ui, &mut self.scene_rect, |mut ui| {
|
||||||
Self::paint_bg(rect, ui.painter());
|
Self::paint_bg(rect, ui.painter());
|
||||||
Self::paint_groups(rect, groups, containers, &mut ui);
|
Self::paint_groups(groups, containers, &mut ui);
|
||||||
|
|
||||||
let center = Pos2::ZERO;
|
|
||||||
|
|
||||||
for (a, b) in &self.connections {
|
for (a, b) in &self.connections {
|
||||||
ui.painter().line_segment(
|
ui.painter().line_segment(
|
||||||
[
|
[containers[*a].pos.to_pos2(), containers[*b].pos.to_pos2()],
|
||||||
containers[*a].get_pos(¢er),
|
|
||||||
containers[*b].get_pos(¢er),
|
|
||||||
],
|
|
||||||
CONNECTION_STROKE,
|
CONNECTION_STROKE,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,6 @@ const GROUP_BORDER_MARGIN: f32 = 20.;
|
|||||||
static REPULSION_STRENGTH: f32 = 100000.0; // repulsion_strength
|
static REPULSION_STRENGTH: f32 = 100000.0; // repulsion_strength
|
||||||
static ATTRACTION_STRENGTH: f32 = 0.01; // attraction_strength
|
static ATTRACTION_STRENGTH: f32 = 0.01; // attraction_strength
|
||||||
static CENTER_ATTRACTION_STRENGTH: f32 = 0.01; // attraction_strength
|
static CENTER_ATTRACTION_STRENGTH: f32 = 0.01; // attraction_strength
|
||||||
static GROUP_ATTRACTION_STRENGTH: f32 = 0.001; // attraction_strength
|
static GROUP_ATTRACTION_STRENGTH: f32 = 0.01; // attraction_strength
|
||||||
static REST_LENGTH: f32 = 50.0; // rest_length
|
static REST_LENGTH: f32 = 50.0; // rest_length
|
||||||
static DAMPING: f32 = 0.9; // damping
|
static DAMPING: f32 = 0.9; // damping
|
||||||
|
|||||||
@@ -3,9 +3,6 @@
|
|||||||
#[allow(unused_extern_crates)]
|
#[allow(unused_extern_crates)]
|
||||||
extern crate log;
|
extern crate log;
|
||||||
|
|
||||||
mod app;
|
pub mod app;
|
||||||
pub use app::TemplateApp;
|
|
||||||
|
|
||||||
mod config;
|
mod config;
|
||||||
|
|
||||||
mod flowchart;
|
mod flowchart;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#![warn(clippy::all, rust_2018_idioms)]
|
#![warn(clippy::all, rust_2018_idioms)]
|
||||||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release
|
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release
|
||||||
|
|
||||||
use unshell_gui::TemplateApp;
|
use unshell_gui::app::TemplateApp;
|
||||||
|
|
||||||
// When compiling natively:
|
// When compiling natively:
|
||||||
#[cfg(not(target_arch = "wasm32"))]
|
#[cfg(not(target_arch = "wasm32"))]
|
||||||
|
|||||||
Reference in New Issue
Block a user