fixup: improved documentation and refactored naming to be more self-explanatory

Note:
This is the actual correct commit. The previous one contained files touched by cargo fmt which are unrelated. Sorry for that.
This commit is contained in:
Pascal committed 2023-12-07 17:23:14 +01:00
1 parent 906c466e78
commit cbfb80d5c6
2 files changed
+15 -9

No files matched your search

+7 -5
View File
@@ -36,7 +36,7 @@ pub struct Config {
pub(crate) root_name: String,
pub(crate) background_color: Option<(u8, u8, u8, u8)>,
pub(crate) last_window_close_behaviour: WindowCloseBehaviour,
pub(crate) disable_default_menu_bar: bool,
pub(crate) enable_default_menu_bar: bool,
}
type DropHandler = Box<dyn Fn(&Window, FileDropEvent) -> bool>;
@@ -66,13 +66,15 @@ impl Config {
root_name: "main".to_string(),
background_color: None,
last_window_close_behaviour: WindowCloseBehaviour::LastWindowExitsApp,
disable_default_menu_bar: false,
enable_default_menu_bar: true,
}
}
/// Set whether the default menu bar should be disabled.
pub fn with_disable_default_menu_bar(mut self, disable: bool) -> Self {
self.disable_default_menu_bar = disable;
/// Set whether the default menu bar should be enabled.
///
/// > Note: `enable` is `true` by default. To disable the default menu bar pass `false`.
pub fn with_default_menu_bar(mut self, enable: bool) -> Self {
self.enable_default_menu_bar = enable;
self
}