From 9db93107cc8364bbd7a469059bca57d1b8afbc16 Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Tue, 19 Aug 2025 06:38:43 -0500 Subject: [PATCH 1/2] adding lldb and dir-locals for debugging --- .dir-locals.el | 4 ++++ Cargo.toml | 4 ++-- flake.nix | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .dir-locals.el diff --git a/.dir-locals.el b/.dir-locals.el new file mode 100644 index 0000000..f9937e3 --- /dev/null +++ b/.dir-locals.el @@ -0,0 +1,4 @@ +;;; Directory Local Variables -*- no-byte-compile: t -*- +;;; For more information see (info "(emacs) Directory Variables") + +((nil . ((dape-command . (lldb-dap :program "target/debug/lumina" :args ["-i" "test_presentation.lisp"]))))) diff --git a/Cargo.toml b/Cargo.toml index b62483e..27051a0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,8 +43,8 @@ git = "https://github.com/jackpot51/iced_video_player.git" branch = "cosmic" features = ["wgpu"] -[profile.dev] -opt-level = 3 +# [profile.dev] +# opt-level = 3 [profile.release] opt-level = 3 diff --git a/flake.nix b/flake.nix index 3f7e7d0..97f77af 100644 --- a/flake.nix +++ b/flake.nix @@ -42,6 +42,7 @@ stdenv gnumake gdb + lldb cmake makeWrapper vulkan-headers From 79eff08addcfcd2df7b4432fe704d639c51b8e2b Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Tue, 19 Aug 2025 06:38:58 -0500 Subject: [PATCH 2/2] less indent --- src/main.rs | 68 ++++++++++++++++++++++++++++------------------------- 1 file changed, 36 insertions(+), 32 deletions(-) diff --git a/src/main.rs b/src/main.rs index 9adfc15..7ed2c2d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -278,38 +278,42 @@ impl cosmic::Application for App { .iter() .enumerate() .map(|(index, item)| { - dnd_destination(tooltip( button::standard(item.title.clone()) - .leading_icon({ - match item.kind { - core::kinds::ServiceItemKind::Song(_) => { - icon::from_name("folder-music-symbolic") - }, - core::kinds::ServiceItemKind::Video(_) => { - icon::from_name("folder-videos-symbolic") - }, - core::kinds::ServiceItemKind::Image(_) => { - icon::from_name("folder-pictures-symbolic") - }, - core::kinds::ServiceItemKind::Presentation(_) => { - icon::from_name("x-office-presentation-symbolic") - }, - core::kinds::ServiceItemKind::Content(_) => { - icon::from_name("x-office-presentation-symbolic") - }, - } - }) - .class(cosmic::theme::style::Button::HeaderBar) - .padding(5) - .width(Length::Fill) - .on_press(cosmic::Action::App(Message::ChangeServiceItem(index))), - text::body(item.kind.to_string()), TPosition::Right), vec!["application/service-item".into()]).data_received_for::( move |item| { - if let Some(item) = item { - cosmic::Action::App(Message::AddServiceItem(index, item)) - } else { - cosmic::Action::None - } - }) - .into() + let button = button::standard(item.title.clone()) + .leading_icon({ + match item.kind { + core::kinds::ServiceItemKind::Song(_) => { + icon::from_name("folder-music-symbolic") + }, + core::kinds::ServiceItemKind::Video(_) => { + icon::from_name("folder-videos-symbolic") + }, + core::kinds::ServiceItemKind::Image(_) => { + icon::from_name("folder-pictures-symbolic") + }, + core::kinds::ServiceItemKind::Presentation(_) => { + icon::from_name("x-office-presentation-symbolic") + }, + core::kinds::ServiceItemKind::Content(_) => { + icon::from_name("x-office-presentation-symbolic") + }, + } + }) + .class(cosmic::theme::style::Button::HeaderBar) + .padding(5) + .width(Length::Fill) + .on_press(cosmic::Action::App(Message::ChangeServiceItem(index))); + let tooltip = tooltip(button, + text::body(item.kind.to_string()), + TPosition::Right); + dnd_destination(tooltip, vec!["application/service-item".into()]) + .data_received_for::( move |item| { + if let Some(item) = item { + cosmic::Action::App(Message::AddServiceItem(index, item)) + } else { + cosmic::Action::None + } + }) + .into() }); let column = column![