initial commit

This commit is contained in:
Penwing 2024-01-14 10:56:21 +01:00
commit 8422775ffc
5 changed files with 3472 additions and 0 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/target

3407
Cargo.lock generated Normal file

File diff suppressed because it is too large Load diff

14
Cargo.toml Normal file
View file

@ -0,0 +1,14 @@
[package]
name = "calcifer"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
eframe = "0.25.0"
env_logger = { version = "0.10.1", default-features = false, features = [
"auto-color",
"humantime",
] }
rfd = "0.12.1"

1
README.md Normal file
View file

@ -0,0 +1 @@
# Calcifer

49
src/main.rs Normal file
View file

@ -0,0 +1,49 @@
use eframe::egui;
fn main() -> Result<(), eframe::Error> {
env_logger::init(); // Log to stderr (if you run with `RUST_LOG=debug`).
let options = eframe::NativeOptions {
viewport: egui::ViewportBuilder::default()
.with_inner_size([1200.0, 800.0]) // wide enough for the drag-drop overlay text
.with_drag_and_drop(true),
..Default::default()
};
eframe::run_native(
"Calcifer",
options,
Box::new(|_cc| Box::<MyApp>::default()),
)
}
#[derive(Default)]
struct MyApp {
picked_path: Option<String>,
}
impl eframe::App for MyApp {
fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
egui::SidePanel::left("my_left_panel").show(ctx, |ui| {
ui.label("Tree ?");
});
egui::CentralPanel::default().show(ctx, |ui| {
if ui.button("Open file…").clicked() {
if let Some(path) = rfd::FileDialog::new().pick_file() {
self.picked_path = Some(path.display().to_string());
}
}
ui.label("Code");
if let Some(picked_path) = &self.picked_path {
ui.horizontal(|ui| {
ui.label("Picked file:");
ui.monospace(picked_path);
});
}
});
egui::TopBottomPanel::bottom("terminal").show(ctx, |ui| {
ui.label("Terminal");
});
}
}