diff options
Diffstat (limited to '')
| -rw-r--r-- | Cargo.lock | 90 | ||||
| -rw-r--r-- | Cargo.toml | 9 | ||||
| -rw-r--r-- | build.rs | 13 | ||||
| -rw-r--r-- | src/environment.rs | 10 | ||||
| -rw-r--r-- | src/main.rs | 10 | ||||
| -rw-r--r-- | src/panes/code_view.rs | 4 |
6 files changed, 55 insertions, 81 deletions
@@ -2004,7 +2004,7 @@ dependencies = [ [[package]] name = "iced" version = "0.14.0-dev" -source = "git+https://github.com/iced-rs/iced?rev=97f1db3783dca5a4f60a9f89668613de4dfe9edd#97f1db3783dca5a4f60a9f89668613de4dfe9edd" +source = "git+https://github.com/pml68/iced?rev=d49a70eaea0803b9a4843b37e870f44b652ed6df#d49a70eaea0803b9a4843b37e870f44b652ed6df" dependencies = [ "iced_core", "iced_futures", @@ -2018,7 +2018,7 @@ dependencies = [ [[package]] name = "iced_anim" version = "0.2.0" -source = "git+https://github.com/pml68/iced_anim#62ea3717ee372b68458cf2fe77bba3ead97f8931" +source = "git+https://github.com/pml68/iced_anim#3836cb0c0afdc2dd4f477e5ef51d3592c53cda22" dependencies = [ "iced", "iced_anim_derive", @@ -2027,7 +2027,7 @@ dependencies = [ [[package]] name = "iced_anim_derive" version = "0.2.0" -source = "git+https://github.com/pml68/iced_anim#62ea3717ee372b68458cf2fe77bba3ead97f8931" +source = "git+https://github.com/pml68/iced_anim#3836cb0c0afdc2dd4f477e5ef51d3592c53cda22" dependencies = [ "quote", "syn", @@ -2060,7 +2060,7 @@ dependencies = [ [[package]] name = "iced_core" version = "0.14.0-dev" -source = "git+https://github.com/iced-rs/iced?rev=97f1db3783dca5a4f60a9f89668613de4dfe9edd#97f1db3783dca5a4f60a9f89668613de4dfe9edd" +source = "git+https://github.com/pml68/iced?rev=d49a70eaea0803b9a4843b37e870f44b652ed6df#d49a70eaea0803b9a4843b37e870f44b652ed6df" dependencies = [ "bitflags 2.8.0", "bytes", @@ -2079,7 +2079,7 @@ dependencies = [ [[package]] name = "iced_custom_highlighter" version = "0.1.0" -source = "git+https://github.com/pml68/iced_custom_highlighter?branch=fix%2Ftemp-update-on-theme-changed#e9b8a7705b10f516963f55b994b771cb52e8c91f" +source = "git+https://github.com/pml68/iced_custom_highlighter?branch=master#5eb99c163dc765809885101529d7790a4f705b52" dependencies = [ "iced_core", "syntect", @@ -2109,7 +2109,7 @@ dependencies = [ [[package]] name = "iced_futures" version = "0.14.0-dev" -source = "git+https://github.com/iced-rs/iced?rev=97f1db3783dca5a4f60a9f89668613de4dfe9edd#97f1db3783dca5a4f60a9f89668613de4dfe9edd" +source = "git+https://github.com/pml68/iced?rev=d49a70eaea0803b9a4843b37e870f44b652ed6df#d49a70eaea0803b9a4843b37e870f44b652ed6df" dependencies = [ "futures", "iced_core", @@ -2117,13 +2117,13 @@ dependencies = [ "rustc-hash 2.1.1", "tokio", "wasm-bindgen-futures", - "wasm-timer", + "wasmtimer", ] [[package]] name = "iced_graphics" version = "0.14.0-dev" -source = "git+https://github.com/iced-rs/iced?rev=97f1db3783dca5a4f60a9f89668613de4dfe9edd#97f1db3783dca5a4f60a9f89668613de4dfe9edd" +source = "git+https://github.com/pml68/iced?rev=d49a70eaea0803b9a4843b37e870f44b652ed6df#d49a70eaea0803b9a4843b37e870f44b652ed6df" dependencies = [ "bitflags 2.8.0", "bytemuck", @@ -2143,7 +2143,7 @@ dependencies = [ [[package]] name = "iced_renderer" version = "0.14.0-dev" -source = "git+https://github.com/iced-rs/iced?rev=97f1db3783dca5a4f60a9f89668613de4dfe9edd#97f1db3783dca5a4f60a9f89668613de4dfe9edd" +source = "git+https://github.com/pml68/iced?rev=d49a70eaea0803b9a4843b37e870f44b652ed6df#d49a70eaea0803b9a4843b37e870f44b652ed6df" dependencies = [ "iced_graphics", "iced_tiny_skia", @@ -2155,7 +2155,7 @@ dependencies = [ [[package]] name = "iced_runtime" version = "0.14.0-dev" -source = "git+https://github.com/iced-rs/iced?rev=97f1db3783dca5a4f60a9f89668613de4dfe9edd#97f1db3783dca5a4f60a9f89668613de4dfe9edd" +source = "git+https://github.com/pml68/iced?rev=d49a70eaea0803b9a4843b37e870f44b652ed6df#d49a70eaea0803b9a4843b37e870f44b652ed6df" dependencies = [ "bytes", "iced_core", @@ -2168,7 +2168,7 @@ dependencies = [ [[package]] name = "iced_tiny_skia" version = "0.14.0-dev" -source = "git+https://github.com/iced-rs/iced?rev=97f1db3783dca5a4f60a9f89668613de4dfe9edd#97f1db3783dca5a4f60a9f89668613de4dfe9edd" +source = "git+https://github.com/pml68/iced?rev=d49a70eaea0803b9a4843b37e870f44b652ed6df#d49a70eaea0803b9a4843b37e870f44b652ed6df" dependencies = [ "bytemuck", "cosmic-text", @@ -2184,7 +2184,7 @@ dependencies = [ [[package]] name = "iced_wgpu" version = "0.14.0-dev" -source = "git+https://github.com/iced-rs/iced?rev=97f1db3783dca5a4f60a9f89668613de4dfe9edd#97f1db3783dca5a4f60a9f89668613de4dfe9edd" +source = "git+https://github.com/pml68/iced?rev=d49a70eaea0803b9a4843b37e870f44b652ed6df#d49a70eaea0803b9a4843b37e870f44b652ed6df" dependencies = [ "bitflags 2.8.0", "bytemuck", @@ -2203,7 +2203,7 @@ dependencies = [ [[package]] name = "iced_widget" version = "0.14.0-dev" -source = "git+https://github.com/iced-rs/iced?rev=97f1db3783dca5a4f60a9f89668613de4dfe9edd#97f1db3783dca5a4f60a9f89668613de4dfe9edd" +source = "git+https://github.com/pml68/iced?rev=d49a70eaea0803b9a4843b37e870f44b652ed6df#d49a70eaea0803b9a4843b37e870f44b652ed6df" dependencies = [ "iced_renderer", "iced_runtime", @@ -2217,7 +2217,7 @@ dependencies = [ [[package]] name = "iced_winit" version = "0.14.0-dev" -source = "git+https://github.com/iced-rs/iced?rev=97f1db3783dca5a4f60a9f89668613de4dfe9edd#97f1db3783dca5a4f60a9f89668613de4dfe9edd" +source = "git+https://github.com/pml68/iced?rev=d49a70eaea0803b9a4843b37e870f44b652ed6df#d49a70eaea0803b9a4843b37e870f44b652ed6df" dependencies = [ "iced_futures", "iced_graphics", @@ -2436,15 +2436,6 @@ dependencies = [ ] [[package]] -name = "instant" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" -dependencies = [ - "cfg-if", -] - -[[package]] name = "interpolate_name" version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3381,37 +3372,12 @@ checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" [[package]] name = "parking_lot" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" -dependencies = [ - "instant", - "lock_api", - "parking_lot_core 0.8.6", -] - -[[package]] -name = "parking_lot" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", - "parking_lot_core 0.9.10", -] - -[[package]] -name = "parking_lot_core" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" -dependencies = [ - "cfg-if", - "instant", - "libc", - "redox_syscall 0.2.16", - "smallvec", - "winapi", + "parking_lot_core", ] [[package]] @@ -3795,15 +3761,6 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" @@ -5217,18 +5174,17 @@ dependencies = [ ] [[package]] -name = "wasm-timer" -version = "0.2.5" +name = "wasmtimer" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" +checksum = "0048ad49a55b9deb3953841fa1fc5858f0efbcb7a18868c899a360269fac1b23" dependencies = [ "futures", "js-sys", - "parking_lot 0.11.2", + "parking_lot", "pin-utils", + "slab", "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", ] [[package]] @@ -5378,7 +5334,7 @@ dependencies = [ "js-sys", "log", "naga", - "parking_lot 0.12.3", + "parking_lot", "profiling", "raw-window-handle", "smallvec", @@ -5406,7 +5362,7 @@ dependencies = [ "log", "naga", "once_cell", - "parking_lot 0.12.3", + "parking_lot", "profiling", "raw-window-handle", "rustc-hash 1.1.0", @@ -5446,7 +5402,7 @@ dependencies = [ "ndk-sys 0.5.0+25.2.9519653", "objc", "once_cell", - "parking_lot 0.12.3", + "parking_lot", "profiling", "range-alloc", "raw-window-handle", @@ -13,6 +13,7 @@ rust-version = "1.85.0" [dependencies] iced.workspace = true iced_anim = { git = "https://github.com/pml68/iced_anim", features = ["derive"] } +iced_custom_highlighter = { git = "https://github.com/pml68/iced_custom_highlighter", branch = "master" } iced_drop = { path = "iced_drop" } serde = { version = "1.0.217", features = ["derive"] } serde_json = "1.0.138" @@ -26,14 +27,10 @@ thiserror = "2.0.11" dirs-next = "2.0.0" [workspace.dependencies.iced] -git = "https://github.com/iced-rs/iced" -rev = "97f1db3783dca5a4f60a9f89668613de4dfe9edd" +git = "https://github.com/pml68/iced" +rev = "d49a70eaea0803b9a4843b37e870f44b652ed6df" features = ["image", "svg", "advanced", "tokio"] -[dependencies.iced_custom_highlighter] -git = "https://github.com/pml68/iced_custom_highlighter" -branch = "fix/temp-update-on-theme-changed" - [build-dependencies] iced_fontello = "0.13.2" @@ -1,4 +1,17 @@ +use std::process::Command; + fn main() { + let git_hash = Command::new("git") + .args(["describe", "--always", "--dirty", "--exclude='*'"]) + .output() + .ok() + .filter(|output| output.status.success()) + .and_then(|x| String::from_utf8(x.stdout).ok()); + + if let Some(hash) = git_hash.as_ref() { + println!("cargo:rustc-env=GIT_HASH={}", hash); + } + println!("cargo::rerun-if-changed=fonts/icons.toml"); iced_fontello::build("fonts/icons.toml").expect("Build icons font"); #[cfg(windows)] diff --git a/src/environment.rs b/src/environment.rs index 1ebb81b..70953a0 100644 --- a/src/environment.rs +++ b/src/environment.rs @@ -2,6 +2,16 @@ use std::env; use std::path::PathBuf; pub const CONFIG_FILE_NAME: &str = "config.toml"; +pub const VERSION: &str = env!("CARGO_PKG_VERSION"); +pub const GIT_HASH: Option<&str> = option_env!("GIT_HASH"); + +pub fn formatted_version() -> String { + let hash = GIT_HASH + .map(|hash| format!(" ({hash})")) + .unwrap_or_default(); + + format!("{}{hash}", VERSION) +} pub fn config_dir() -> PathBuf { portable_dir().unwrap_or_else(platform_specific_config_dir) diff --git a/src/main.rs b/src/main.rs index 20383f1..e7faea1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -32,7 +32,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> { let version = args.next().is_some_and(|s| s == "--version" || s == "-V"); if version { - println!("{}", env!("CARGO_PKG_VERSION")); + println!("iced-builder {}", environment::formatted_version()); println!("{}", env!("CARGO_PKG_REPOSITORY")); return Ok(()); @@ -366,11 +366,9 @@ impl App { self.project.get_theme(&self.config), is_focused, ), - DesignerPane::CodeView => code_view::view( - &self.editor_content, - self.theme.value().clone(), - is_focused, - ), + DesignerPane::CodeView => { + code_view::view(&self.editor_content, is_focused) + } }, Panes::ElementList => { element_list::view(self.element_list, is_focused) diff --git a/src/panes/code_view.rs b/src/panes/code_view.rs index e133078..89d17e8 100644 --- a/src/panes/code_view.rs +++ b/src/panes/code_view.rs @@ -20,7 +20,6 @@ fn highlight_style(theme: &Theme, scope: &Scope) -> Format<Font> { pub fn view( editor_content: &text_editor::Content, - theme: Theme, is_focused: bool, ) -> pane_grid::Content<'_, Message> { let title = row![ @@ -46,8 +45,9 @@ pub fn view( text_editor(editor_content) .on_action(Message::EditorAction) .font(Font::MONOSPACE) + .rehighlight_on_redraw(true) .highlight_with::<Highlighter>( - Settings::new(vec![], highlight_style, theme, "rs"), + Settings::new(vec![], highlight_style, "rs"), Highlight::to_format, ) .style(|theme, _| { |
