From cda0a68854d8a3d8c284d7814aafd0da6e22dc3d Mon Sep 17 00:00:00 2001 From: kernelkind Date: Thu, 24 Jul 2025 17:35:57 -0400 Subject: [PATCH] add `route_uses_frame` need to know this to get the correct drag id Signed-off-by: kernelkind --- crates/notedeck_columns/src/nav.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/crates/notedeck_columns/src/nav.rs b/crates/notedeck_columns/src/nav.rs index bdc8f8f..7da0198 100644 --- a/crates/notedeck_columns/src/nav.rs +++ b/crates/notedeck_columns/src/nav.rs @@ -1047,3 +1047,29 @@ fn get_scroll_id( Route::Settings => None, } } + +/// Does the corresponding View for the route use a egui::Frame to wrap the ScrollArea? +/// TODO(kernelkind): this is quite hacky... +fn route_uses_frame(route: &Route) -> bool { + match route { + Route::Accounts(accounts_route) => match accounts_route { + crate::accounts::AccountsRoute::Accounts => true, + crate::accounts::AccountsRoute::AddAccount => false, + }, + Route::Relays => true, + Route::Timeline(_) => false, + Route::Thread(_) => false, + Route::Reply(_) => false, + Route::Quote(_) => false, + Route::Settings => false, + Route::ComposeNote => false, + Route::AddColumn(_) => false, + Route::EditProfile(_) => false, + Route::Support => false, + Route::NewDeck => false, + Route::Search => false, + Route::EditDeck(_) => false, + Route::Wallet(_) => false, + Route::CustomizeZapAmount(_) => false, + } +}