[READ-ONLY] Mirror of https://github.com/probablykasper/kadium. App for staying ontop of YouTube channels' uploads kadium.kasper.space
linux macos notifications tauri windows youtube
0

Configure Feed

Select the types of activity you want to include in your feed.

feat: add option to disable window decorations (#17)

+34 -5
+1
CHANGELOG.md
··· 2 2 3 3 ## Next 4 4 - Use Shift instead of Alt for Videos/Channels page shortcuts 5 + - Add option to disable window decorations 5 6 - Fix keyboard input working when modal is open 6 7 - Remove old YouTube Email Notifier migration 7 8
+3 -3
bindings.ts
··· 40 40 else return { status: "error", error: e as any }; 41 41 } 42 42 }, 43 - async setGeneralSettings(apiKey: string, maxConcurrentRequests: number, checkInBackground: boolean) : Promise<Result<null, string>> { 43 + async setGeneralSettings(apiKey: string, maxConcurrentRequests: number, checkInBackground: boolean, noWindowDecorations: boolean) : Promise<Result<null, string>> { 44 44 try { 45 - return { status: "ok", data: await TAURI_INVOKE("set_general_settings", { apiKey, maxConcurrentRequests, checkInBackground }) }; 45 + return { status: "ok", data: await TAURI_INVOKE("set_general_settings", { apiKey, maxConcurrentRequests, checkInBackground, noWindowDecorations }) }; 46 46 } catch (e) { 47 47 if(e instanceof Error) throw e; 48 48 else return { status: "error", error: e as any }; ··· 105 105 export type After = { publishTimeMs: number; id: string } 106 106 export type Channel = { id: string; name: string; icon: string; uploads_playlist_id: string; from_time: number; refresh_rate_ms: number; tags: string[] } 107 107 export type Options = { show_all: boolean; show_archived: boolean; channel_filter: string; tag: string | null; limit: number } 108 - export type Settings = { api_key: string; max_concurrent_requests: number; channels: Channel[]; check_in_background: boolean } 108 + export type Settings = { api_key: string; max_concurrent_requests: number; channels: Channel[]; check_in_background: boolean; no_window_decorations?: boolean } 109 109 export type UndoHistory = { entries: ([number, Action])[] } 110 110 export type Video = { id: string; title: string; description: string; publishTimeMs: number; 111 111 /**
+1
src-tauri/src/api.rs
··· 155 155 } 156 156 #[derive(Deserialize, Debug)] 157 157 pub struct Thumbnail { 158 + #[allow(dead_code)] 158 159 pub url: String, 159 160 } 160 161 }
+9 -1
src-tauri/src/data.rs
··· 13 13 use std::path::{Path, PathBuf}; 14 14 use std::sync::Arc; 15 15 use std::time::{SystemTime, UNIX_EPOCH}; 16 - use tauri::{command, Config, Error, State}; 16 + use tauri::{command, Config, Error, Manager, State}; 17 17 use tokio::sync::Mutex; 18 18 use url::Url; 19 19 ··· 283 283 #[command] 284 284 #[specta::specta] 285 285 pub async fn set_general_settings( 286 + app_handle: tauri::AppHandle, 286 287 api_key: String, 287 288 max_concurrent_requests: u32, 288 289 check_in_background: bool, 290 + no_window_decorations: bool, 289 291 data: DataState<'_>, 290 292 ) -> Result<(), String> { 291 293 let mut data = data.0.lock().await; 292 294 data.settings().set_api_key(api_key); 293 295 data.settings().max_concurrent_requests = max_concurrent_requests; 294 296 data.settings().check_in_background = check_in_background; 297 + data.settings().no_window_decorations = no_window_decorations; 298 + app_handle 299 + .get_webview_window("main") 300 + .unwrap() 301 + .set_decorations(!no_window_decorations) 302 + .unwrap(); 295 303 data.save_settings()?; 296 304 Ok(()) 297 305 }
+1
src-tauri/src/lib.rs
··· 114 114 .title("Kadium") 115 115 .inner_size(900.0, 800.0) 116 116 .min_inner_size(400.0, 150.0) 117 + .decorations(!settings.unwrap_ref().no_window_decorations) 117 118 .theme(Some(tauri::Theme::Dark)); 118 119 119 120 #[cfg(target_os = "macos")]
+4
src-tauri/src/settings.rs
··· 25 25 max_concurrent_requests: 5, 26 26 channels: Vec::new(), 27 27 check_in_background: true, 28 + no_window_decorations: false, 28 29 }) 29 30 } 30 31 } ··· 91 92 pub max_concurrent_requests: u32, 92 93 pub channels: Vec<Channel>, 93 94 pub check_in_background: bool, 95 + #[serde(default)] 96 + pub no_window_decorations: bool, 94 97 } 95 98 impl Settings { 99 + #[allow(dead_code)] 96 100 pub fn wrap(self) -> VersionedSettings { 97 101 VersionedSettings::V1(self) 98 102 }
+1
src/lib/data.ts
··· 76 76 return channels 77 77 })(), 78 78 check_in_background: true, 79 + no_window_decorations: true, 79 80 }) 80 81 }
+13 -1
src/lib/modals/Settings.svelte
··· 9 9 export let apiKey: string 10 10 export let maxConcurrentRequests: number 11 11 export let checkInBackground: boolean 12 + export let noWindowDecorations: boolean 12 13 13 14 export let visible = false 14 15 let keyGuideVisible = false 15 16 16 17 async function setGeneralSettings() { 17 - await commands.setGeneralSettings(apiKey, maxConcurrentRequests, checkInBackground) 18 + await commands.setGeneralSettings( 19 + apiKey, 20 + maxConcurrentRequests, 21 + checkInBackground, 22 + noWindowDecorations, 23 + ) 18 24 await loadSettings() 19 25 visible = false 20 26 } ··· 42 48 <p>Check for new videos automatically</p> 43 49 </label> 44 50 <Switch id="check-in-background" bind:checked={checkInBackground} /> 51 + </div> 52 + <div class="toggle-row"> 53 + <label for="window-decorations"> 54 + <p>Disable window decorations</p> 55 + </label> 56 + <Switch id="no-window-decorations" bind:checked={noWindowDecorations} /> 45 57 </div> 46 58 <div class="buttons"> 47 59 <Button secondary on:click={() => (visible = false)}>Cancel</Button>
+1
src/routes/+layout.svelte
··· 70 70 apiKey={$settings.api_key} 71 71 maxConcurrentRequests={$settings.max_concurrent_requests} 72 72 checkInBackground={$settings.check_in_background} 73 + noWindowDecorations={$settings.no_window_decorations ?? false} 73 74 bind:visible={$settingsOpen} 74 75 /> 75 76