diff --git a/gui/Cargo.lock b/gui/Cargo.lock index 19852f0b..cfdc1be0 100644 --- a/gui/Cargo.lock +++ b/gui/Cargo.lock @@ -236,6 +236,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" +[[package]] +name = "bit_field" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc827186963e592360843fb5ba4b973e145841266c1357f7180c43526f2e5b61" + [[package]] name = "bitcoin" version = "0.29.2" @@ -463,6 +469,12 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "color_quant" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" + [[package]] name = "const_panic" version = "0.2.7" @@ -606,6 +618,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + [[package]] name = "cty" version = "0.2.2" @@ -859,6 +877,22 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "exr" +version = "1.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdd2162b720141a91a054640662d3edce3d50a944a50ffca5313cd951abb35b4" +dependencies = [ + "bit_field", + "flume", + "half", + "lebe", + "miniz_oxide", + "rayon-core", + "smallvec", + "zune-inflate", +] + [[package]] name = "fallible-iterator" version = "0.2.0" @@ -914,6 +948,19 @@ dependencies = [ "num-traits", ] +[[package]] +name = "flume" +version = "0.10.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1657b4441c3403d9f7b3409e47575237dac27b1b5726df654a6ecbf92f0f7577" +dependencies = [ + "futures-core", + "futures-sink", + "nanorand", + "pin-project", + "spin", +] + [[package]] name = "fnv" version = "1.0.7" @@ -1111,8 +1158,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" dependencies = [ "cfg-if", + "js-sys", "libc", "wasi 0.11.0+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "gif" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80792593675e051cf94a4b111980da2ba60d4a83e43e0048c5693baab3977045" +dependencies = [ + "color_quant", + "weezl", ] [[package]] @@ -1314,6 +1373,15 @@ dependencies = [ "svg_fmt", ] +[[package]] +name = "half" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02b4af3693f1b705df946e9fe5631932443781d0aabb423b62fcd4d73f6d2fd0" +dependencies = [ + "crunchy", +] + [[package]] name = "hashbrown" version = "0.8.2" @@ -1428,6 +1496,7 @@ dependencies = [ "iced_native", "iced_wgpu", "iced_winit", + "image", "thiserror", ] @@ -1495,6 +1564,8 @@ dependencies = [ "glam", "iced_native", "iced_style", + "image", + "kamadak-exif", "log", "lyon", "qrcode", @@ -1584,6 +1655,25 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" +[[package]] +name = "image" +version = "0.24.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "527909aa81e20ac3a44803521443a765550f09b5130c2c2fa1ea59c2f8f50a3a" +dependencies = [ + "bytemuck", + "byteorder", + "color_quant", + "exr", + "gif", + "jpeg-decoder 0.3.0", + "num-rational", + "num-traits", + "png", + "qoi", + "tiff", +] + [[package]] name = "indexmap" version = "1.9.3" @@ -1624,6 +1714,15 @@ version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "229d53d58899083193af11e15917b5640cd40b29ff475a1fe4ef725deb02d0f2" +[[package]] +name = "jpeg-decoder" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc0000e42512c92e31c2252315bda326620a4e034105e900c98ec492fa077b3e" +dependencies = [ + "rayon", +] + [[package]] name = "js-sys" version = "0.3.61" @@ -1645,6 +1744,15 @@ dependencies = [ "serde_json", ] +[[package]] +name = "kamadak-exif" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef4fc70d0ab7e5b6bafa30216a6b48705ea964cdfc29c050f2412295eba58077" +dependencies = [ + "mutate_once", +] + [[package]] name = "khronos-egl" version = "4.1.0" @@ -1677,6 +1785,12 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +[[package]] +name = "lebe" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8" + [[package]] name = "ledger-apdu" version = "0.10.0" @@ -2064,6 +2178,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "mutate_once" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16cf681a23b4d0a43fc35024c176437f9dcd818db34e0f42ab456a0ee5ad497b" + [[package]] name = "naga" version = "0.10.0" @@ -2084,6 +2204,15 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "nanorand" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" +dependencies = [ + "getrandom", +] + [[package]] name = "ndk" version = "0.7.0" @@ -2230,6 +2359,17 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-rational" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + [[package]] name = "num-traits" version = "0.2.15" @@ -2508,6 +2648,26 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db8bcd96cb740d03149cbad5518db9fd87126a10ab519c011893b1754134c468" +[[package]] +name = "pin-project" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "pin-project-lite" version = "0.2.9" @@ -2593,6 +2753,15 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74605f360ce573babfe43964cbe520294dcb081afbf8c108fc6e23036b4da2df" +[[package]] +name = "qoi" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f6d64c71eb498fe9eae14ce4ec935c555749aef511cca85b5568910d6e48001" +dependencies = [ + "bytemuck", +] + [[package]] name = "qrcode" version = "0.12.0" @@ -2758,7 +2927,7 @@ version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "608c6e8aa6fb2c13bc06e4184d7c7b2cc1b7c138f88a539da8be55c3c033d7f4" dependencies = [ - "jpeg-decoder", + "jpeg-decoder 0.1.22", "log", "pico-args", "png", @@ -2991,6 +3160,12 @@ dependencies = [ "libc", ] +[[package]] +name = "simd-adler32" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "238abfbb77c1915110ad968465608b68e869e0772622c9656714e73e5a1a522f" + [[package]] name = "simplecss" version = "0.2.1" @@ -3091,6 +3266,15 @@ dependencies = [ "winapi", ] +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + [[package]] name = "spirv" version = "0.2.0+1.5.4" @@ -3211,6 +3395,17 @@ dependencies = [ "once_cell", ] +[[package]] +name = "tiff" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7449334f9ff2baf290d55d73983a7d6fa15e01198faef72af07e2a8db851e471" +dependencies = [ + "flate2", + "jpeg-decoder 0.3.0", + "weezl", +] + [[package]] name = "time" version = "0.1.45" @@ -3731,6 +3926,12 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "weezl" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9193164d4de03a926d909d3bc7c30543cecb35400c02114792c2cae20d5e2dbb" + [[package]] name = "wgpu" version = "0.14.2" @@ -4172,3 +4373,12 @@ name = "xmlwriter" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec7a2a501ed189703dba8b08142f057e887dfc4b2cc4db2d343ac6376ba3e0b9" + +[[package]] +name = "zune-inflate" +version = "0.2.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "440a08fd59c6442e4b846ea9b10386c38307eae728b216e1ab2c305d1c9daaf8" +dependencies = [ + "simd-adler32", +] diff --git a/gui/Cargo.toml b/gui/Cargo.toml index 8b2f61dc..952c5a60 100644 --- a/gui/Cargo.toml +++ b/gui/Cargo.toml @@ -20,7 +20,7 @@ liana_ui = { path = "ui" } backtrace = "0.3" base64 = "0.13" -iced = { version = "0.7", default-features= false, features = ["tokio", "glow", "svg", "qr_code"] } +iced = { version = "0.7", default-features= false, features = ["tokio", "glow", "svg", "qr_code", "image"] } iced_native = "0.8" iced_lazy = { version = "0.4"} diff --git a/gui/liana-gui.desktop b/gui/liana-gui.desktop new file mode 100644 index 00000000..57f69ed4 --- /dev/null +++ b/gui/liana-gui.desktop @@ -0,0 +1,4 @@ +[Desktop Entry] +Name=Liana +Exec=liana-gui +Type=Application diff --git a/gui/src/app/view/mod.rs b/gui/src/app/view/mod.rs index a51c530d..0e13cca0 100644 --- a/gui/src/app/view/mod.rs +++ b/gui/src/app/view/mod.rs @@ -16,7 +16,7 @@ use warning::warn; use iced::{widget::scrollable, Length}; use liana_ui::{ - component::{button, separation, text::*}, + component::{button, text::*}, icon::{coin_icon, cross_icon, home_icon, receive_icon, send_icon, settings_icon}, theme, util::Collection, @@ -214,10 +214,12 @@ pub fn sidebar<'a>(menu: &Menu, cache: &'a Cache) -> Container<'a, Message> { .push( Column::new() .push( - Column::new() - .push(Container::new(text("Liana").bold()).padding(10)) - .push(separation().width(Length::Units(200))) - .spacing(10), + Container::new( + liana_ui::image::liana_grey_logo() + .height(Length::Units(150)) + .width(Length::Units(60)), + ) + .padding(15), ) .push(home_button) .push(coins_button) diff --git a/gui/src/main.rs b/gui/src/main.rs index dd8cabc0..a6f93647 100644 --- a/gui/src/main.rs +++ b/gui/src/main.rs @@ -9,7 +9,7 @@ extern crate serde; extern crate serde_json; use liana::{config::Config as DaemonConfig, miniscript::bitcoin}; -use liana_ui::{component::text, font, theme, widget::Element}; +use liana_ui::{component::text, font, image, theme, widget::Element}; use liana_gui::{ app::{ @@ -386,6 +386,8 @@ fn main() -> Result<(), Box> { setup_panic_hook(); let mut settings = Settings::with_flags(config); + settings.id = Some("liana-gui".to_string()); + settings.window.icon = Some(image::liana_app_icon()); settings.default_text_size = text::P1_SIZE; settings.default_font = Some(font::REGULAR_BYTES); settings.exit_on_close_request = false; diff --git a/gui/ui/Cargo.toml b/gui/ui/Cargo.toml index fc68b0d7..227e7220 100644 --- a/gui/ui/Cargo.toml +++ b/gui/ui/Cargo.toml @@ -6,6 +6,6 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -iced = "0.7" +iced = { version = "0.7", features = ["svg", "image"] } iced_native = "0.8" iced_lazy = { version = "0.4"} diff --git a/gui/ui/examples/design-system/src/main.rs b/gui/ui/examples/design-system/src/main.rs index f07b25ff..f30d19ec 100644 --- a/gui/ui/examples/design-system/src/main.rs +++ b/gui/ui/examples/design-system/src/main.rs @@ -2,7 +2,7 @@ mod section; use iced::widget::{button, column, container, row, scrollable, text, Space}; use iced::{executor, Application, Command, Length, Settings, Subscription}; -use liana_ui::{component::text::*, theme, widget::*}; +use liana_ui::{component::text::*, image, theme, widget::*}; pub fn main() -> iced::Result { let mut settings = Settings::with_flags(Config {}); @@ -100,6 +100,7 @@ impl Application for DesignSystem { fn view(&self) -> Element { let sidebar = container( column![ + image::liana_grey_logo(), Space::with_height(Length::Units(100)), self.sections.iter().enumerate().fold( Column::new().spacing(10), diff --git a/gui/ui/src/image.rs b/gui/ui/src/image.rs new file mode 100644 index 00000000..55783f6a --- /dev/null +++ b/gui/ui/src/image.rs @@ -0,0 +1,14 @@ +use crate::widget::Svg; +use iced::{widget::svg::Handle, window::icon}; + +const LIANA_APP_ICON: &[u8] = include_bytes!("../static/logos/liana-app-icon.png"); +const LIANA_LOGO_GREY: &[u8] = include_bytes!("../static/logos/LIANA_SYMBOL_Gray.svg"); + +pub fn liana_app_icon() -> icon::Icon { + icon::Icon::from_file_data(LIANA_APP_ICON, None).unwrap() +} + +pub fn liana_grey_logo() -> Svg { + let h = Handle::from_memory(LIANA_LOGO_GREY.to_vec()); + Svg::new(h) +} diff --git a/gui/ui/src/lib.rs b/gui/ui/src/lib.rs index ac38dd55..213df10f 100644 --- a/gui/ui/src/lib.rs +++ b/gui/ui/src/lib.rs @@ -2,6 +2,7 @@ pub mod color; pub mod component; pub mod font; pub mod icon; +pub mod image; pub mod theme; pub mod util; @@ -20,4 +21,5 @@ pub mod widget { pub type ProgressBar = iced::widget::ProgressBar; pub type PickList<'a, Message> = iced::widget::PickList<'a, Message, Renderer>; pub type Scrollable<'a, Message> = iced::widget::Scrollable<'a, Message, Renderer>; + pub type Svg = iced::widget::Svg; } diff --git a/gui/ui/src/theme.rs b/gui/ui/src/theme.rs index dafeec25..6ca688a0 100644 --- a/gui/ui/src/theme.rs +++ b/gui/ui/src/theme.rs @@ -1,7 +1,7 @@ use iced::{ application, widget::{ - button, checkbox, container, pick_list, progress_bar, radio, scrollable, slider, text, + button, checkbox, container, pick_list, progress_bar, radio, scrollable, slider, svg, text, text_input, }, }; @@ -683,3 +683,16 @@ impl slider::StyleSheet for Theme { } } } + +#[derive(Debug, Copy, Clone, Default)] +pub enum Svg { + #[default] + Simple, +} + +impl svg::StyleSheet for Theme { + type Style = ProgressBar; + fn appearance(&self, _style: &Self::Style) -> svg::Appearance { + svg::Appearance::default() + } +} diff --git a/gui/ui/static/logos/LIANA_BRAND_Black.svg b/gui/ui/static/logos/LIANA_BRAND_Black.svg new file mode 100644 index 00000000..f1676e08 --- /dev/null +++ b/gui/ui/static/logos/LIANA_BRAND_Black.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/gui/ui/static/logos/LIANA_BRAND_Gray.svg b/gui/ui/static/logos/LIANA_BRAND_Gray.svg new file mode 100644 index 00000000..19bc042e --- /dev/null +++ b/gui/ui/static/logos/LIANA_BRAND_Gray.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/gui/ui/static/logos/LIANA_BRAND_Green.svg b/gui/ui/static/logos/LIANA_BRAND_Green.svg new file mode 100644 index 00000000..d08f57e0 --- /dev/null +++ b/gui/ui/static/logos/LIANA_BRAND_Green.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/gui/ui/static/logos/LIANA_BRAND_Off-White.svg b/gui/ui/static/logos/LIANA_BRAND_Off-White.svg new file mode 100644 index 00000000..058c0c02 --- /dev/null +++ b/gui/ui/static/logos/LIANA_BRAND_Off-White.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/gui/ui/static/logos/LIANA_LOGOTYPE_Black.svg b/gui/ui/static/logos/LIANA_LOGOTYPE_Black.svg new file mode 100644 index 00000000..39ce4885 --- /dev/null +++ b/gui/ui/static/logos/LIANA_LOGOTYPE_Black.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/gui/ui/static/logos/LIANA_LOGOTYPE_Gray.svg b/gui/ui/static/logos/LIANA_LOGOTYPE_Gray.svg new file mode 100644 index 00000000..19e18b1c --- /dev/null +++ b/gui/ui/static/logos/LIANA_LOGOTYPE_Gray.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/gui/ui/static/logos/LIANA_LOGOTYPE_Green.svg b/gui/ui/static/logos/LIANA_LOGOTYPE_Green.svg new file mode 100644 index 00000000..8fd59a6d --- /dev/null +++ b/gui/ui/static/logos/LIANA_LOGOTYPE_Green.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/gui/ui/static/logos/LIANA_LOGOTYPE_Off-White.svg b/gui/ui/static/logos/LIANA_LOGOTYPE_Off-White.svg new file mode 100644 index 00000000..ae966500 --- /dev/null +++ b/gui/ui/static/logos/LIANA_LOGOTYPE_Off-White.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/gui/ui/static/logos/LIANA_SYMBOL-O_Black.svg b/gui/ui/static/logos/LIANA_SYMBOL-O_Black.svg new file mode 100644 index 00000000..7a728f81 --- /dev/null +++ b/gui/ui/static/logos/LIANA_SYMBOL-O_Black.svg @@ -0,0 +1,12 @@ + + + + + + + + \ No newline at end of file diff --git a/gui/ui/static/logos/LIANA_SYMBOL-O_Gray.svg b/gui/ui/static/logos/LIANA_SYMBOL-O_Gray.svg new file mode 100644 index 00000000..1f79965a --- /dev/null +++ b/gui/ui/static/logos/LIANA_SYMBOL-O_Gray.svg @@ -0,0 +1,12 @@ + + + + + + + + \ No newline at end of file diff --git a/gui/ui/static/logos/LIANA_SYMBOL-O_Green.svg b/gui/ui/static/logos/LIANA_SYMBOL-O_Green.svg new file mode 100644 index 00000000..f9a538f3 --- /dev/null +++ b/gui/ui/static/logos/LIANA_SYMBOL-O_Green.svg @@ -0,0 +1,12 @@ + + + + + + + + \ No newline at end of file diff --git a/gui/ui/static/logos/LIANA_SYMBOL-O_Off-White.svg b/gui/ui/static/logos/LIANA_SYMBOL-O_Off-White.svg new file mode 100644 index 00000000..3a0ce274 --- /dev/null +++ b/gui/ui/static/logos/LIANA_SYMBOL-O_Off-White.svg @@ -0,0 +1,12 @@ + + + + + + + + \ No newline at end of file diff --git a/gui/ui/static/logos/LIANA_SYMBOL_Black.svg b/gui/ui/static/logos/LIANA_SYMBOL_Black.svg new file mode 100644 index 00000000..4dc59023 --- /dev/null +++ b/gui/ui/static/logos/LIANA_SYMBOL_Black.svg @@ -0,0 +1,12 @@ + + + + + + + + \ No newline at end of file diff --git a/gui/ui/static/logos/LIANA_SYMBOL_Gray.svg b/gui/ui/static/logos/LIANA_SYMBOL_Gray.svg new file mode 100644 index 00000000..eefa8bb4 --- /dev/null +++ b/gui/ui/static/logos/LIANA_SYMBOL_Gray.svg @@ -0,0 +1,12 @@ + + + + + + + + \ No newline at end of file diff --git a/gui/ui/static/logos/LIANA_SYMBOL_Green.svg b/gui/ui/static/logos/LIANA_SYMBOL_Green.svg new file mode 100644 index 00000000..c6d2b319 --- /dev/null +++ b/gui/ui/static/logos/LIANA_SYMBOL_Green.svg @@ -0,0 +1,12 @@ + + + + + + + + \ No newline at end of file diff --git a/gui/ui/static/logos/LIANA_SYMBOL_Off-White.svg b/gui/ui/static/logos/LIANA_SYMBOL_Off-White.svg new file mode 100644 index 00000000..0bbb2140 --- /dev/null +++ b/gui/ui/static/logos/LIANA_SYMBOL_Off-White.svg @@ -0,0 +1,12 @@ + + + + + + + + \ No newline at end of file diff --git a/gui/ui/static/logos/liana-app-icon.png b/gui/ui/static/logos/liana-app-icon.png new file mode 100644 index 00000000..bfa47574 Binary files /dev/null and b/gui/ui/static/logos/liana-app-icon.png differ diff --git a/gui/ui/static/logos/liana-app-icon.svg b/gui/ui/static/logos/liana-app-icon.svg new file mode 100644 index 00000000..753f6bef --- /dev/null +++ b/gui/ui/static/logos/liana-app-icon.svg @@ -0,0 +1,5 @@ + + + + +