Skip to main content

GpuiTheme

Struct GpuiTheme 

Source
pub struct GpuiTheme {
Show 25 fields pub font_family: String, pub font_size_pt: u32, pub ligatures: bool, pub background: u32, pub foreground: u32, pub status_background: u32, pub status_foreground: u32, pub cursor_background: u32, pub cursor_foreground: u32, pub popup_background: u32, pub popup_border: u32, pub picker_root: u32, pub picker_title: u32, pub picker_prompt: u32, pub picker_count: u32, pub popup_title: u32, pub popup_hint: u32, pub notification_warn: u32, pub notification_error: u32, pub notification_info: u32, pub notification_success: u32, pub picker_match_highlight: u32, pub picker_marginalia_fg: u32, pub indent_guide: u32, pub indent_guide_active: u32,
}
Expand description

GPUI peer’s typed theme cache.

Phase 5.7.B.12: real fields land for the surfaces the binary currently paints (background, foreground, status line, cursor inversion). Stored as Rgba so the render hot path is a direct .bg(self.theme.background) etc. – no per-frame conversion.

The defaults match the Catppuccin Mocha-ish palette the binary’s render used inline pre-5.7.B.12. Future host-side slices will grow host_theme to carry window bg / fg / status / cursor fields; once that lands, GpuiApp::rebuild_gpui_theme reads from there and RendererSignal::ThemeChanged will visibly recolor the window on every :set ui.*. For now the rebuild is a shape-only no-op – the wiring is what this slice unblocks.

Why Rgba and not Hsla: gpui’s rgb(0x...) -> Rgba builder is the natural literal form; .bg(Rgba) / .text_color(Rgba) accept it directly via Into<Background> / Into<Hsla> blanket impls. Sticking with Rgba keeps the theme literal-friendly + the binary’s render free of conversion boilerplate. Color storage discipline: the lib stores u32 packed 0xRRGGBB hex so it builds without the window feature (no transitive gpui link). The binary converts to gpui::Rgba at render time via gpui::rgb(theme.background).

Fields§

§font_family: String

Font family name for the editor window. Must be a monospace typeface. Configurable via ui.font_family; defaults to “Menlo” (built-in macOS monospace). Updated by rebuild_gpui_theme on every RendererSignal::ThemeChanged.

§font_size_pt: u32

Font size in points. Configurable via ui.font_size.

§ligatures: bool

Whether OpenType ligatures are enabled. Configurable via ui.ligatures (default true). When false, FontFeatures::disable_ligatures() is applied to every Font before shaping, suppressing calt (drives programming ligatures).

§background: u32

Main document background.

§foreground: u32

Main document foreground (text + non-cursor chars).

§status_background: u32

Status-line background.

§status_foreground: u32

Status-line foreground.

§cursor_background: u32

Cursor block background (Block shape) + bar / underline border color (Bar / Underline shapes).

§cursor_foreground: u32

Cursor block foreground – the character color when the block inverts (Normal/Visual mode cursor cell). Unused by Bar / Underline since the underlying char text stays the document foreground.

§popup_background: u32

Popup-overlay background (DisplayBuffer help surface). Slightly darker than the main bg for visual separation.

§popup_border: u32

Popup-overlay border / accent color.

§picker_root: u32

PP.2b: the root a rooted picker is scoped to, in its prompt. Its own slot rather than popup_border (which it shared with the (n/m) count) so the one piece of context the prompt carries is not the dimmest thing on the line.

§picker_title: u32

PP.2c: the picker prompt’s source name, > marker and match count. Own slots rather than the borrowed cursor_background / popup_border they used — borrowing is what left the count and the root indistinguishable, and is the same failure the transient.* set was introduced to end.

§picker_prompt: u32§picker_count: u32§popup_title: u32

Popup header TITLE colour (bold accent) — ui.popup.title.

§popup_hint: u32

Popup header HINT colour (dim) — ui.popup.hint.

§notification_warn: u32

Notification-severity colours, sourced from the diagnostic.{warning,error} theme elements.

The notification overlay referenced diff_change_line_bg / diff_remove_line_bg here — fields that never existed on this struct, so the window-feature build did not compile. Diff line backgrounds were the wrong source anyway: these tint notification text by severity, which is what diagnostic.warning / diagnostic.error already mean, and they recolour with :colorscheme like every other element.

§notification_error: u32§notification_info: u32

Info and success rows ↔ diagnostic.info / diff.add.sign, the elements the TUI peer reads for the same levels.

§notification_success: u32§picker_match_highlight: u32

Issue #35 (2026-05-22): picker match-range highlight color. Painted on the substring of each candidate that matched the query. Catppuccin Mocha peach by default — distinct from foreground so matches actually pop (previously used cursor_background which equals foreground in the default palette and made matches invisible).

§picker_marginalia_fg: u32

Picker marginalia (annotation / kind glyph) color. Mid-grey by default so it doesn’t compete with the candidate text.

§indent_guide: u32

IG.4: indentation-guide rule colour, from the indent.guide theme element. Dim by default — a guide bright enough to read directly is one that competes with the code it measures.

§indent_guide_active: u32

IG.4: the guide for the block enclosing the cursor, from indent.guide.active. Same hue undimmed; the contrast between the two is what carries the signal.

Trait Implementations§

Source§

impl Clone for GpuiTheme

Source§

fn clone(&self) -> GpuiTheme

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for GpuiTheme

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for GpuiTheme

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> IntoMaybeUndefined<T> for T

§

fn into_maybe_undefined(self) -> MaybeUndefined<T>

Converts this value into a three-state builder argument.
§

impl<T> IntoOption<T> for T

§

fn into_option(self) -> Option<T>

Converts this value into an optional builder argument.
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( pointer: <T as Pointee>::Pointer, f: &mut Formatter<'_>, ) -> Result<(), Error>

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more