font-manager: count FontPicker stop builds through the runtime's service memory

This commit is contained in:
aiongg
2026-11-24 15:59:46 +00:00
parent 98a30afa0b
commit 7b8bbd254a
+2 -4
View File
@@ -739,7 +739,7 @@ struct StopBuilds(u64);
#[doc(hidden)]
#[cfg(feature = "screen-testing")]
pub fn stop_builds(ctx: &egui::Context) -> u64 {
ctx.data(|data| data.get_temp::<StopBuilds>(egui::Id::unique("font_picker_stop_builds")).unwrap_or_default().0)
craft_ui::runtime::egui::memory::with::<StopBuilds, _>(ctx, |builds| builds.0)
}
impl<'a> FontPicker<'a> {
@@ -819,9 +819,7 @@ impl<'a> FontPicker<'a> {
/// families in the list's narrowed order. A notice takes no step.
fn stops(&self, cx: &Cx<'_, Self>, settings: Option<&FontPickerSettings>, filters: &FontFilters) -> Vec<Stop> {
#[cfg(feature = "screen-testing")]
cx.response.ctx.data_mut(|data| {
data.get_temp_mut_or_default::<StopBuilds>(egui::Id::unique("font_picker_stop_builds")).0 += 1;
});
craft_ui::runtime::egui::memory::with::<StopBuilds, _>(&cx.response.ctx, |builds| builds.0 += 1);
let folder = cx.env.folder();
let host = rank::host_rows(self.host, "", &folder)
.into_iter()