feat: reluctantly make Menu::inner public

This commit is contained in:
Rowan 2025-01-27 03:52:23 -06:00
parent 261959edae
commit f7c76e7ed9

View file

@ -96,92 +96,92 @@ impl Menu {
Self { menu }
}
fn into_inner(&mut self) -> &mut bindings::menu {
fn inner(&mut self) -> &mut bindings::menu {
unsafe { &mut *self.menu }
}
pub fn handler(&mut self, handler: ItemHandler) -> &mut Self {
self.into_inner().callback = Some(handler);
self.inner().callback = Some(handler);
self
}
pub fn bottom(&mut self, value: bool) -> &mut Self {
self.into_inner().bottom = value;
self.inner().bottom = value;
self
}
pub fn password(&mut self, value: bool) -> &mut Self {
self.into_inner().passwd = value;
self.inner().passwd = value;
self
}
pub fn font(&mut self, value: &str) -> &mut Self {
self.into_inner().font = to_c_char(value);
self.inner().font = to_c_char(value);
self
}
pub fn lines(&mut self, value: i32) -> &mut Self {
self.into_inner().lines = value;
self.inner().lines = value;
self
}
pub fn output_name(&mut self, value: &str) -> &mut Self {
self.into_inner().output_name = to_c_char(value);
self.inner().output_name = to_c_char(value);
self
}
pub fn prompt(&mut self, value: &str) -> &mut Self {
self.into_inner().prompt = to_c_char(value);
self.inner().prompt = to_c_char(value);
self
}
pub fn normal_bg(&mut self, value: u32) -> &mut Self {
self.into_inner().normalbg = value;
self.inner().normalbg = value;
self
}
pub fn normal_fg(&mut self, value: u32) -> &mut Self {
self.into_inner().normalfg = value;
self.inner().normalfg = value;
self
}
pub fn prompt_fg(&mut self, value: u32) -> &mut Self {
self.into_inner().promptfg = value;
self.inner().promptfg = value;
self
}
pub fn prompt_bg(&mut self, value: u32) -> &mut Self {
self.into_inner().promptbg = value;
self.inner().promptbg = value;
self
}
pub fn selection_bg(&mut self, value: u32) -> &mut Self {
self.into_inner().selectionbg = value;
self.inner().selectionbg = value;
self
}
pub fn selection_fg(&mut self, value: u32) -> &mut Self {
self.into_inner().selectionbg = value;
self.inner().selectionbg = value;
self
}
pub fn width(&mut self, value: i32) -> &mut Self {
self.into_inner().width = value;
self.inner().width = value;
self
}
pub fn height(&mut self, value: i32) -> &mut Self {
self.into_inner().height = value;
self.inner().height = value;
self
}
pub fn line_height(&mut self, value: i32) -> &mut Self {
self.into_inner().line_height = value;
self.inner().line_height = value;
self
}
pub fn padding(&mut self, value: i32) -> &mut Self {
self.into_inner().padding = value;
self.inner().padding = value;
self
}