git.lucas.co / cce-data-editor
structured data editor
git clone https://git.lucas.co/cce-data-editor.git

commitb880be774e2889befa105fa0ca4a8d55985c89af
parent5c043c9a9c
authorLucas Galante <[email protected]>
date2026-07-03 01:57
Added separators inside the File dropdown menu

 src/main.rs | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/main.rs b/src/main.rs
index 70d76f3..e5d0312 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -328,9 +328,13 @@ impl DataEditorApp {
             "Save".to_string(),
             "Save As".to_string(),
             "Refresh".to_string(),
+            "-".to_string(),
             "Open...".to_string(),
         ];
-        options.extend(recent);
+        if !recent.is_empty() {
+            options.push("-".to_string());
+            options.extend(recent);
+        }
         self.btn_open.options = options;
         self.btn_open.selected = 0;
         self.needs_rebuild = true;
@@ -715,9 +719,13 @@ impl Application for DataEditorApp {
             "Save".to_string(),
             "Save As".to_string(),
             "Refresh".to_string(),
+            "-".to_string(),
             "Open...".to_string(),
         ];
-        dropdown_options.extend(recent);
+        if !recent.is_empty() {
+            dropdown_options.push("-".to_string());
+            dropdown_options.extend(recent);
+        }
         let mut btn_open = Dropdown::new(dropdown_options, 0).with_custom_display_text("File");
         btn_open.set_rect(10.0, 8.0, 70.0, 26.0);