From 1fd53c0ff41579196de0592d250ffd224a1bd8e7 Mon Sep 17 00:00:00 2001 From: edouard Date: Tue, 9 May 2023 16:24:30 +0200 Subject: [PATCH] gui: Add iconex icons --- gui/src/app/view/coins.rs | 10 +- gui/src/app/view/mod.rs | 149 ++-------- gui/src/app/view/recovery.rs | 116 ++++---- gui/src/app/view/transactions.rs | 2 + gui/ui/src/component/badge.rs | 9 + gui/ui/src/component/button.rs | 8 +- gui/ui/src/component/card.rs | 2 +- gui/ui/src/icon.rs | 259 +++++++----------- gui/ui/src/image.rs | 24 -- gui/ui/static/icons/clock-icon.svg | 6 - gui/ui/static/icons/clock-red-icon.svg | 6 - gui/ui/static/icons/coins-icon.svg | 3 - gui/ui/static/icons/iconex/iconex-icons.ttf | Bin 0 -> 7608 bytes gui/ui/static/icons/iconex/svg/IconBack.svg | 4 + .../static/icons/iconex/svg/IconBroadcast.svg | 4 + gui/ui/static/icons/iconex/svg/IconCheck.svg | 4 + gui/ui/static/icons/iconex/svg/IconClear.svg | 5 + gui/ui/static/icons/iconex/svg/IconCoins.svg | 3 + gui/ui/static/icons/iconex/svg/IconCopy.svg | 4 + gui/ui/static/icons/iconex/svg/IconDown.svg | 3 + .../svg/IconHistory.svg} | 0 gui/ui/static/icons/iconex/svg/IconHome.svg | 6 + gui/ui/static/icons/iconex/svg/IconImport.svg | 5 + gui/ui/static/icons/iconex/svg/IconKey.svg | 7 + gui/ui/static/icons/iconex/svg/IconPlus.svg | 5 + .../static/icons/iconex/svg/IconReceive.svg | 5 + .../static/icons/iconex/svg/IconRefresh.svg | 3 + .../static/icons/iconex/svg/IconSablier.svg | 6 + gui/ui/static/icons/iconex/svg/IconSave.svg | 5 + gui/ui/static/icons/iconex/svg/IconSend.svg | 5 + gui/ui/static/icons/iconex/svg/IconTime.svg | 4 + .../static/icons/iconex/svg/IconeSettings.svg | 4 + gui/ui/static/icons/iconex/svg_to_ttf.py | 33 +++ 33 files changed, 315 insertions(+), 394 deletions(-) delete mode 100644 gui/ui/static/icons/clock-icon.svg delete mode 100644 gui/ui/static/icons/clock-red-icon.svg delete mode 100644 gui/ui/static/icons/coins-icon.svg create mode 100644 gui/ui/static/icons/iconex/iconex-icons.ttf create mode 100644 gui/ui/static/icons/iconex/svg/IconBack.svg create mode 100644 gui/ui/static/icons/iconex/svg/IconBroadcast.svg create mode 100644 gui/ui/static/icons/iconex/svg/IconCheck.svg create mode 100644 gui/ui/static/icons/iconex/svg/IconClear.svg create mode 100644 gui/ui/static/icons/iconex/svg/IconCoins.svg create mode 100644 gui/ui/static/icons/iconex/svg/IconCopy.svg create mode 100644 gui/ui/static/icons/iconex/svg/IconDown.svg rename gui/ui/static/icons/{history-icon.svg => iconex/svg/IconHistory.svg} (100%) create mode 100644 gui/ui/static/icons/iconex/svg/IconHome.svg create mode 100644 gui/ui/static/icons/iconex/svg/IconImport.svg create mode 100644 gui/ui/static/icons/iconex/svg/IconKey.svg create mode 100644 gui/ui/static/icons/iconex/svg/IconPlus.svg create mode 100644 gui/ui/static/icons/iconex/svg/IconReceive.svg create mode 100644 gui/ui/static/icons/iconex/svg/IconRefresh.svg create mode 100644 gui/ui/static/icons/iconex/svg/IconSablier.svg create mode 100644 gui/ui/static/icons/iconex/svg/IconSave.svg create mode 100644 gui/ui/static/icons/iconex/svg/IconSend.svg create mode 100644 gui/ui/static/icons/iconex/svg/IconTime.svg create mode 100644 gui/ui/static/icons/iconex/svg/IconeSettings.svg create mode 100644 gui/ui/static/icons/iconex/svg_to_ttf.py diff --git a/gui/src/app/view/coins.rs b/gui/src/app/view/coins.rs index 29f8b002..7a9e219d 100644 --- a/gui/src/app/view/coins.rs +++ b/gui/src/app/view/coins.rs @@ -3,9 +3,7 @@ use iced::{widget::Space, Alignment, Length}; use liana_ui::{ color, component::{amount::*, badge, button, text::*}, - icon, - image::*, - theme, + icon, theme, util::Collection, widget::*, }; @@ -182,7 +180,7 @@ pub fn coin_sequence_label<'a, T: 'a>(seq: u32, timelock: u32) -> Container<'a, Container::new( Row::new() .spacing(5) - .push(clock_red_icon().width(Length::Units(20))) + .push(icon::clock_icon().width(Length::Units(20))) .push(p2_regular("Expired")) .align_items(Alignment::Center), ) @@ -192,7 +190,7 @@ pub fn coin_sequence_label<'a, T: 'a>(seq: u32, timelock: u32) -> Container<'a, Container::new( Row::new() .spacing(5) - .push(clock_red_icon().width(Length::Units(20))) + .push(icon::clock_icon().width(Length::Units(20))) .push(p2_regular(expire_message(seq))) .align_items(Alignment::Center), ) @@ -202,7 +200,7 @@ pub fn coin_sequence_label<'a, T: 'a>(seq: u32, timelock: u32) -> Container<'a, Container::new( Row::new() .spacing(5) - .push(clock_icon().width(Length::Units(20))) + .push(icon::clock_icon().width(Length::Units(20))) .push(p2_regular(expire_message(seq)).style(color::GREY_3)) .align_items(Alignment::Center), ) diff --git a/gui/src/app/view/mod.rs b/gui/src/app/view/mod.rs index 699e0cb3..6844e035 100644 --- a/gui/src/app/view/mod.rs +++ b/gui/src/app/view/mod.rs @@ -23,7 +23,9 @@ use iced::{ use liana_ui::{ color, component::{button, text::*}, - icon::{cross_icon, home_icon, receive_icon, send_icon, settings_icon}, + icon::{ + coins_icon, cross_icon, history_icon, home_icon, receive_icon, send_icon, settings_icon, + }, image::*, theme, util::Collection, @@ -54,150 +56,55 @@ pub fn sidebar<'a>(menu: &Menu, cache: &'a Cache) -> Container<'a, Message> { let transactions_button = if *menu == Menu::Transactions { row!( - Button::new( - row!( - history_icon().width(Length::Units(20)), - text("Transactions") - ) - .spacing(10) - .padding(10) - .align_items(iced::Alignment::Center), - ) - .style(theme::Button::Menu(true)) - .on_press(Message::Menu(Menu::Transactions)) - .width(iced::Length::Fill), + button::menu_active(Some(history_icon()), "Transactions") + .on_press(Message::Menu(Menu::Transactions)) + .width(iced::Length::Fill), menu_green_bar() ) } else { - row!(Button::new( - row!( - history_icon().width(Length::Units(20)), - text("Transactions") - ) - .spacing(10) - .padding(10) - .align_items(iced::Alignment::Center), - ) - .style(theme::Button::Menu(false)) - .on_press(Message::Menu(Menu::Transactions)) - .width(iced::Length::Fill)) + row!(button::menu(Some(history_icon()), "Transactions") + .on_press(Message::Menu(Menu::Transactions)) + .width(iced::Length::Fill)) }; let coins_button = if *menu == Menu::Coins { row!( - Button::new( - Container::new( - Row::new() - .push(coins_icon().width(Length::Units(20))) - .push(text("Coins")) - .spacing(10) - .width(iced::Length::Fill) - .align_items(iced::Alignment::Center), - ) - .width(iced::Length::Fill) - .padding(10) - .center_x(), - ) - .style(theme::Button::Menu(true)) - .on_press(Message::Reload) - .width(iced::Length::Fill), + button::menu_active(Some(coins_icon()), "Coins") + .on_press(Message::Reload) + .width(iced::Length::Fill), menu_green_bar() ) } else { - row!(Button::new( - Container::new( - Row::new() - .push(coins_icon().width(Length::Units(20))) - .push(text("Coins")) - .spacing(10) - .width(iced::Length::Fill) - .align_items(iced::Alignment::Center), - ) - .width(iced::Length::Fill) - .padding(10) - .center_x(), - ) - .style(theme::Button::Menu(false)) - .on_press(Message::Menu(Menu::Coins)) - .width(iced::Length::Fill)) + row!(button::menu(Some(coins_icon()), "Coins") + .style(theme::Button::Menu(false)) + .on_press(Message::Menu(Menu::Coins)) + .width(iced::Length::Fill)) }; let psbt_button = if *menu == Menu::PSBTs { row!( - Button::new( - Container::new( - Row::new() - .push(history_icon().width(Length::Units(20))) - .push(text("PSBTs")) - .spacing(10) - .width(iced::Length::Fill) - .align_items(iced::Alignment::Center), - ) - .width(iced::Length::Fill) - .padding(10) - .center_x(), - ) - .style(theme::Button::Menu(true)) - .on_press(Message::Menu(Menu::PSBTs)) - .width(iced::Length::Fill), + button::menu_active(Some(history_icon()), "PSBTs") + .on_press(Message::Menu(Menu::PSBTs)) + .width(iced::Length::Fill), menu_green_bar() ) } else { - row!(Button::new( - Container::new( - Row::new() - .push(history_icon().width(Length::Units(20))) - .push(text("PSBTs")) - .spacing(10) - .width(iced::Length::Fill) - .align_items(iced::Alignment::Center), - ) - .width(iced::Length::Fill) - .padding(10) - .center_x(), - ) - .style(theme::Button::Menu(false)) - .on_press(Message::Menu(Menu::PSBTs)) - .width(iced::Length::Fill)) + row!(button::menu(Some(history_icon()), "PSBTs") + .on_press(Message::Menu(Menu::PSBTs)) + .width(iced::Length::Fill)) }; let spend_button = if *menu == Menu::CreateSpendTx { row!( - Button::new( - Container::new( - Row::new() - .push(send_icon()) - .push(text("Send")) - .spacing(10) - .width(iced::Length::Fill) - .align_items(iced::Alignment::Center), - ) - .width(iced::Length::Fill) - .padding(10) - .center_x(), - ) - .style(theme::Button::Menu(true)) - .on_press(Message::Menu(Menu::CreateSpendTx)) - .width(iced::Length::Fill), + button::menu_active(Some(send_icon()), "Send") + .on_press(Message::Menu(Menu::CreateSpendTx)) + .width(iced::Length::Fill), menu_green_bar() ) } else { - row!(Button::new( - Container::new( - Row::new() - .push(send_icon()) - .push(text("Send")) - .spacing(10) - .width(iced::Length::Fill) - .align_items(iced::Alignment::Center), - ) - .width(iced::Length::Fill) - .padding(10) - .center_x(), - ) - .style(theme::Button::Menu(false)) - .on_press(Message::Menu(Menu::CreateSpendTx)) - .width(iced::Length::Fill)) + row!(button::menu(Some(send_icon()), "Send") + .on_press(Message::Menu(Menu::CreateSpendTx)) + .width(iced::Length::Fill)) }; let receive_button = if *menu == Menu::Receive { diff --git a/gui/src/app/view/recovery.rs b/gui/src/app/view/recovery.rs index 1e197830..fe7ce4d0 100644 --- a/gui/src/app/view/recovery.rs +++ b/gui/src/app/view/recovery.rs @@ -1,7 +1,7 @@ use std::collections::HashMap; use iced::{ - widget::{tooltip, Space}, + widget::{checkbox, tooltip, Space}, Alignment, Length, }; @@ -116,68 +116,60 @@ pub fn recovery_path_view<'a>( selected: bool, ) -> Element<'a, Message> { Container::new( - Button::new( - Row::new() - .push(if selected { - icon::square_check_icon() - } else { - icon::square_icon() - }) - .push( - Column::new() - .push( - Row::new() - .align_items(Alignment::Center) - .spacing(10) - .push( - text(format!( - "{} signature{} from", - threshold, - if threshold > 1 { "s" } else { "" } - )) - .bold(), - ) - .push(origins.iter().fold( - Row::new().align_items(Alignment::Center).spacing(5), - |row, (fg, _)| { - row.push(if let Some(alias) = key_aliases.get(fg) { - Container::new( - tooltip::Tooltip::new( - Container::new(text(alias)).padding(3).style( - theme::Container::Pill(theme::Pill::Simple), - ), - fg.to_string(), - tooltip::Position::Bottom, - ) - .style(theme::Container::Card(theme::Card::Simple)), + Row::new() + .push(checkbox("", selected, move |_| { + Message::CreateSpend(CreateSpendMessage::SelectPath(index)) + })) + .push( + Column::new() + .push( + Row::new() + .align_items(Alignment::Center) + .spacing(10) + .push( + text(format!( + "{} signature{} from", + threshold, + if threshold > 1 { "s" } else { "" } + )) + .bold(), + ) + .push(origins.iter().fold( + Row::new().align_items(Alignment::Center).spacing(5), + |row, (fg, _)| { + row.push(if let Some(alias) = key_aliases.get(fg) { + Container::new( + tooltip::Tooltip::new( + Container::new(text(alias)).padding(3).style( + theme::Container::Pill(theme::Pill::Simple), + ), + fg.to_string(), + tooltip::Position::Bottom, ) - } else { - Container::new(text(fg.to_string())) - .padding(3) - .style(theme::Container::Pill(theme::Pill::Simple)) - }) - }, - )), - ) - .push( - Row::new() - .spacing(5) - .push(text("can recover")) - .push(text(format!( - "{} coin{} totalling", - number_of_coins, - if number_of_coins > 0 { "s" } else { "" } - ))) - .push(amount(&total_amount)), - ), - ) - .align_items(Alignment::Center) - .spacing(20), - ) - .padding(10) - .width(Length::Fill) - .on_press(Message::CreateSpend(CreateSpendMessage::SelectPath(index))) - .style(theme::Button::TransparentBorder), + .style(theme::Container::Card(theme::Card::Simple)), + ) + } else { + Container::new(text(fg.to_string())) + .padding(3) + .style(theme::Container::Pill(theme::Pill::Simple)) + }) + }, + )), + ) + .push( + Row::new() + .spacing(5) + .push(text("can recover")) + .push(text(format!( + "{} coin{} totalling", + number_of_coins, + if number_of_coins > 0 { "s" } else { "" } + ))) + .push(amount(&total_amount)), + ), + ) + .align_items(Alignment::Center) + .spacing(20), ) .style(theme::Container::Card(theme::Card::Simple)) .width(Length::Fill) diff --git a/gui/src/app/view/transactions.rs b/gui/src/app/view/transactions.rs index 5da5a9e8..dac6b070 100644 --- a/gui/src/app/view/transactions.rs +++ b/gui/src/app/view/transactions.rs @@ -91,6 +91,8 @@ fn tx_list_view<'a>(i: usize, tx: &HistoryTransaction) -> Element<'a, Message> { Row::new() .push(if tx.is_external() { badge::receive() + } else if tx.is_self_send() { + badge::cycle() } else { badge::spend() }) diff --git a/gui/ui/src/component/badge.rs b/gui/ui/src/component/badge.rs index c8c44382..ac3d77f2 100644 --- a/gui/ui/src/component/badge.rs +++ b/gui/ui/src/component/badge.rs @@ -43,6 +43,15 @@ pub fn receive() -> Container<'static, T> { .center_y() } +pub fn cycle() -> Container<'static, T> { + Container::new(icon::arrow_repeat().width(Length::Units(20))) + .width(Length::Units(40)) + .height(Length::Units(40)) + .style(theme::Container::Badge(theme::Badge::Standard)) + .center_x() + .center_y() +} + pub fn spend() -> Container<'static, T> { Container::new(icon::send_icon().width(Length::Units(20))) .width(Length::Units(40)) diff --git a/gui/ui/src/component/button.rs b/gui/ui/src/component/button.rs index 391a3318..21a1528a 100644 --- a/gui/ui/src/component/button.rs +++ b/gui/ui/src/component/button.rs @@ -1,15 +1,17 @@ -use crate::{theme, widget::*}; +use crate::{color, theme, widget::*}; use iced::widget::{button, container, row}; use iced::{Alignment, Length}; use super::text::text; pub fn menu<'a, T: 'a>(icon: Option>, t: &'static str) -> Button<'a, T> { - button::Button::new(content(icon, t).padding(10)).style(theme::Button::Menu(false)) + button::Button::new(content(icon.map(|i| i.style(color::GREY_3)), t).padding(10)) + .style(theme::Button::Menu(false)) } pub fn menu_active<'a, T: 'a>(icon: Option>, t: &'static str) -> Button<'a, T> { - button::Button::new(content(icon, t).padding(10)).style(theme::Button::Menu(true)) + button::Button::new(content(icon.map(|i| i.style(color::GREY_3)), t).padding(10)) + .style(theme::Button::Menu(true)) } pub fn alert<'a, T: 'a>(icon: Option>, t: &'static str) -> Button<'a, T> { diff --git a/gui/ui/src/component/card.rs b/gui/ui/src/component/card.rs index 7877a05f..7b6e8500 100644 --- a/gui/ui/src/component/card.rs +++ b/gui/ui/src/component/card.rs @@ -18,7 +18,7 @@ pub fn warning<'a, T: 'a>(message: String) -> Container<'a, T> { Row::new() .spacing(20) .align_items(iced::Alignment::Center) - .push(icon::warning_octagon_icon()) + .push(icon::warning_icon()) .push(text(message)), ) .padding(15) diff --git a/gui/ui/src/icon.rs b/gui/ui/src/icon.rs index 3337bb19..050ca1e9 100644 --- a/gui/ui/src/icon.rs +++ b/gui/ui/src/icon.rs @@ -1,245 +1,180 @@ use crate::widget::*; use iced::{alignment, Font, Length}; -const ICONS: Font = Font::External { - name: "Icons", +const BOOTSTRAP_ICONS: Font = Font::External { + name: "Bootstrap icons", bytes: include_bytes!("../static/icons/bootstrap-icons.ttf"), }; -fn icon(unicode: char) -> Text<'static> { +fn bootstrap_icon(unicode: char) -> Text<'static> { Text::new(unicode.to_string()) - .font(ICONS) + .font(BOOTSTRAP_ICONS) .width(Length::Units(20)) .horizontal_alignment(alignment::Horizontal::Center) .size(20) } +pub fn cross_icon() -> Text<'static> { + bootstrap_icon('\u{F62A}') +} + pub fn arrow_down() -> Text<'static> { - icon('\u{F128}') + bootstrap_icon('\u{F128}') } pub fn arrow_right() -> Text<'static> { - icon('\u{F138}') -} - -pub fn arrow_repeat() -> Text<'static> { - icon('\u{F130}') + bootstrap_icon('\u{F138}') } pub fn arrow_return_right() -> Text<'static> { - icon('\u{F132}') + bootstrap_icon('\u{F132}') } pub fn chevron_right() -> Text<'static> { - icon('\u{F285}') + bootstrap_icon('\u{F285}') } pub fn recovery_icon() -> Text<'static> { - icon('\u{F467}') + bootstrap_icon('\u{F467}') } pub fn plug_icon() -> Text<'static> { - icon('\u{F4F6}') + bootstrap_icon('\u{F4F6}') } pub fn reload_icon() -> Text<'static> { - icon('\u{F130}') + bootstrap_icon('\u{F130}') } pub fn import_icon() -> Text<'static> { - icon('\u{F30A}') + bootstrap_icon('\u{F30A}') } pub fn wallet_icon() -> Text<'static> { - icon('\u{F615}') -} - -pub fn hourglass_icon() -> Text<'static> { - icon('\u{F41F}') -} - -pub fn hourglass_done_icon() -> Text<'static> { - icon('\u{F41E}') -} - -pub fn vault_icon() -> Text<'static> { - icon('\u{F65A}') + bootstrap_icon('\u{F615}') } pub fn bitcoin_icon() -> Text<'static> { - icon('\u{F635}') -} - -pub fn history_icon() -> Text<'static> { - icon('\u{F292}') -} - -pub fn home_icon() -> Text<'static> { - icon('\u{F3FC}') -} - -pub fn unlock_icon() -> Text<'static> { - icon('\u{F600}') -} - -pub fn warning_octagon_icon() -> Text<'static> { - icon('\u{F337}') -} - -pub fn send_icon() -> Text<'static> { - icon('\u{F144}') -} - -pub fn connect_device_icon() -> Text<'static> { - icon('\u{F348}') -} - -pub fn connected_device_icon() -> Text<'static> { - icon('\u{F350}') -} - -pub fn receive_icon() -> Text<'static> { - icon('\u{F123}') -} - -pub fn calendar_icon() -> Text<'static> { - icon('\u{F1E8}') -} - -pub fn turnback_icon() -> Text<'static> { - icon('\u{F131}') -} - -pub fn vaults_icon() -> Text<'static> { - icon('\u{F1C7}') -} - -pub fn coin_icon() -> Text<'static> { - icon('\u{F567}') -} - -pub fn settings_icon() -> Text<'static> { - icon('\u{F3E5}') + bootstrap_icon('\u{F635}') } pub fn block_icon() -> Text<'static> { - icon('\u{F1C8}') -} - -pub fn square_icon() -> Text<'static> { - icon('\u{F584}') -} - -pub fn square_check_icon() -> Text<'static> { - icon('\u{F26D}') -} - -pub fn circle_check_icon() -> Text<'static> { - icon('\u{F26B}') -} - -pub fn circle_cross_icon() -> Text<'static> { - icon('\u{F623}') -} - -pub fn network_icon() -> Text<'static> { - icon('\u{F40D}') + bootstrap_icon('\u{F1C8}') } pub fn dot_icon() -> Text<'static> { - icon('\u{F287}') -} - -pub fn clipboard_icon() -> Text<'static> { - icon('\u{F3C2}') -} - -pub fn shield_icon() -> Text<'static> { - icon('\u{F53F}') -} - -pub fn shield_notif_icon() -> Text<'static> { - icon('\u{F530}') -} - -pub fn shield_check_icon() -> Text<'static> { - icon('\u{F52F}') -} - -pub fn person_check_icon() -> Text<'static> { - icon('\u{F4D6}') + bootstrap_icon('\u{F287}') } pub fn person_icon() -> Text<'static> { - icon('\u{F4DA}') + bootstrap_icon('\u{F4DA}') } pub fn tooltip_icon() -> Text<'static> { - icon('\u{F431}') + bootstrap_icon('\u{F431}') } pub fn plus_icon() -> Text<'static> { - icon('\u{F4FE}') + bootstrap_icon('\u{F4FE}') } pub fn warning_icon() -> Text<'static> { - icon('\u{F33B}') + bootstrap_icon('\u{F33B}') } pub fn chip_icon() -> Text<'static> { - icon('\u{F2D6}') + bootstrap_icon('\u{F2D6}') } pub fn trash_icon() -> Text<'static> { - icon('\u{F5DE}') -} - -pub fn key_icon() -> Text<'static> { - icon('\u{F44F}') -} - -pub fn cross_icon() -> Text<'static> { - icon('\u{F62A}') + bootstrap_icon('\u{F5DE}') } pub fn pencil_icon() -> Text<'static> { - icon('\u{F4CB}') -} - -#[allow(dead_code)] -pub fn stakeholder_icon() -> Text<'static> { - icon('\u{F4AE}') -} - -#[allow(dead_code)] -pub fn manager_icon() -> Text<'static> { - icon('\u{F4B4}') -} - -pub fn done_icon() -> Text<'static> { - icon('\u{F26B}') -} - -pub fn todo_icon() -> Text<'static> { - icon('\u{F28A}') + bootstrap_icon('\u{F4CB}') } pub fn collapse_icon() -> Text<'static> { - icon('\u{F284}') + bootstrap_icon('\u{F284}') } pub fn collapsed_icon() -> Text<'static> { - icon('\u{F282}') + bootstrap_icon('\u{F282}') } pub fn down_icon() -> Text<'static> { - icon('\u{F279}') + bootstrap_icon('\u{F279}') } pub fn up_icon() -> Text<'static> { - icon('\u{F27C}') + bootstrap_icon('\u{F27C}') } pub fn people_icon() -> Text<'static> { - icon('\u{F4CF}') + bootstrap_icon('\u{F4CF}') +} + +pub fn network_icon() -> Text<'static> { + bootstrap_icon('\u{F40D}') +} + +const ICONEX_ICONS: Font = Font::External { + name: "Iconex icons", + bytes: include_bytes!("../static/icons/iconex/iconex-icons.ttf"), +}; + +fn iconex_icon(unicode: char) -> Text<'static> { + Text::new(unicode.to_string()) + .font(ICONEX_ICONS) + .width(Length::Units(20)) + .horizontal_alignment(alignment::Horizontal::Center) + .size(20) +} + +pub fn arrow_repeat() -> Text<'static> { + iconex_icon('\u{46BB}') +} + +pub fn send_icon() -> Text<'static> { + iconex_icon('\u{2CEE}') +} + +pub fn receive_icon() -> Text<'static> { + iconex_icon('\u{605B}') +} + +pub fn home_icon() -> Text<'static> { + iconex_icon('\u{C722}') +} + +pub fn settings_icon() -> Text<'static> { + iconex_icon('\u{3038}') +} + +pub fn key_icon() -> Text<'static> { + iconex_icon('\u{FFEC}') +} + +pub fn history_icon() -> Text<'static> { + iconex_icon('\u{BEBA}') +} + +pub fn coins_icon() -> Text<'static> { + iconex_icon('\u{9F25}') +} + +pub fn clock_icon() -> Text<'static> { + iconex_icon('\u{B0CA}') +} + +pub fn clipboard_icon() -> Text<'static> { + iconex_icon('\u{F8D3}') +} + +pub fn circle_check_icon() -> Text<'static> { + iconex_icon('\u{E2F9}') +} + +pub fn circle_cross_icon() -> Text<'static> { + iconex_icon('\u{19DA}') } diff --git a/gui/ui/src/image.rs b/gui/ui/src/image.rs index 0403e7e8..55783f6a 100644 --- a/gui/ui/src/image.rs +++ b/gui/ui/src/image.rs @@ -12,27 +12,3 @@ pub fn liana_grey_logo() -> Svg { let h = Handle::from_memory(LIANA_LOGO_GREY.to_vec()); Svg::new(h) } - -const HISTORY_ICON: &[u8] = include_bytes!("../static/icons/history-icon.svg"); -pub fn history_icon() -> Svg { - let h = Handle::from_memory(HISTORY_ICON.to_vec()); - Svg::new(h) -} - -const COINS_ICON: &[u8] = include_bytes!("../static/icons/coins-icon.svg"); -pub fn coins_icon() -> Svg { - let h = Handle::from_memory(COINS_ICON.to_vec()); - Svg::new(h) -} - -const CLOCK_ICON: &[u8] = include_bytes!("../static/icons/clock-icon.svg"); -pub fn clock_icon() -> Svg { - let h = Handle::from_memory(CLOCK_ICON.to_vec()); - Svg::new(h) -} - -const CLOCK_RED_ICON: &[u8] = include_bytes!("../static/icons/clock-red-icon.svg"); -pub fn clock_red_icon() -> Svg { - let h = Handle::from_memory(CLOCK_RED_ICON.to_vec()); - Svg::new(h) -} diff --git a/gui/ui/static/icons/clock-icon.svg b/gui/ui/static/icons/clock-icon.svg deleted file mode 100644 index a8a6e077..00000000 --- a/gui/ui/static/icons/clock-icon.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/gui/ui/static/icons/clock-red-icon.svg b/gui/ui/static/icons/clock-red-icon.svg deleted file mode 100644 index ccc387cc..00000000 --- a/gui/ui/static/icons/clock-red-icon.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/gui/ui/static/icons/coins-icon.svg b/gui/ui/static/icons/coins-icon.svg deleted file mode 100644 index 5abe3a3b..00000000 --- a/gui/ui/static/icons/coins-icon.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/gui/ui/static/icons/iconex/iconex-icons.ttf b/gui/ui/static/icons/iconex/iconex-icons.ttf new file mode 100644 index 0000000000000000000000000000000000000000..1510d962fff5eee37b8a39e4941dc4cdaf273262 GIT binary patch literal 7608 zcmds6eRNdEb)R|P`}OvFS6XS`u2yJQuxM9W?e1HUv_c=q6dQyQag7ll3KD`?APRzm z>u_SIPwnuLCMIbMrh&A_kaLo_2;46lCvKg@X-{%Y?X*3|u{l1WNu31R)R5Z7uCD#m zuJ#i`??-#x`ppAdcMtu_kM>18udLrW79};@Lxk`zpkEjs*uHgQ0+LAh%V;aZBM)tO z|6dP3fc`6l1deYU8W^m-(*7stdmT@HBM@?&UkO=0v}bMHJhsaj zFadgw%r_8>lNz`MBxPU({w?}NB0{fy+*x1_m^FQqG*M7IWbv{U)Ia?TR49JTz?depYeuoTt~ox>f$?8_uIPD#4;v@DQInQ=*cz4bKD0VLx* zLyHW3T9)Xw*3&TarA)KC#+_((*Va(WTQ9xD9l5@thJ$+$NS5s+?jorrcVQK-CB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w55!_FQ{=KKE~Zkk9DotjkiX{GrO5F3E91kgIC0mm6MubT*Ii~s{}g^P zIHp(}9(DA^GRg2T-7!r9$_JRIK3eTuB6%GyD{d%e=)&%GaMANg-RcN8<%)?4_)^;)-{iatF)J((2f1HtgDrMWJk5WNdzq-X-N3xid_d+^itG{pc|Bof zjqHSx*S&c*_mf!%%Z>O2Hka^KzXAg`SYL zkNYFRWxM{kowHu33+$09gcjTUqI-`$cmYf`+^*T3LTLvZt`)@!HczJz=X9JE5@Z-L z)|@9Kq=-W}|1_~%HuL@scW_AGan?!X%o{jFH!-O38BijBWxhSRXgNxu8GE#j`Gz`B}VyimEGH zI+JtZ_KzVDI|S90qf1I>WX)D-^IBDlC@Sa>tfED=dVz~bbcqzPRa$*khgFbdp2ZuR zfQHYC-a3od?XftLq0*Uz9`ZwpS#wr(&?U)5xaFEWPfy-)K8T#+;ZJT)%*=)AX5`j0 zGd+pnXWV+-`L^MnV!OWd2Ft5xr^)uZIx2a3>RUh+DU@MKEM#LD<}e$3%P>!7ksp^~fmm=iXx{yc#6{$}mqBk$q)Y0L^=4SR_#zEW;A<(8Z(+cb8kq zL*U$mowt#U;TuXl?lfnk&X7ht&15d%A$*--x10l@93-S`bn8RgHVtnai`K879nCam zn&(D`21j=cY(wX#$QH=iglELyYXWM^*ru_Op+SJlfg6UT5knSPJ~X^zWMCU1J&@1% zSiKDtLxu(^=n%zSZS)pWP5eCgvK*dCZAs7Qma(4EZNo#+OsX+DKRWep!1Ee%4NTjQ zQu02$ejBz2yV~7?mp9_qgpXsaW(tw}hPG|rG`c0)*w~b6Y-|MP!$&>!g=gZg*m1xwfIDJ|%2c5iYNa-6rw&{VIjM`fsRw5OpS)wsrlxt_9jwlDEnLXz z=EmlNQFk}?usWOX>|}MWIn&MRd}GdN&+EzLSi7^a%i!c? B=raHS literal 0 HcmV?d00001 diff --git a/gui/ui/static/icons/iconex/svg/IconBack.svg b/gui/ui/static/icons/iconex/svg/IconBack.svg new file mode 100644 index 00000000..7243abf0 --- /dev/null +++ b/gui/ui/static/icons/iconex/svg/IconBack.svg @@ -0,0 +1,4 @@ + + + + diff --git a/gui/ui/static/icons/iconex/svg/IconBroadcast.svg b/gui/ui/static/icons/iconex/svg/IconBroadcast.svg new file mode 100644 index 00000000..6f6cad21 --- /dev/null +++ b/gui/ui/static/icons/iconex/svg/IconBroadcast.svg @@ -0,0 +1,4 @@ + + + + diff --git a/gui/ui/static/icons/iconex/svg/IconCheck.svg b/gui/ui/static/icons/iconex/svg/IconCheck.svg new file mode 100644 index 00000000..8bc9413a --- /dev/null +++ b/gui/ui/static/icons/iconex/svg/IconCheck.svg @@ -0,0 +1,4 @@ + + + + diff --git a/gui/ui/static/icons/iconex/svg/IconClear.svg b/gui/ui/static/icons/iconex/svg/IconClear.svg new file mode 100644 index 00000000..cb0b283c --- /dev/null +++ b/gui/ui/static/icons/iconex/svg/IconClear.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/gui/ui/static/icons/iconex/svg/IconCoins.svg b/gui/ui/static/icons/iconex/svg/IconCoins.svg new file mode 100644 index 00000000..070bce92 --- /dev/null +++ b/gui/ui/static/icons/iconex/svg/IconCoins.svg @@ -0,0 +1,3 @@ + + + diff --git a/gui/ui/static/icons/iconex/svg/IconCopy.svg b/gui/ui/static/icons/iconex/svg/IconCopy.svg new file mode 100644 index 00000000..bca0ee1d --- /dev/null +++ b/gui/ui/static/icons/iconex/svg/IconCopy.svg @@ -0,0 +1,4 @@ + + + + diff --git a/gui/ui/static/icons/iconex/svg/IconDown.svg b/gui/ui/static/icons/iconex/svg/IconDown.svg new file mode 100644 index 00000000..7143a3af --- /dev/null +++ b/gui/ui/static/icons/iconex/svg/IconDown.svg @@ -0,0 +1,3 @@ + + + diff --git a/gui/ui/static/icons/history-icon.svg b/gui/ui/static/icons/iconex/svg/IconHistory.svg similarity index 100% rename from gui/ui/static/icons/history-icon.svg rename to gui/ui/static/icons/iconex/svg/IconHistory.svg diff --git a/gui/ui/static/icons/iconex/svg/IconHome.svg b/gui/ui/static/icons/iconex/svg/IconHome.svg new file mode 100644 index 00000000..d2ff0c8f --- /dev/null +++ b/gui/ui/static/icons/iconex/svg/IconHome.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/gui/ui/static/icons/iconex/svg/IconImport.svg b/gui/ui/static/icons/iconex/svg/IconImport.svg new file mode 100644 index 00000000..55416a3b --- /dev/null +++ b/gui/ui/static/icons/iconex/svg/IconImport.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/gui/ui/static/icons/iconex/svg/IconKey.svg b/gui/ui/static/icons/iconex/svg/IconKey.svg new file mode 100644 index 00000000..430b91f8 --- /dev/null +++ b/gui/ui/static/icons/iconex/svg/IconKey.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/gui/ui/static/icons/iconex/svg/IconPlus.svg b/gui/ui/static/icons/iconex/svg/IconPlus.svg new file mode 100644 index 00000000..4f5d2b82 --- /dev/null +++ b/gui/ui/static/icons/iconex/svg/IconPlus.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/gui/ui/static/icons/iconex/svg/IconReceive.svg b/gui/ui/static/icons/iconex/svg/IconReceive.svg new file mode 100644 index 00000000..a09c9028 --- /dev/null +++ b/gui/ui/static/icons/iconex/svg/IconReceive.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/gui/ui/static/icons/iconex/svg/IconRefresh.svg b/gui/ui/static/icons/iconex/svg/IconRefresh.svg new file mode 100644 index 00000000..cdca4b9b --- /dev/null +++ b/gui/ui/static/icons/iconex/svg/IconRefresh.svg @@ -0,0 +1,3 @@ + + + diff --git a/gui/ui/static/icons/iconex/svg/IconSablier.svg b/gui/ui/static/icons/iconex/svg/IconSablier.svg new file mode 100644 index 00000000..e660e1df --- /dev/null +++ b/gui/ui/static/icons/iconex/svg/IconSablier.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/gui/ui/static/icons/iconex/svg/IconSave.svg b/gui/ui/static/icons/iconex/svg/IconSave.svg new file mode 100644 index 00000000..63c9958d --- /dev/null +++ b/gui/ui/static/icons/iconex/svg/IconSave.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/gui/ui/static/icons/iconex/svg/IconSend.svg b/gui/ui/static/icons/iconex/svg/IconSend.svg new file mode 100644 index 00000000..31d82206 --- /dev/null +++ b/gui/ui/static/icons/iconex/svg/IconSend.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/gui/ui/static/icons/iconex/svg/IconTime.svg b/gui/ui/static/icons/iconex/svg/IconTime.svg new file mode 100644 index 00000000..15d2c0fe --- /dev/null +++ b/gui/ui/static/icons/iconex/svg/IconTime.svg @@ -0,0 +1,4 @@ + + + + diff --git a/gui/ui/static/icons/iconex/svg/IconeSettings.svg b/gui/ui/static/icons/iconex/svg/IconeSettings.svg new file mode 100644 index 00000000..e52b2376 --- /dev/null +++ b/gui/ui/static/icons/iconex/svg/IconeSettings.svg @@ -0,0 +1,4 @@ + + + + diff --git a/gui/ui/static/icons/iconex/svg_to_ttf.py b/gui/ui/static/icons/iconex/svg_to_ttf.py new file mode 100644 index 00000000..27eda859 --- /dev/null +++ b/gui/ui/static/icons/iconex/svg_to_ttf.py @@ -0,0 +1,33 @@ +import sys +import os +import fontforge + + +def generate_glyph_code(filename): + glyph_code = hash(filename) % 0xFFFF + + # Avoid surrogate range (0xD800-0xDFFF) + if 0xD800 <= glyph_code <= 0xDFFF: + glyph_code += 0x800 + + return glyph_code + + +input_folder = sys.argv[1] +output_font_file = sys.argv[2] + +font = fontforge.font() +font.encoding = 'UnicodeFull' + +for svg_file in os.listdir(input_folder): + if not svg_file.endswith('.svg'): + continue + + glyph_name = os.path.splitext(svg_file)[0] + glyph_code = generate_glyph_code(glyph_name) + + glyph = font.createChar(glyph_code) + glyph.importOutlines(os.path.join(input_folder, svg_file)) + glyph.simplify() + +font.generate(output_font_file)