1
0
Fork 0
forked from wry/wry

egui: add integration

This commit is contained in:
Julian Orth 2026-02-22 00:26:52 +01:00
parent 85b9b7222d
commit 008e8a671a
49 changed files with 4110 additions and 149 deletions

View file

@ -1035,6 +1035,13 @@ impl ConfigClient {
position
}
pub fn set_egui_fonts(&self, proportional: Option<Vec<&str>>, monospace: Option<Vec<&str>>) {
self.send(&ClientMessage::SetEguiFonts {
proportional,
monospace,
});
}
pub fn set_middle_click_paste_enabled(&self, enabled: bool) {
self.send(&ClientMessage::SetMiddleClickPasteEnabled { enabled });
}

View file

@ -841,6 +841,10 @@ pub enum ClientMessage<'a> {
fds: Vec<(i32, i32)>,
tag: Option<&'a str>,
},
SetEguiFonts {
proportional: Option<Vec<&'a str>>,
monospace: Option<Vec<&'a str>>,
},
}
#[derive(Serialize, Deserialize, Debug)]

View file

@ -197,6 +197,20 @@ pub fn get_bar_position() -> BarPosition {
get!(BarPosition::Top).get_bar_position()
}
/// Sets the proportional fonts used by egui windows.
///
/// The default is `["sans-serif", "Noto Sans", "Noto Color Emoji"]`.
pub fn set_egui_proportional_fonts<'a>(fonts: impl IntoIterator<Item = &'a str>) {
get!().set_egui_fonts(Some(fonts.into_iter().collect()), None);
}
/// Sets the monospace fonts used by egui windows.
///
/// The default is `["monospace", "Noto Sans Mono", "Noto Color Emoji"]`.
pub fn set_egui_monospace_fonts<'a>(fonts: impl IntoIterator<Item = &'a str>) {
get!().set_egui_fonts(None, Some(fonts.into_iter().collect()));
}
/// Elements of the compositor whose color can be changed.
pub mod colors {
use {