hide navigation title on global nav

Fixes: https://github.com/damus-io/notedeck/issues/109
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2024-06-24 16:47:35 -07:00
parent a9a07b3805
commit a66b467cb4
3 changed files with 15 additions and 9 deletions

2
Cargo.lock generated
View File

@@ -1108,7 +1108,7 @@ dependencies = [
[[package]]
name = "egui_nav"
version = "0.1.0"
source = "git+https://github.com/damus-io/egui-nav?rev=ef7018a261aa0de13b5074ab3e812ef56e44db09#ef7018a261aa0de13b5074ab3e812ef56e44db09"
source = "git+https://github.com/damus-io/egui-nav?rev=d15bdcedbed93d25f1d45d7b94f35ac25ee0bdc2#d15bdcedbed93d25f1d45d7b94f35ac25ee0bdc2"
dependencies = [
"egui",
"egui_extras",

View File

@@ -32,7 +32,7 @@ eframe = { version = "0.27.2", default-features = false, features = [ "glow", "w
egui_extras = { version = "0.27.2", features = ["all_loaders"] }
ehttp = "0.2.0"
egui_tabs = { git = "https://github.com/damus-io/egui-tabs", rev = "120971fc43db6ba0b6f194f4bd4a66f7e00a4e22" }
egui_nav = { git = "https://github.com/damus-io/egui-nav", rev = "ef7018a261aa0de13b5074ab3e812ef56e44db09" }
egui_nav = { git = "https://github.com/damus-io/egui-nav", rev = "d15bdcedbed93d25f1d45d7b94f35ac25ee0bdc2" }
reqwest = { version = "0.12.4", default-features = false, features = [ "rustls-tls-native-roots" ] }
image = { version = "0.24", features = ["jpeg", "png", "webp"] }
log = "0.4.17"

View File

@@ -26,13 +26,19 @@ impl DesktopGlobalPopup {
let app_ctx = Rc::new(RefCell::new(app));
let resp = FixedWindow::maybe_with_title(title).show(ui, rect, |ui| {
let nav_response = Nav::new(routes).navigating(false).show(ui, |ui, nav| {
if let Some(resp) = nav.top().show_global_popup(&mut app_ctx.borrow_mut(), ui) {
ui.allocate_rect(resp.rect, Sense::hover())
} else {
ui.label("") // TODO(kernelkind): not a great practice
}
});
let nav_response =
Nav::new(routes)
.title(false)
.navigating(false)
.show(ui, |ui, nav| {
if let Some(resp) =
nav.top().show_global_popup(&mut app_ctx.borrow_mut(), ui)
{
ui.allocate_rect(resp.rect, Sense::hover())
} else {
ui.label("") // TODO(kernelkind): not a great practice
}
});
if let Some(NavAction::Returned) = nav_response.action {
app_ctx.borrow_mut().global_nav.pop();