[nautilus/wip/antoniof/templates-submenu-fix: 1/2] files-view: Reset templates model to NULL if unwanted
- From: António Fernandes <antoniof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/antoniof/templates-submenu-fix: 1/2] files-view: Reset templates model to NULL if unwanted
- Date: Wed, 31 Aug 2022 00:42:37 +0000 (UTC)
commit 40711802e9b39f4c7e00e32a086d01def5ff1d09
Author: António Fernandes <antoniof gnome org>
Date: Tue Aug 23 20:14:59 2022 +0100
files-view: Reset templates model to NULL if unwanted
Otherwise the pathbar still displays the submenu in locations where
creation of new files is not supported.
src/nautilus-files-view.c | 10 ++++++++++
1 file changed, 10 insertions(+)
---
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index fb2b22675..eff1fe368 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -8250,6 +8250,16 @@ update_background_menu (NautilusFilesView *view,
remove_submenu = FALSE;
}
}
+ else
+ {
+ /* This is necessary because the pathbar menu relies on it being NULL
+ * to hide the submenu. */
+ nautilus_view_set_templates_menu (NAUTILUS_VIEW (view), NULL);
+
+ /* And this is necessary to regenerate the templates menu when we go
+ * back to a normal folder. */
+ priv->templates_menu_updated = FALSE;
+ }
i = nautilus_g_menu_model_find_by_string (G_MENU_MODEL (priv->background_menu_model),
"nautilus-menu-item",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]