diff --git a/docs/lucide.ttf b/docs/lucide.ttf new file mode 100644 index 0000000..cd1e66a Binary files /dev/null and b/docs/lucide.ttf differ diff --git a/src/app.rs b/src/app.rs index 43de72e..219636c 100644 --- a/src/app.rs +++ b/src/app.rs @@ -1,7 +1,7 @@ //! Main logic for the app use std::collections::HashMap; -use crate::app::apps::{App, AppCommand, ICNS_ICON}; +use crate::app::apps::{App, AppCommand, AppIcon, ICNS_ICON}; use crate::commands::Function; use crate::config::{Config, MainPage, Position, Shelly, ThemeMode}; use crate::debounce::DebouncePolicy; @@ -17,10 +17,10 @@ pub mod tile; use iced::window::{self, Id, Settings}; /// The default window width -pub const WINDOW_WIDTH: f32 = 500.; +pub const WINDOW_WIDTH: f32 = 550.; /// The default window height -pub const DEFAULT_WINDOW_HEIGHT: f32 = 100.; +pub const DEFAULT_WINDOW_HEIGHT: f32 = 150.; /// Maximum file search results returned by a single mdfind invocation. pub const FILE_SEARCH_MAX_RESULTS: u32 = 400; @@ -281,7 +281,7 @@ impl ToApps for HashMap { )), search_name: key.to_owned(), desc: "Switch Modes".to_string(), - icons: icons.clone(), + icons: AppIcon::from_handle(icons.clone()), display_name, } }) @@ -292,7 +292,7 @@ impl ToApps for HashMap { ranking: 0, open_command: AppCommand::Message(Message::SwitchMode("Default".to_string())), desc: "Change mode".to_string(), - icons: icons.clone(), + icons: AppIcon::from_handle(icons.clone()), display_name: "Default mode".to_string(), search_name: "default".to_string(), }); diff --git a/src/app/apps.rs b/src/app/apps.rs index d955562..8bc063f 100644 --- a/src/app/apps.rs +++ b/src/app/apps.rs @@ -5,11 +5,13 @@ use std::io::Cursor; use iced::{ - Alignment, + Alignment, Element, Length::{self, Fill}, + border::Radius, widget::{ Button, Row, Text, container, image::{Handle, Viewer}, + space, text::Wrapping, }, }; @@ -18,7 +20,10 @@ use crate::{ app::{Message, Page, RUSTCAST_DESC_NAME}, clipboard::ClipBoardContentType, commands::Function, - styles::{favourite_button_style, result_button_style, result_row_container_style}, + styles::{ + clipboard_icon, emoji_icon, favourite_button_style, filesearch_icon, info_icon, quit_icon, + refresh_icon, result_button_style, result_row_container_style, settings_icon, + }, utils::icns_data_to_handle, }; @@ -44,11 +49,65 @@ pub struct App { pub ranking: i32, pub open_command: AppCommand, pub desc: String, - pub icons: Option, + pub icons: AppIcon, pub display_name: String, pub search_name: String, } +#[derive(Debug, Clone)] +pub enum AppIcon { + IconFromFont(fn() -> Text<'static>), + ImageHandle(iced::widget::image::Handle), + None, +} + +impl PartialEq for AppIcon { + fn eq(&self, other: &Self) -> bool { + match (self, other) { + (Self::IconFromFont(_), Self::IconFromFont(_)) => true, + (Self::ImageHandle(l0), Self::ImageHandle(r0)) => l0 == r0, + (AppIcon::None, AppIcon::None) => true, + _ => false, + } + } +} + +impl AppIcon { + pub fn render(&self) -> Element<'static, Message> { + match self { + Self::IconFromFont(icon_fn) => container( + icon_fn() + .center() + .size(20) + .height(Length::Fill) + .width(Length::Fill), + ) + .style(|theme| container::Style { + background: None, + border: iced::Border { + color: theme.palette().text, + width: 0., + radius: Radius::new(10), + }, + ..Default::default() + }) + .height(30) + .width(30) + .into(), + Self::ImageHandle(handle) => Viewer::new(handle) + .height(30) + .width(30) + .scale_step(0.) + .into(), + Self::None => space().into(), + } + } + + pub fn from_handle(handle: Option) -> AppIcon { + handle.map(AppIcon::ImageHandle).unwrap_or(AppIcon::None) + } +} + impl PartialEq for App { fn eq(&self, other: &Self) -> bool { self.search_name == other.search_name @@ -59,7 +118,7 @@ impl PartialEq for App { } impl App { - pub fn new(name: String, icon: Option, desc: String, command: AppCommand) -> Self { + pub fn new(name: String, icon: AppIcon, desc: String, command: AppCommand) -> Self { Self { ranking: 0, open_command: command, @@ -75,7 +134,7 @@ impl App { .filter(|x| x.unicode_version() < emojis::UnicodeVersion::new(17, 13)) .map(|x| App { ranking: 0, - icons: None, + icons: AppIcon::None, display_name: x.to_string(), search_name: x.name().to_string(), open_command: AppCommand::Function(Function::CopyToClipboard( @@ -89,8 +148,6 @@ impl App { pub fn basic_apps() -> Vec { let app_version = option_env!("APP_VERSION").unwrap_or("Unknown Version"); - let icons = icns_data_to_handle(ICNS_ICON.to_vec()); - let ferris_handle = image::ImageReader::new(Cursor::new(include_bytes!("../../docs/ferris_rs.png"))) .with_guessed_format() @@ -105,7 +162,7 @@ impl App { open_command: AppCommand::Function(Function::OpenWebsite( "https://ferris.rs".to_string(), )), - icons: ferris_handle, + icons: AppIcon::from_handle(ferris_handle), desc: "Easter Egg".to_string(), display_name: "Ferris Plushies".to_string(), search_name: "ferris.rs".to_string(), @@ -114,7 +171,7 @@ impl App { ranking: 0, open_command: AppCommand::Function(Function::Quit), desc: RUSTCAST_DESC_NAME.to_string(), - icons: icons.clone(), + icons: AppIcon::IconFromFont(quit_icon), display_name: "Quit RustCast".to_string(), search_name: "quit".to_string(), }, @@ -122,7 +179,7 @@ impl App { ranking: 0, open_command: AppCommand::Function(Function::QuitAllApps), desc: RUSTCAST_DESC_NAME.to_string(), - icons: icons.clone(), + icons: AppIcon::IconFromFont(quit_icon), display_name: "Quit All Apps".to_string(), search_name: "quit all apps".to_string(), }, @@ -130,7 +187,7 @@ impl App { ranking: 0, open_command: AppCommand::Message(Message::OpenSettingsWindow), desc: RUSTCAST_DESC_NAME.to_string(), - icons: icons.clone(), + icons: AppIcon::IconFromFont(settings_icon), display_name: "Open RustCast Preferences".to_string(), search_name: "settings".to_string(), }, @@ -138,7 +195,7 @@ impl App { ranking: 0, open_command: AppCommand::Message(Message::SwitchToPage(Page::EmojiSearch)), desc: RUSTCAST_DESC_NAME.to_string(), - icons: icons.clone(), + icons: AppIcon::IconFromFont(emoji_icon), display_name: "Search for an Emoji".to_string(), search_name: "emoji".to_string(), }, @@ -146,7 +203,7 @@ impl App { ranking: 0, open_command: AppCommand::Message(Message::SwitchToPage(Page::ClipboardHistory)), desc: RUSTCAST_DESC_NAME.to_string(), - icons: icons.clone(), + icons: AppIcon::IconFromFont(clipboard_icon), display_name: "Clipboard History".to_string(), search_name: "clipboard".to_string(), }, @@ -154,7 +211,7 @@ impl App { ranking: 0, open_command: AppCommand::Message(Message::SwitchToPage(Page::FileSearch)), desc: RUSTCAST_DESC_NAME.to_string(), - icons: icons.clone(), + icons: AppIcon::IconFromFont(filesearch_icon), display_name: "Search for a file".to_string(), search_name: "file search".to_string(), }, @@ -162,7 +219,7 @@ impl App { ranking: 0, open_command: AppCommand::Message(Message::ReloadConfig), desc: RUSTCAST_DESC_NAME.to_string(), - icons: icons.clone(), + icons: AppIcon::IconFromFont(refresh_icon), display_name: "Reload RustCast".to_string(), search_name: "refresh".to_string(), }, @@ -170,7 +227,7 @@ impl App { ranking: 0, open_command: AppCommand::Display, desc: RUSTCAST_DESC_NAME.to_string(), - icons: icons.clone(), + icons: AppIcon::IconFromFont(info_icon), display_name: format!("Current RustCast Version: {app_version}"), search_name: "version".to_string(), }, @@ -204,7 +261,7 @@ impl App { ranking: 0, open_command: AppCommand::Function(Function::TileWindow(pos.clone())), desc: "Window Tiling".to_string(), - icons: icons.clone(), + icons: AppIcon::from_handle(icons.clone()), display_name: name.to_string(), search_name: name.to_lowercase(), }) @@ -222,38 +279,32 @@ impl App { let focused = focussed_id == id_num; // Title + subtitle (Raycast style) - let text_block = iced::widget::Column::new() - .spacing(2) - .push( - Text::new(self.display_name) - .font(theme.font()) - .size(16) - .wrapping(Wrapping::None) - .color(theme.text_color(1.0)), - ) - .push( - Text::new(self.desc) - .font(theme.font()) - .size(13) - .color(theme.text_color(0.55)), - ); + let text_block = Text::new(self.display_name) + .font(theme.font()) + .size(16) + .wrapping(Wrapping::None) + .color(theme.text_color(1.0)); + let subtitle_block = container( + Text::new(self.desc) + .font(theme.font()) + .size(13) + .width(Length::Fill) + .align_x(Alignment::End) + .color(theme.text_color(0.55)), + ); let mut row = Row::new() .align_y(Alignment::Center) .width(Fill) .spacing(10) - .height(50); + .height(40); - if theme.show_icons - && let Some(icon) = &self.icons - { - row = row.push( - container(Viewer::new(icon).height(40).width(40)) - .width(40) - .height(40), - ); + if theme.show_icons { + row = row.push(container(self.icons.render()).width(30).height(30)); } - row = row.push(container(text_block).width(Fill)); + row = row + .push(container(text_block).width(Fill)) + .push(subtitle_block); let name = self.search_name.clone(); let theme_clone = theme.clone(); @@ -261,7 +312,7 @@ impl App { row = row.push( Button::new(Text::new("♥️").width(Length::Fill).align_x(Alignment::End)) .on_press_with(move || Message::ToggleFavouriteApp(name.clone())) - .width(Length::Fill) + .width(20) .style(move |_, status| favourite_button_style(&theme_clone, status, is_favourite)), ); @@ -278,7 +329,7 @@ impl App { .style(move |_, _| result_button_style(&theme_clone)) .width(Fill) .padding(0) - .height(50); + .height(40); container(content) .id(format!("result-{}", id_num)) diff --git a/src/app/tile.rs b/src/app/tile.rs index 558cbf4..88dfb58 100644 --- a/src/app/tile.rs +++ b/src/app/tile.rs @@ -18,7 +18,7 @@ use iced::futures::SinkExt; use iced::futures::channel::mpsc::{Sender, channel}; use iced::keyboard::Modifiers; use iced::{ - Subscription, Theme, futures, + Subscription, futures, keyboard::{self, key::Named}, stream, }; @@ -232,8 +232,8 @@ impl Hotkeys { impl Tile { /// This returns the theme of the window - pub fn theme(&self, _: window::Id) -> Option { - Some(self.theme.clone()) + pub fn theme(&self, _: window::Id) -> Option { + Some(self.config.theme.clone().into()) } /// This handles the subscriptions of the window @@ -606,7 +606,7 @@ fn handle_file_search() -> impl futures::Stream { #[allow(clippy::items_after_test_module)] mod tests { use super::*; - use crate::app::apps::{App, AppCommand}; + use crate::app::apps::{App, AppCommand, AppIcon}; use crate::commands::Function; use iced::futures::StreamExt; use tokio::io::{AsyncWriteExt, duplex}; @@ -618,7 +618,7 @@ mod tests { "/Applications/{name}.app" ))), desc: "Application".to_string(), - icons: None, + icons: AppIcon::None, display_name: name.to_string(), search_name: name.to_lowercase(), } diff --git a/src/app/tile/elm.rs b/src/app/tile/elm.rs index b20e415..ff493d8 100644 --- a/src/app/tile/elm.rs +++ b/src/app/tile/elm.rs @@ -177,7 +177,7 @@ pub fn view(tile: &Tile, wid: window::Id) -> Element<'_, Message> { Page::ClipboardHistory => 385, // Height of each emoji is EMOJI_HEIGHT + 20 for padding Page::EmojiSearch => std::cmp::min(tile.results.len().div_ceil(6) * 90, 290), - _ => std::cmp::min(tile.results.len() * 60, 290), + _ => std::cmp::min(tile.results.len() * 56, 290), }; let theme = tile.config.theme.clone(); @@ -216,7 +216,7 @@ pub fn view(tile: &Tile, wid: window::Id) -> Element<'_, Message> { text_color: None, background: None, border: iced::Border { - color: Color::TRANSPARENT, + color: Color::WHITE, width: 0., radius: Radius::new(15), }, @@ -224,6 +224,7 @@ pub fn view(tile: &Tile, wid: window::Id) -> Element<'_, Message> { }); container(contents) + .padding(10) .style(|_| contents_style(&tile.config.theme)) .into() } else { diff --git a/src/app/tile/update.rs b/src/app/tile/update.rs index b2b5c03..8e09fc9 100644 --- a/src/app/tile/update.rs +++ b/src/app/tile/update.rs @@ -30,6 +30,7 @@ use crate::app::ToApps; use crate::app::WINDOW_WIDTH; use crate::app::apps::App; use crate::app::apps::AppCommand; +use crate::app::apps::AppIcon; use crate::app::default_settings; use crate::app::menubar::menu_builder; use crate::app::menubar::menu_icon; @@ -304,7 +305,7 @@ pub fn handle_update(tile: &mut Tile, message: Message) -> Task { }; let quantity = match tile.page { - Page::Main | Page::FileSearch | Page::ClipboardHistory => 66.5, + Page::Main | Page::FileSearch | Page::ClipboardHistory => 56., Page::EmojiSearch => 5., }; @@ -488,7 +489,7 @@ pub fn handle_update(tile: &mut Tile, message: Message) -> Task { let id = x.unwrap(); Message::ResizeWindow( id, - ((7 * 55) + 35 + DEFAULT_WINDOW_HEIGHT as usize) as f32, + ((7 * 30) + 35 + DEFAULT_WINDOW_HEIGHT as usize) as f32, ) }) } @@ -496,6 +497,7 @@ pub fn handle_update(tile: &mut Tile, message: Message) -> Task { }; tile.page = page; + tile.focus_id = 0; let refresh_empty_main_query = if tile.page == Page::Main { window::latest() @@ -1220,7 +1222,7 @@ fn execute_query(tile: &mut Tile, id: Id) -> Task { ranking: 0, open_command: AppCommand::Function(Function::RandomVar(rand_num)), desc: "Easter egg".to_string(), - icons: None, + icons: AppIcon::None, display_name: rand_num.to_string(), search_name: String::new(), }]; @@ -1233,7 +1235,7 @@ fn execute_query(tile: &mut Tile, id: Id) -> Task { "https://zombo.com".to_string(), )), desc: "Easter Egg".to_string(), - icons: None, + icons: AppIcon::None, display_name: "🫳 🌱".to_string(), search_name: "".to_string(), }]; @@ -1244,7 +1246,7 @@ fn execute_query(tile: &mut Tile, id: Id) -> Task { ranking: 0, open_command: AppCommand::Display, desc: "Easter Egg".to_string(), - icons: lemon_icon_handle(), + icons: AppIcon::from_handle(lemon_icon_handle()), display_name: "Lemon".to_string(), search_name: "".to_string(), }]; @@ -1255,7 +1257,7 @@ fn execute_query(tile: &mut Tile, id: Id) -> Task { ranking: 0, open_command: AppCommand::Function(Function::RandomVar(67)), desc: "Easter egg".to_string(), - icons: None, + icons: AppIcon::None, display_name: 67.to_string(), search_name: String::new(), }]; @@ -1284,7 +1286,7 @@ fn execute_query(tile: &mut Tile, id: Id) -> Task { ranking: 20, open_command: AppCommand::Function(Function::RunShellCommand(command.clone())), display_name: format!("Shell Command: {}", command), - icons: None, + icons: AppIcon::None, search_name: "".to_string(), desc: "Shell Command".to_string(), }]; @@ -1349,7 +1351,7 @@ fn execute_query(tile: &mut Tile, id: Id) -> Task { ranking: 0, open_command: AppCommand::Function(Function::OpenWebsite(tile.query.clone())), desc: "Web Browsing".to_string(), - icons: None, + icons: AppIcon::None, display_name: "Open Website: ".to_string() + &tile.query, search_name: String::new(), }); @@ -1364,7 +1366,7 @@ fn execute_query(tile: &mut Tile, id: Id) -> Task { ranking: 0, open_command: AppCommand::Function(Function::Calculate(res.clone())), desc: RUSTCAST_DESC_NAME.to_string(), - icons: None, + icons: AppIcon::None, display_name: res.eval().map(|x| x.to_string()).unwrap_or("".to_string()), search_name: "".to_string(), }); @@ -1373,7 +1375,7 @@ fn execute_query(tile: &mut Tile, id: Id) -> Task { tile.results = vec![App { ranking: 0, open_command: AppCommand::Function(Function::GoogleSearch(tile.query.clone())), - icons: None, + icons: AppIcon::None, desc: "Web Search".to_string(), display_name: format!("Search for: {}", tile.query), search_name: String::new(), @@ -1396,7 +1398,7 @@ mod tests { ranking, open_command: command, desc: "Application".to_string(), - icons: None, + icons: AppIcon::None, display_name: search_name.to_string(), search_name: search_name.to_string(), } diff --git a/src/clipboard.rs b/src/clipboard.rs index bee6614..2e72966 100644 --- a/src/clipboard.rs +++ b/src/clipboard.rs @@ -2,7 +2,10 @@ use arboard::ImageData; use crate::{ - app::{ToApp, apps::App}, + app::{ + ToApp, + apps::{App, AppIcon}, + }, commands::Function, }; @@ -34,7 +37,7 @@ impl ToApp for ClipBoardContentType { self_clone.to_owned(), )), desc: "Clipboard Item".to_string(), - icons: None, + icons: AppIcon::None, display_name, search_name, } diff --git a/src/commands.rs b/src/commands.rs index c4f88e5..290e58b 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -7,7 +7,7 @@ use objc2_app_kit::NSWorkspace; use objc2_foundation::NSURL; use crate::{ - app::apps::{App, AppCommand}, + app::apps::{App, AppCommand, AppIcon}, calculator::Expr, clipboard::ClipBoardContentType, config::Config, @@ -156,7 +156,7 @@ pub fn path_to_app(absolute_path: &str, home_dir: &str) -> Option { ranking: 0, open_command: AppCommand::Function(Function::OpenApp(path.to_string())), desc: display_path, - icons: None, + icons: AppIcon::None, display_name: filename.to_string(), search_name: filename.to_lowercase(), }) diff --git a/src/config.rs b/src/config.rs index bd92447..169ea9c 100644 --- a/src/config.rs +++ b/src/config.rs @@ -10,7 +10,7 @@ use serde::{Deserialize, Serialize}; use crate::{ app::{ ToApp, - apps::{App, AppCommand}, + apps::{App, AppCommand, AppIcon}, }, commands::Function, utils::handle_from_icns, @@ -365,7 +365,7 @@ impl ToApp for Shelly { ranking: 0, open_command: AppCommand::Function(Function::RunShellCommand(self_clone.command)), desc: "Shell Command".to_string(), - icons: icon, + icons: AppIcon::from_handle(icon), display_name: self_clone.alias, search_name: self_clone.alias_lc, } diff --git a/src/main.rs b/src/main.rs index 1ec7c28..44f3de8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -19,6 +19,7 @@ use crate::{ app::tile::{self, Hotkeys, Tile}, config::Config, platform::macos::{get_autostart_status, launching::Shortcut}, + styles::load_font, }; use log::info; @@ -96,6 +97,7 @@ fn main() -> iced::Result { tile::elm::view, ) .subscription(Tile::subscription) + .font(load_font()) .theme(Tile::theme) .run() } diff --git a/src/platform/cross.rs b/src/platform/cross.rs index f51d5a9..da6180a 100644 --- a/src/platform/cross.rs +++ b/src/platform/cross.rs @@ -7,7 +7,7 @@ use log::{error, info}; use rayon::iter::{IntoParallelIterator, IntoParallelRefIterator, ParallelIterator as _}; use crate::{ - app::apps::{App, AppCommand}, + app::apps::{App, AppCommand, AppIcon}, commands::Function, utils::handle_from_icns, }; @@ -80,6 +80,7 @@ fn discover_apps(dir: impl AsRef, store_icons: bool) -> Vec { } else { None }; + let icons = AppIcon::from_handle(icons); let name = file_name.strip_suffix(".app").unwrap().to_string(); Some(App { diff --git a/src/platform/macos/discovery.rs b/src/platform/macos/discovery.rs index 52bbe3e..aa6407d 100644 --- a/src/platform/macos/discovery.rs +++ b/src/platform/macos/discovery.rs @@ -32,7 +32,7 @@ use objc2_foundation::{ use rayon::iter::{IntoParallelIterator, ParallelIterator as _}; use crate::{ - app::apps::{App, AppCommand}, + app::apps::{App, AppCommand, AppIcon}, commands::Function, }; @@ -283,6 +283,7 @@ fn query_app(url: impl AsRef, store_icons: bool) -> Option { } else { None }; + let icons = AppIcon::from_handle(icons); Some(App { ranking: 0, diff --git a/src/platform/macos/events.rs b/src/platform/macos/events.rs index a91373b..bc0b4aa 100644 --- a/src/platform/macos/events.rs +++ b/src/platform/macos/events.rs @@ -6,7 +6,7 @@ use objc2_foundation::{NSDate, NSDateFormatter, NSDateFormatterStyle, NSError}; use crate::{ app::{ ToApp, - apps::{App, AppCommand, ICNS_ICON}, + apps::{App, AppCommand, AppIcon, ICNS_ICON}, }, commands::Function, utils::icns_data_to_handle, @@ -27,7 +27,12 @@ impl ToApp for Event { } else { AppCommand::Display }; - App::new(self.event_name.clone(), icons, self.time.clone(), appcmd) + App::new( + self.event_name.clone(), + AppIcon::from_handle(icons), + self.time.clone(), + appcmd, + ) } } diff --git a/src/quit.rs b/src/quit.rs index 2678a15..adf1b45 100644 --- a/src/quit.rs +++ b/src/quit.rs @@ -5,7 +5,7 @@ use objc2_app_kit::{NSApplicationActivationPolicy, NSWorkspace}; use objc2_foundation::NSString; use crate::{ - app::apps::{App, AppCommand}, + app::apps::{App, AppCommand, AppIcon}, commands::Function, platform::macos::discovery::icon_of_path_ns, }; @@ -39,6 +39,7 @@ pub fn get_open_apps(store_icons: bool) -> Vec { } else { None }; + let icons = AppIcon::from_handle(icons); Some(App { ranking: 0, diff --git a/src/styles.rs b/src/styles.rs index 4bc964d..47dfb56 100644 --- a/src/styles.rs +++ b/src/styles.rs @@ -7,6 +7,8 @@ use iced::widget::toggler::Status; use iced::widget::{button, container, pick_list, radio, scrollable, slider, toggler}; use iced::{Background, Border, Color, widget::text_input}; +use std::borrow::Cow; + /// Helper: mix base color with white (simple “tint”) pub fn tint(mut c: Color, amount: f32) -> Color { c.r = c.r + (1.0 - c.r) * amount; @@ -15,6 +17,35 @@ pub fn tint(mut c: Color, amount: f32) -> Color { c } +pub fn load_font() -> Cow<'static, [u8]> { + include_bytes!("../docs/lucide.ttf").as_slice().into() +} + +pub static LUCIDE_FONT: iced::Font = iced::Font::with_name("lucide"); + +macro_rules! icon { + ($name:ident = $icon:literal) => { + pub fn $name<'a>() -> ::iced::widget::Text<'a> { + ::iced::widget::text(const { ::core::char::from_u32($icon).unwrap() }) + .font(LUCIDE_FONT) + .line_height(1.0) + } + }; +} + +icon!(info_icon = 57921); +icon!(filesearch_icon = 57547); +icon!(clipboard_icon = 58119); +icon!(emoji_icon = 57700); +icon!(settings_icon = 58123); +icon!(refresh_icon = 57669); +icon!(quit_icon = 57476); +icon!(hide_icon = 58926); +icon!(unlock = 57612); +icon!(palette = 57821); +icon!(bolt = 58764); +icon!(info = 57593); + /// Helper: apply alpha pub fn with_alpha(mut c: Color, a: f32) -> Color { c.a = a; @@ -76,8 +107,8 @@ pub fn contents_style(theme: &ConfigTheme) -> container::Style { text_color: None, border: iced::Border { color: theme.bg_color(), - width: 0.4, - radius: Radius::new(14.0), + width: 0., + radius: Radius::new(15.0), }, ..Default::default() } diff --git a/src/unit_conversion.rs b/src/unit_conversion.rs index c96ca8e..bc4288f 100644 --- a/src/unit_conversion.rs +++ b/src/unit_conversion.rs @@ -3,7 +3,7 @@ use crate::{ app::{ ToApp, - apps::{App, AppCommand}, + apps::{App, AppCommand, AppIcon}, }, clipboard::ClipBoardContentType, commands::Function, @@ -259,7 +259,7 @@ impl ToApp for ConversionResult { ClipBoardContentType::Text(target.clone()), )), desc: source, - icons: None, + icons: AppIcon::None, display_name: target, search_name: String::new(), }