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