MCPcopy Index your code
hub / github.com/encounter/objdiff / post_update

Method post_update

objdiff-gui/src/views/appearance.rs:140–170  ·  view source on GitHub ↗
(&mut self, ctx: &egui::Context)

Source from the content-addressed store, hash-verified

138 }
139
140 pub fn post_update(&mut self, ctx: &egui::Context) {
141 // Load fonts for next frame
142 if let Some(next_ui_font) = self.next_ui_font.take() {
143 match load_font_if_needed(
144 ctx,
145 &self.fonts.source,
146 &next_ui_font,
147 DEFAULT_UI_FONT.family,
148 &mut self.fonts.definitions,
149 ) {
150 Ok(()) => self.ui_font = next_ui_font,
151 Err(e) => {
152 log::error!("Failed to load font: {e}")
153 }
154 }
155 }
156 if let Some(next_code_font) = self.next_code_font.take() {
157 match load_font_if_needed(
158 ctx,
159 &self.fonts.source,
160 &next_code_font,
161 DEFAULT_CODE_FONT.family,
162 &mut self.fonts.definitions,
163 ) {
164 Ok(()) => self.code_font = next_code_font,
165 Err(e) => {
166 log::error!("Failed to load font: {e}")
167 }
168 }
169 }
170 }
171
172 pub fn init_fonts(&mut self, ctx: &egui::Context) {
173 self.fonts.family_names = self.fonts.source.all_families().unwrap_or_default();

Callers

nothing calls this directly

Calls 1

load_font_if_neededFunction · 0.85

Tested by

no test coverage detected