1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-29 04:40:03 -04:00

Rename Context::style to global_style; avoid confusion w/ Ui::style (#7772)

This is important after
* https://github.com/emilk/egui/pull/7770
This commit is contained in:
Emil Ernerfeldt
2025-12-14 16:41:13 +01:00
committed by GitHub
parent 5ea94dd0d7
commit bc48599f65
25 changed files with 94 additions and 58 deletions

View File

@@ -222,10 +222,10 @@ fn syntax_highlighting(
) -> Option<ColoredText> {
let extension_and_rest: Vec<&str> = response.url.rsplitn(2, '.').collect();
let extension = extension_and_rest.first()?;
let theme = egui_extras::syntax_highlighting::CodeTheme::from_style(&ctx.style());
let theme = egui_extras::syntax_highlighting::CodeTheme::from_style(&ctx.global_style());
Some(ColoredText(egui_extras::syntax_highlighting::highlight(
ctx,
&ctx.style(),
&ctx.global_style(),
&theme,
text,
extension,

View File

@@ -94,7 +94,7 @@ impl BackendPanel {
self.egui_windows.checkboxes(ui);
#[cfg(debug_assertions)]
if ui.ctx().style().debug.debug_on_hover_with_all_modifiers {
if ui.global_style().debug.debug_on_hover_with_all_modifiers {
ui.separator();
ui.label("Press down all modifiers and hover a widget to see a callstack for it");
}

View File

@@ -406,7 +406,7 @@ impl WrapApp {
if is_mobile(ui.ctx()) {
ui.menu_button("💻 Backend", |ui| {
ui.set_style(ui.ctx().style()); // ignore the "menu" style set by `menu_button`.
ui.set_style(ui.global_style()); // ignore the "menu" style set by `menu_button`.
self.backend_panel_contents(ui, frame, cmd);
});
} else {
@@ -474,7 +474,7 @@ impl WrapApp {
content_rect.center(),
Align2::CENTER_CENTER,
text,
TextStyle::Heading.resolve(&ctx.style()),
TextStyle::Heading.resolve(&ctx.global_style()),
Color32::WHITE,
);
}