inspector: Fix Inspector on release build. (#906)

This commit is contained in:
Jason Lee 2025-05-27 18:51:57 +08:00 committed by GitHub
parent 372c78fac6
commit bad9506ebb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 3 deletions

View file

@ -13,7 +13,7 @@ use gpui_component::{
popup_menu::PopupMenuExt as _, popup_menu::PopupMenuExt as _,
scroll::ScrollbarShow, scroll::ScrollbarShow,
set_locale, ActiveTheme as _, ContextModal as _, IconName, Sizable as _, Theme, ThemeMode, set_locale, ActiveTheme as _, ContextModal as _, IconName, Sizable as _, Theme, ThemeMode,
TitleBar, ToggleInspector, TitleBar,
}; };
use crate::{SelectFont, SelectLocale, SelectRadius, SelectScrollbarShow}; use crate::{SelectFont, SelectLocale, SelectRadius, SelectScrollbarShow};
@ -312,8 +312,6 @@ impl Render for FontSizeSelector {
scroll_show == ScrollbarShow::Always, scroll_show == ScrollbarShow::Always,
Box::new(SelectScrollbarShow(ScrollbarShow::Always)), Box::new(SelectScrollbarShow(ScrollbarShow::Always)),
) )
.separator()
.menu("Inspector", Box::new(ToggleInspector))
}) })
.anchor(Corner::TopRight), .anchor(Corner::TopRight),
) )

View file

@ -13,6 +13,7 @@ doctest = false
[features] [features]
webview = ["dep:wry"] webview = ["dep:wry"]
inspector = []
[dependencies] [dependencies]
anyhow = "1" anyhow = "1"

View file

@ -2,6 +2,7 @@ mod colors;
mod event; mod event;
mod focusable; mod focusable;
mod icon; mod icon;
#[cfg(any(feature = "inspector", debug_assertions))]
mod inspector; mod inspector;
mod kbd; mod kbd;
mod menu; mod menu;
@ -65,6 +66,7 @@ pub use wry;
pub use crate::Disableable; pub use crate::Disableable;
pub use event::InteractiveElementExt; pub use event::InteractiveElementExt;
pub use focusable::FocusableCycle; pub use focusable::FocusableCycle;
#[cfg(any(feature = "inspector", debug_assertions))]
pub use inspector::*; pub use inspector::*;
pub use menu::{context_menu, popup_menu}; pub use menu::{context_menu, popup_menu};
pub use root::{ContextModal, Root}; pub use root::{ContextModal, Root};
@ -90,6 +92,7 @@ rust_i18n::i18n!("locales", fallback = "en");
/// You can initialize the UI module at your application's entry point. /// You can initialize the UI module at your application's entry point.
pub fn init(cx: &mut App) { pub fn init(cx: &mut App) {
theme::init(cx); theme::init(cx);
#[cfg(any(feature = "inspector", debug_assertions))]
inspector::init(cx); inspector::init(cx);
date_picker::init(cx); date_picker::init(cx);
dock::init(cx); dock::init(cx);