Skip to content

Commit 894f729

Browse files
authored
Follow system theme in debug builds (#9975)
1 parent f5f80f9 commit 894f729

File tree

3 files changed

+17
-9
lines changed

3 files changed

+17
-9
lines changed

crates/utils/re_log/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ const CRATES_AT_INFO_LEVEL: &[&str] = &[
7676
"h2",
7777
"hyper",
7878
"prost_build",
79+
"sqlparser",
7980
"tower",
8081
"ureq",
8182
// only let rustls log in debug mode: https://github.com/rerun-io/rerun/issues/3104

crates/viewer/re_ui/src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,11 @@ pub fn apply_style_and_install_loaders(egui_ctx: &egui::Context) {
124124
);
125125

126126
egui_ctx.options_mut(|o| {
127-
o.theme_preference = egui::ThemePreference::Dark; // TODO(#3058): switch this to system
127+
if cfg!(debug_assertions) {
128+
// Keep whatever the developer has previously set
129+
} else {
130+
o.theme_preference = egui::ThemePreference::Dark; // TODO(#3058): switch this to system (by removing it)
131+
}
128132
o.fallback_theme = egui::Theme::Dark;
129133
});
130134

crates/viewer/re_viewer/src/ui/settings_screen.rs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,17 @@ fn settings_screen_ui_impl(ui: &mut egui::Ui, app_options: &mut AppOptions, keep
6464

6565
ui.strong("General");
6666

67-
ui.horizontal(|ui| {
68-
ui.label("Theme:");
69-
egui::global_theme_preference_buttons(ui);
70-
let theme_preference = ui.ctx().options(|opt| opt.theme_preference);
71-
if theme_preference != egui::ThemePreference::Dark {
72-
ui.warning_label("Light mode support is experimental!");
73-
}
74-
});
67+
if cfg!(debug_assertions) {
68+
// TODO(#3058): finish light node
69+
ui.horizontal(|ui| {
70+
ui.label("Theme:");
71+
egui::global_theme_preference_buttons(ui);
72+
let theme_preference = ui.ctx().options(|opt| opt.theme_preference);
73+
if theme_preference != egui::ThemePreference::Dark {
74+
ui.warning_label("Light mode support is experimental!");
75+
}
76+
});
77+
}
7578

7679
ui.re_checkbox(
7780
&mut app_options.include_welcome_screen_button_in_recordings_panel,

0 commit comments

Comments
 (0)