pub const TOOLBAR_HEIGHT: f32 = 38.0;
pub const BUTTON_SIZE: f32 = 32.0;
pub const ICON_SIZE: f32 = 18.0;
pub const PADDING: f32 = 4.0;
pub const ROUNDING: f32 = 4.0;
#[derive(Clone, Debug)]
pub struct TopToolbarConfig {
pub height: f32,
pub small_icon_size: f32,
pub btn_size: f32,
pub padding: f32,
pub rounding: f32,
pub base_height: f32,
pub base_icon_size: f32,
pub base_btn_size: f32,
pub base_padding: f32,
}
impl Default for TopToolbarConfig {
fn default() -> Self {
Self {
height: TOOLBAR_HEIGHT,
small_icon_size: ICON_SIZE,
btn_size: BUTTON_SIZE,
padding: PADDING,
rounding: ROUNDING,
base_height: TOOLBAR_HEIGHT,
base_icon_size: ICON_SIZE,
base_btn_size: BUTTON_SIZE,
base_padding: PADDING,
}
}
}
impl TopToolbarConfig {
pub fn new() -> Self {
Self::default()
}
pub fn with_height(mut self, height: f32) -> Self {
self.height = height;
self.base_height = height;
self
}
pub fn with_icon_size(mut self, size: f32) -> Self {
self.small_icon_size = size;
self.base_icon_size = size;
self
}
pub fn with_button_size(mut self, size: f32) -> Self {
self.btn_size = size;
self.base_btn_size = size;
self
}
}