egui: add integration
This commit is contained in:
parent
85b9b7222d
commit
008e8a671a
49 changed files with 4110 additions and 149 deletions
|
|
@ -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 });
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)]
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue