azul_layout/solver3/
scrollbar.rs1use azul_core::geom::LogicalSize;
2
3#[derive(Debug, Clone, Default)]
5#[repr(C)]
6pub struct ScrollbarRequirements {
7 pub needs_horizontal: bool,
8 pub needs_vertical: bool,
9 pub scrollbar_width: f32,
10 pub scrollbar_height: f32,
11}
12
13impl ScrollbarRequirements {
14 pub fn needs_reflow(&self) -> bool {
17 self.scrollbar_width > 0.0 || self.scrollbar_height > 0.0
18 }
19
20 pub fn shrink_size(&self, size: LogicalSize) -> LogicalSize {
23 LogicalSize {
24 width: (size.width - self.scrollbar_width).max(0.0),
25 height: (size.height - self.scrollbar_height).max(0.0),
26 }
27 }
28}