Break context menu items out in theme

Nathan Sobo created

Change summary

crates/project_panel/src/project_panel.rs | 6 +++---
crates/theme/src/theme.rs                 | 8 +++++++-
2 files changed, 10 insertions(+), 4 deletions(-)

Detailed changes

crates/project_panel/src/project_panel.rs 🔗

@@ -890,11 +890,11 @@ impl ProjectPanel {
 
             Overlay::new(
                 Flex::column()
-                    .with_child(Label::new("Add File".to_string(), style.label.clone()).boxed())
+                    .with_child(
+                        Label::new("Add File".to_string(), style.item.label.clone()).boxed(),
+                    )
                     .contained()
                     .with_style(style.container)
-                    // .constrained()
-                    // .with_width(style.width)
                     .boxed(),
             )
             .with_abs_position(menu.position)

crates/theme/src/theme.rs 🔗

@@ -242,7 +242,13 @@ pub struct ProjectPanelEntry {
 
 #[derive(Clone, Debug, Deserialize, Default)]
 pub struct ContextMenu {
-    pub width: f32,
+    #[serde(flatten)]
+    pub container: ContainerStyle,
+    pub item: ContextMenuItem,
+}
+
+#[derive(Clone, Debug, Deserialize, Default)]
+pub struct ContextMenuItem {
     #[serde(flatten)]
     pub container: ContainerStyle,
     pub label: TextStyle,