pub mod toolbar {
pub const TOP_HEIGHT: f32 = 38.0;
pub const LEFT_WIDTH: f32 = 52.0;
pub const RIGHT_WIDTH: f32 = 52.0;
pub const BOTTOM_HEIGHT: f32 = 38.0;
pub const RIGHT_PANEL_WIDTH: f32 = 300.0;
pub const RIGHT_PANEL_MIN_WIDTH: f32 = 180.0;
pub const RIGHT_PANEL_MAX_WIDTH: f32 = 350.0;
pub const BUTTON_SIZE: f32 = 32.0;
pub const ICON_SIZE: f32 = 18.0;
}
pub mod auth_dialog {
pub const WIDTH: f32 = 360.0;
pub const BUTTON_HEIGHT: f32 = 36.0;
pub const INPUT_HEIGHT: f32 = 32.0;
pub const PADDING: f32 = 24.0;
}
pub mod footprint {
pub const MIN_CELL_HEIGHT: f32 = 14.0;
pub const VOLUME_FONT_SIZE: f32 = 10.0;
pub const DELTA_FONT_SIZE: f32 = 11.0;
pub const POC_LINE_WIDTH: f32 = 2.0;
pub const IMBALANCE_INDICATOR_WIDTH: f32 = 3.0;
pub const MIN_BAR_WIDTH: f32 = 40.0;
pub const CELL_PADDING: f32 = 2.0;
}
pub mod chart {
pub const PADDING: f32 = 40.0;
pub const TOP_PADDING_WITH_OHLC: f32 = 40.0;
pub const TOP_PADDING_NO_OHLC: f32 = 20.0;
pub const BOTTOM_PADDING_WITH_TIME: f32 = 30.0;
pub const BOTTOM_PADDING_NO_TIME: f32 = 20.0;
pub const RIGHT_AXIS_WIDTH: f32 = 70.0;
pub const MIN_CHART_WIDTH: f32 = 100.0;
pub const MIN_CHART_HEIGHT: f32 = 150.0;
}
pub mod indicator {
pub const OSCILLATOR_HEIGHT: f32 = 100.0;
pub const MULTI_LINE_HEIGHT: f32 = 120.0;
}
pub mod candle {
use crate::tokens::DESIGN_TOKENS;
use egui::Color32;
#[inline]
pub fn bar_width_from_spacing(bar_spacing: f32) -> f32 {
bar_spacing * DESIGN_TOKENS.sizing.candle.body_width_ratio
}
#[inline]
pub fn wick_width_for_dpi(pixels_per_point: f32) -> f32 {
if pixels_per_point > 1.5 {
DESIGN_TOKENS.sizing.candle.wick_width_hidpi
} else {
DESIGN_TOKENS.sizing.candle.wick_width
}
}
#[inline]
pub fn ensure_min_body_height(body_top: f32, body_bottom: f32) -> f32 {
body_bottom.max(body_top + DESIGN_TOKENS.sizing.candle.min_body_height)
}
#[inline]
pub fn with_volume_alpha(color: Color32) -> Color32 {
Color32::from_rgba_unmultiplied(
color.r(),
color.g(),
color.b(),
DESIGN_TOKENS.sizing.candle.volume_alpha,
)
}
}