diff --git a/src/app/apps.rs b/src/app/apps.rs index 8bc063f..218fef5 100644 --- a/src/app/apps.rs +++ b/src/app/apps.rs @@ -99,7 +99,7 @@ impl AppIcon { .width(30) .scale_step(0.) .into(), - Self::None => space().into(), + Self::None => space().width(0).into(), } } @@ -300,7 +300,7 @@ impl App { .height(40); if theme.show_icons { - row = row.push(container(self.icons.render()).width(30).height(30)); + row = row.push(container(self.icons.render())); } row = row .push(container(text_block).width(Fill)) diff --git a/src/app/tile/update.rs b/src/app/tile/update.rs index 3cfd319..a1c92af 100644 --- a/src/app/tile/update.rs +++ b/src/app/tile/update.rs @@ -307,7 +307,8 @@ pub fn handle_update(tile: &mut Tile, message: Message) -> Task { }; let quantity = match tile.page { - Page::Main | Page::FileSearch | Page::ClipboardHistory => 56., + Page::Main | Page::FileSearch => 56., + Page::ClipboardHistory => 40., Page::EmojiSearch => 5., }; diff --git a/src/database.rs b/src/database.rs index df63e85..071ebf7 100644 --- a/src/database.rs +++ b/src/database.rs @@ -1,5 +1,5 @@ use std::{ - env, + fs, io::Cursor, path::Path, time::{Duration, SystemTime, UNIX_EPOCH}, @@ -12,13 +12,17 @@ use rusqlite::{Connection, params}; use crate::clipboard::ClipBoardContentType; pub fn initialise_database() -> Connection { - let current_exe = env::current_exe() - .ok() - .and_then(|x| x.parent().map(|x| x.to_path_buf())) - .unwrap_or(Path::new("/tmp").to_path_buf()); + let data_path = std::env::var("HOME").unwrap_or("/tmp".to_string()) + + "/Library/Application Support/rustcast"; - let conn = Connection::open(current_exe.join(Path::new("clipboard.db"))) - .expect("Couldn't open a connection to 'clipboard.db'"); + fs::create_dir_all(&data_path).expect("Unable to create datapath"); + + let conn = Connection::open( + Path::new(&(data_path + "/")) + .to_path_buf() + .join(Path::new("clipboard.db")), + ) + .expect("Couldn't open a connection to 'clipboard.db'"); if !conn .table_exists(None, "clipboard_entries")