From 0abe9a8206ae8780a0e296a0787394e0b89bf3b1 Mon Sep 17 00:00:00 2001 From: Lyra Date: Wed, 16 Sep 2026 22:26:22 -0400 Subject: [PATCH] Menu bar + settings window + about window --- Cargo.lock | 1 + Cargo.toml | 3 +- src/app.rs | 32 ++++++------ src/main.rs | 29 +++++++---- src/test_layer.rs | 25 --------- src/top_bar_layer.rs | 118 +++++++++++++++++++++++++++++++++++++++++++ src/video_quality.rs | 34 +++++++++++++ 7 files changed, 190 insertions(+), 52 deletions(-) delete mode 100644 src/test_layer.rs create mode 100644 src/top_bar_layer.rs create mode 100644 src/video_quality.rs diff --git a/Cargo.lock b/Cargo.lock index 5434556..41d9b94 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6338,6 +6338,7 @@ dependencies = [ "tokio", "tracing", "tracing-subscriber", + "webbrowser", "yt-dlp", ] diff --git a/Cargo.toml b/Cargo.toml index c17a233..ad740d8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,6 +13,7 @@ serde_json = "1.0.151" tokio = {version = "1.53.1", features = ["macros", "rt-multi-thread"]} tracing = "0.1.44" tracing-subscriber = {version = "0.3.23", features = ["env-filter"]} +webbrowser = "1.2.4" yt-dlp = "2.8.3" [profile.release] @@ -24,4 +25,4 @@ debug-assertions = false incremental = false rpath = false codegen-units = 1 -strip = true \ No newline at end of file +strip = true diff --git a/src/app.rs b/src/app.rs index 7aa8ea2..16c2bde 100644 --- a/src/app.rs +++ b/src/app.rs @@ -1,21 +1,21 @@ -use std::time::Duration; -use eframe::{Frame, Storage, CreationContext}; use eframe::egui::{Context, Ui}; +use eframe::{CreationContext, Frame, Storage}; use serde::{Deserialize, Serialize}; +use std::time::Duration; use yt_dlp::model::VideoQuality; pub(crate) struct Application { - settings: AppSettings, - layers: Vec>, + pub settings: AppSettings, + layers: Vec>, data: Data, } #[derive(Serialize, Deserialize, Default)] -struct AppSettings { - use_cookies: bool, - use_firefox_cookies: bool, - use_chrome_cookies: bool, - save_thumbnails: bool, +pub struct AppSettings { + pub(crate) use_firefox_cookies: bool, + pub(crate) use_chrome_cookies: bool, + pub(crate) save_thumbnails: bool, + pub(crate) video_download_quality: crate::video_quality::VideoDownloadQuality, } #[derive(Serialize, Deserialize, Default)] @@ -31,6 +31,7 @@ struct Video { uuid: String, original_url: String, video_path: String, + has_thumbnail: bool, thumbnail_path: String, thumbnail_path_low_quality: String, video_quality: VideoQuality, @@ -43,11 +44,11 @@ struct Playlist { original_url: String, videos: Vec