add an entry to the settings UI

Josh Robson Chase created

Change summary

crates/settings_ui/src/page_data.rs | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)

Detailed changes

crates/settings_ui/src/page_data.rs 🔗

@@ -4121,7 +4121,7 @@ fn window_and_layout_page() -> SettingsPage {
         ]
     }
 
-    fn layout_section() -> [SettingsPageItem; 4] {
+    fn layout_section() -> [SettingsPageItem; 5] {
         [
             SettingsPageItem::SectionHeader("Layout"),
             SettingsPageItem::SettingItem(SettingItem {
@@ -4185,6 +4185,21 @@ fn window_and_layout_page() -> SettingsPage {
                 }),
                 metadata: None,
             }),
+            SettingsPageItem::SettingItem(SettingItem {
+                title: "Focus Follows Mouse",
+                description: "Whether to change focus to a pane when the mouse hovers over it.",
+                field: Box::new(SettingField {
+                    json_path: Some("focus_follows_mouse"),
+                    pick: |settings_content| {
+                        settings_content.workspace.focus_follows_mouse.as_ref()
+                    },
+                    write: |settings_content, value| {
+                        settings_content.workspace.focus_follows_mouse = value;
+                    },
+                }),
+                metadata: None,
+                files: USER,
+            }),
         ]
     }