back to working 1.4

This commit is contained in:
WanderingPenwing 2024-07-22 22:49:05 +02:00
parent 1d13e429ff
commit 85b2b587c1
5 changed files with 21 additions and 17 deletions

View file

@ -32,6 +32,11 @@ jobs:
toolchain: stable
override: true
- name: Install musl-gcc
run: |
sudo apt-get update
sudo apt-get install -y musl-tools
- name: Install target
run: rustup target add ${{ matrix.target }}

View file

@ -2,12 +2,13 @@
name = "calcifer"
version = "1.4.0"
edition = "2021"
#build = "build/build.rs"
build = "build/build.rs"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
eframe = "0.25.0"
tinyfiledialogs = "3.0"
egui_extras = "0.25.0"
image = "0.24.8"
serde = { version = "1.0.195", features = ["derive"] }

View file

@ -1 +1 @@
{"categories":[{"name":"to do","content":[{"name":"update workflow .yml","description":"make a workflow compiling the calcifer and put the linux in calcifer-{version}\nand the windows in calcifer_windows_{version}\n\nupdate nix\nupdate jiji","id":5}]},{"name":"in progress","content":[{"name":"export copy paste fix","description":"// Hello there","id":1}]},{"name":"done","content":[{"name":"move .project file","description":"// Hello there","id":4},{"name":"move config","description":"config from .calcifer/save.json\nto .config/calcifer/state.json","id":1},{"name":"add id to textarea per tab","description":"to improve undo, make each code area of each tab have a unique id (no more undo into another tab)","id":1},{"name":"file tree id ?","description":"// Hello there","id":1},{"name":"open dir in tree ?","description":"// Hello there","id":2},{"name":"fix tab title","description":"// Hello there","id":2}]},{"name":"+","content":[]}]}
{"categories":[{"name":"to do","content":[{"name":"update workflow .yml","description":"make a workflow compiling the calcifer and put the linux in calcifer-{version}\nand the windows in calcifer_windows_{version}\n\nupdate nix\nupdate jiji","id":5},{"name":"repair build.rs","description":"// Hello there","id":1},{"name":"repair tinyfiledialog","description":"// Hello there","id":2}]},{"name":"in progress","content":[{"name":"export copy paste fix","description":"// Hello there","id":1}]},{"name":"done","content":[{"name":"move .project file","description":"// Hello there","id":4},{"name":"move config","description":"config from .calcifer/save.json\nto .config/calcifer/state.json","id":1},{"name":"add id to textarea per tab","description":"to improve undo, make each code area of each tab have a unique id (no more undo into another tab)","id":1},{"name":"file tree id ?","description":"// Hello there","id":1},{"name":"open dir in tree ?","description":"// Hello there","id":2},{"name":"fix tab title","description":"// Hello there","id":2}]},{"name":"+","content":[]}]}

View file

@ -51,16 +51,15 @@ impl Calcifer {
} else {
self.tabs[self.selected_tab].path.to_string_lossy()
};
println!("app : tried to open dialog at {}", save_path);
// if let Some(path_string) = tinyfiledialogs::save_file_dialog("Save as", &save_path)
// {
// let path = PathBuf::from(path_string);
// if let Err(err) = fs::write(&path, &self.tabs[self.selected_tab].code) {
// eprintln!("Error writing file: {}", err);
// return None;
// }
// return Some(path);
// }
if let Some(path_string) = tinyfiledialogs::save_file_dialog("Save as", &save_path)
{
let path = PathBuf::from(path_string);
if let Err(err) = fs::write(&path, &self.tabs[self.selected_tab].code) {
eprintln!("Error writing file: {}", err);
return None;
}
return Some(path);
}
None
}

View file

@ -22,11 +22,10 @@ impl Calcifer {
.show(ctx, |ui| {
ui.vertical(|ui| {
if ui.add(egui::Button::new("📁")).clicked() {
println!("ui : open file, wip");
// if let Some(path_string) = tinyfiledialogs::open_file_dialog("Open File", &self.home.to_string_lossy(), None)
// {
// self.open_file(Some(&Path::new(&path_string)));
// }
if let Some(path_string) = tinyfiledialogs::open_file_dialog("Open File", &self.home.to_string_lossy(), None)
{
self.open_file(Some(&Path::new(&path_string)));
}
}
ui.separator();
self.tree_visible = self.toggle(ui, self.tree_visible, "📦");