From eb8e1c43031cfbe4145dd3026d0e39346bc35121 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20R=C3=B6ssler?= Date: Fri, 17 Dec 2021 15:48:53 +0100 Subject: [PATCH] documentation --- egui_dynamic_grid/src/layout.rs | 2 ++ egui_dynamic_grid/src/padding.rs | 2 ++ egui_dynamic_grid/src/sizing.rs | 13 +++++++------ 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/egui_dynamic_grid/src/layout.rs b/egui_dynamic_grid/src/layout.rs index 004407b9..cee89556 100644 --- a/egui_dynamic_grid/src/layout.rs +++ b/egui_dynamic_grid/src/layout.rs @@ -2,7 +2,9 @@ use crate::Padding; use egui::{Pos2, Rect, Response, Rgba, Sense, Ui, Vec2}; pub(crate) enum CellSize { + /// Absolute size in points Absolute(f32), + /// Take all available space Remainder, } diff --git a/egui_dynamic_grid/src/padding.rs b/egui_dynamic_grid/src/padding.rs index f4103faf..2cd78525 100644 --- a/egui_dynamic_grid/src/padding.rs +++ b/egui_dynamic_grid/src/padding.rs @@ -1,3 +1,5 @@ +/// Configure padding of grid or table +/// TODO: Use padding settings of egui? #[derive(Clone, Debug)] pub struct Padding { pub(crate) inner: f32, diff --git a/egui_dynamic_grid/src/sizing.rs b/egui_dynamic_grid/src/sizing.rs index e0a1d916..a97e3860 100644 --- a/egui_dynamic_grid/src/sizing.rs +++ b/egui_dynamic_grid/src/sizing.rs @@ -1,18 +1,19 @@ #[derive(Clone, Debug)] pub enum Size { - /// in points + /// Absolute size in points Absolute(f32), - /// 0.0 to 1.0 + /// Relative size relative to all available space. Values must be in range `0.0..=1.0` Relative(f32), + /// [`Size::Relative`] with a minimum size in points RelativeMinimum { - /// 0.0 to 1.0 + /// Relative size relative to all available space. Values must be in range `0.0..=1.0` relative: f32, - /// in points + /// Absolute minimum size in points minimum: f32, }, - /// multiple remainders get each the same space + /// Multiple remainders each get the same space Remainder, - /// multiple remainders get each the same space, at least the minimum + /// [`Size::Remainder`] with a minimum size in points RemainderMinimum(f32), }