mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-25 23:49:35 +00:00
font-manager: count FontPicker stop builds through the runtime's service memory
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user