diff --git a/crates/op-editor-ui/src/widgets/agent_settings_fonts.rs b/crates/op-editor-ui/src/widgets/agent_settings_fonts.rs index 7d5663c55..5e68fd6fe 100644 --- a/crates/op-editor-ui/src/widgets/agent_settings_fonts.rs +++ b/crates/op-editor-ui/src/widgets/agent_settings_fonts.rs @@ -164,7 +164,14 @@ pub(super) fn paint_fonts_tab( theme.foreground, ); let remove = imported_remove_rect(content, ui, row); - cx.backend.fill_round_rect(remove, 6.0, theme.muted); + let remove_hovered = ui.missing_fonts_hover + == Some(op_editor_core::missing_fonts::MissingFontsHover::RemoveImported(row)); + let remove_bg = if remove_hovered { + theme.accent + } else { + theme.muted + }; + cx.backend.fill_round_rect(remove, 6.0, remove_bg); paint_text( cx, translate(ui, "common.delete"), diff --git a/crates/op-host-native/src/widget_host/geometry_settings_hover.rs b/crates/op-host-native/src/widget_host/geometry_settings_hover.rs index 1841f84ff..79886df58 100644 --- a/crates/op-host-native/src/widget_host/geometry_settings_hover.rs +++ b/crates/op-host-native/src/widget_host/geometry_settings_hover.rs @@ -371,6 +371,29 @@ impl WidgetHostNative { .hover_image_gen_provider_option = new_image_provider_option_hover; changed = true; } + let new_missing_hover = if matches!( + self.editor_state.editor_ui.agent_settings.tab, + op_editor_core::AgentSettingsTab::Fonts + ) { + use op_editor_ui::widgets::agent_settings_panel::AgentSettingsHit; + let panel = AgentSettingsPanel::for_editor(&self.editor_state); + let panel_rect = panel.rect(self.last_viewport_w, self.last_viewport_h); + match panel.hit_test(panel_rect, point) { + AgentSettingsHit::MissingFontChooseFile(row) => { + Some(op_editor_core::missing_fonts::MissingFontsHover::ChooseFile(row)) + } + AgentSettingsHit::RemoveImportedFont(row) => { + Some(op_editor_core::missing_fonts::MissingFontsHover::RemoveImported(row)) + } + _ => None, + } + } else { + None + }; + if new_missing_hover != self.editor_state.editor_ui.missing_fonts_hover { + self.editor_state.editor_ui.missing_fonts_hover = new_missing_hover; + changed = true; + } if changed { self.mark_dirty(); } diff --git a/crates/op-host-web/src/widget_host/cursor_input.rs b/crates/op-host-web/src/widget_host/cursor_input.rs index 1004b1bb5..3f68fe856 100644 --- a/crates/op-host-web/src/widget_host/cursor_input.rs +++ b/crates/op-host-web/src/widget_host/cursor_input.rs @@ -332,6 +332,28 @@ impl WidgetHost { .hover_image_gen_provider_option = image_provider_option_hover; changed = true; } + let new_missing_hover = if matches!( + self.editor_state.editor_ui.agent_settings.tab, + AgentSettingsTab::Fonts + ) { + let panel = AgentSettingsPanel::for_editor(&self.editor_state); + let panel_rect = panel.rect(self.last_viewport_w, self.last_viewport_h); + match panel.hit_test(panel_rect, point) { + AgentSettingsHit::MissingFontChooseFile(row) => { + Some(op_editor_core::missing_fonts::MissingFontsHover::ChooseFile(row)) + } + AgentSettingsHit::RemoveImportedFont(row) => { + Some(op_editor_core::missing_fonts::MissingFontsHover::RemoveImported(row)) + } + _ => None, + } + } else { + None + }; + if new_missing_hover != self.editor_state.editor_ui.missing_fonts_hover { + self.editor_state.editor_ui.missing_fonts_hover = new_missing_hover; + changed = true; + } if changed { self.mark_dirty(); }