From 02558e0695e351013767afa1dc821e9feb38c4a7 Mon Sep 17 00:00:00 2001 From: griffi-gh Date: Thu, 21 Mar 2024 23:22:40 +0100 Subject: [PATCH] Rename `rectangle` module to `rect` --- hui-examples/examples/align_test.rs | 2 +- hui-examples/examples/rounded_rect.rs | 2 +- hui-examples/examples/ui_test_2_loading.rs | 2 +- hui-examples/examples/ui_test_3_transform.rs | 2 +- hui/src/background.rs | 2 +- hui/src/draw.rs | 2 +- hui/src/draw/atlas.rs | 2 +- hui/src/draw/corner_radius.rs | 2 +- hui/src/element/builtin/container.rs | 2 +- hui/src/element/builtin/fill_rect.rs | 2 +- hui/src/element/builtin/image.rs | 2 +- hui/src/element/builtin/progress_bar.rs | 2 +- hui/src/element/builtin/slider.rs | 2 +- hui/src/input.rs | 2 +- hui/src/lib.rs | 2 +- hui/src/measure.rs | 2 +- hui/src/{rectangle.rs => rect.rs} | 0 hui/src/{rectangle => rect}/color.rs | 0 hui/src/{rectangle => rect}/corners.rs | 0 hui/src/{rectangle => rect}/rect.rs | 0 hui/src/{rectangle => rect}/sides.rs | 0 21 files changed, 16 insertions(+), 16 deletions(-) rename hui/src/{rectangle.rs => rect.rs} (100%) rename hui/src/{rectangle => rect}/color.rs (100%) rename hui/src/{rectangle => rect}/corners.rs (100%) rename hui/src/{rectangle => rect}/rect.rs (100%) rename hui/src/{rectangle => rect}/sides.rs (100%) diff --git a/hui-examples/examples/align_test.rs b/hui-examples/examples/align_test.rs index ad340de..a11eb6e 100644 --- a/hui-examples/examples/align_test.rs +++ b/hui-examples/examples/align_test.rs @@ -10,7 +10,7 @@ use winit::{ use hui::{ element::{ container::Container, progress_bar::ProgressBar, fill_rect::FillRect, ElementList, UiElement - }, layout::{Alignment, Direction, Size}, rectangle::{Corners, Sides}, UiInstance + }, layout::{Alignment, Direction, Size}, rect::{Corners, Sides}, UiInstance }; use hui_glium::GliumUiRenderer; diff --git a/hui-examples/examples/rounded_rect.rs b/hui-examples/examples/rounded_rect.rs index ea85691..abe66b8 100644 --- a/hui-examples/examples/rounded_rect.rs +++ b/hui-examples/examples/rounded_rect.rs @@ -12,7 +12,7 @@ use hui::{ text::Text, ElementList }, layout::{Alignment, Direction, Size}, - rectangle::{Corners, Sides}, + rect::{Corners, Sides}, UiInstance }; use hui_glium::GliumUiRenderer; diff --git a/hui-examples/examples/ui_test_2_loading.rs b/hui-examples/examples/ui_test_2_loading.rs index 2cde027..8ca5ff6 100644 --- a/hui-examples/examples/ui_test_2_loading.rs +++ b/hui-examples/examples/ui_test_2_loading.rs @@ -3,7 +3,7 @@ use hui::{ color, size, element::{container::Container, progress_bar::ProgressBar, text::Text, UiElementExt}, layout::Alignment, - rectangle::Corners, + rect::Corners, text::FontHandle, }; diff --git a/hui-examples/examples/ui_test_3_transform.rs b/hui-examples/examples/ui_test_3_transform.rs index e57b3b9..3c756fa 100644 --- a/hui-examples/examples/ui_test_3_transform.rs +++ b/hui-examples/examples/ui_test_3_transform.rs @@ -9,7 +9,7 @@ use hui::{ UiElementExt }, layout::Alignment, - rectangle::Corners, + rect::Corners, text::FontHandle, size, }; diff --git a/hui/src/background.rs b/hui/src/background.rs index 47243cb..ab1f5f9 100644 --- a/hui/src/background.rs +++ b/hui/src/background.rs @@ -2,7 +2,7 @@ #![allow(deprecated)] use glam::{vec4, Vec3, Vec4}; -use crate::rectangle::Corners; +use crate::rect::Corners; //TODO: use this // pub struct Background { diff --git a/hui/src/draw.rs b/hui/src/draw.rs index cf0b9f8..ba2d8b0 100644 --- a/hui/src/draw.rs +++ b/hui/src/draw.rs @@ -3,7 +3,7 @@ //TODO: 9-slice draw command use crate::{ - rectangle::Corners, + rect::Corners, text::{FontHandle, TextRenderer} }; diff --git a/hui/src/draw/atlas.rs b/hui/src/draw/atlas.rs index 3d49e67..06eb9df 100644 --- a/hui/src/draw/atlas.rs +++ b/hui/src/draw/atlas.rs @@ -2,7 +2,7 @@ use glam::{uvec2, vec2, UVec2, Vec2}; use hashbrown::HashMap; use nohash_hasher::BuildNoHashHasher; use rect_packer::DensePacker; -use crate::rectangle::Corners; +use crate::rect::Corners; const RGBA_CHANNEL_COUNT: u32 = 4; //TODO make this work diff --git a/hui/src/draw/corner_radius.rs b/hui/src/draw/corner_radius.rs index 8b2c1b0..c28c314 100644 --- a/hui/src/draw/corner_radius.rs +++ b/hui/src/draw/corner_radius.rs @@ -1,5 +1,5 @@ use std::num::NonZeroU16; -use crate::rectangle::Corners; +use crate::rect::Corners; //TODO uneven corners (separate width/height for each corner) diff --git a/hui/src/element/builtin/container.rs b/hui/src/element/builtin/container.rs index f97ca87..7e584c8 100644 --- a/hui/src/element/builtin/container.rs +++ b/hui/src/element/builtin/container.rs @@ -8,7 +8,7 @@ use crate::{ element::{ElementList, MeasureContext, ProcessContext, UiElement}, layout::{Alignment, Alignment2d, Direction, LayoutInfo, Size, Size2d}, measure::{Hints, Response}, - rectangle::{Corners, Sides}, + rect::{Corners, Sides}, }; // pub struct Border { diff --git a/hui/src/element/builtin/fill_rect.rs b/hui/src/element/builtin/fill_rect.rs index 551622a..5b330c1 100644 --- a/hui/src/element/builtin/fill_rect.rs +++ b/hui/src/element/builtin/fill_rect.rs @@ -8,7 +8,7 @@ use crate::{ element::{UiElement, MeasureContext, ProcessContext}, layout::{Size, Size2d}, measure::Response, - rectangle::Corners, + rect::Corners, size, }; diff --git a/hui/src/element/builtin/image.rs b/hui/src/element/builtin/image.rs index 47f5945..831384e 100644 --- a/hui/src/element/builtin/image.rs +++ b/hui/src/element/builtin/image.rs @@ -6,7 +6,7 @@ use crate::{ element::{MeasureContext, ProcessContext, UiElement}, layout::{compute_size, Size, Size2d}, measure::Response, - rectangle::Corners, + rect::Corners, }; #[derive(Setters)] diff --git a/hui/src/element/builtin/progress_bar.rs b/hui/src/element/builtin/progress_bar.rs index a077f29..1c73cb0 100644 --- a/hui/src/element/builtin/progress_bar.rs +++ b/hui/src/element/builtin/progress_bar.rs @@ -6,7 +6,7 @@ use crate::{ element::{MeasureContext, ProcessContext, UiElement}, layout::{compute_size, Size, Size2d}, measure::Response, - rectangle::Corners + rect::Corners }; #[derive(Debug, Clone, Copy, Setters)] diff --git a/hui/src/element/builtin/slider.rs b/hui/src/element/builtin/slider.rs index ec65bd5..e127db8 100644 --- a/hui/src/element/builtin/slider.rs +++ b/hui/src/element/builtin/slider.rs @@ -8,7 +8,7 @@ use crate::{ element::{MeasureContext, ProcessContext, UiElement}, layout::{Size2d, compute_size}, measure::Response, - rectangle::FillColor, + rect::FillColor, signal::{trigger::SignalTriggerArg, Signal}, }; diff --git a/hui/src/input.rs b/hui/src/input.rs index 2803a53..45e4cc5 100644 --- a/hui/src/input.rs +++ b/hui/src/input.rs @@ -5,7 +5,7 @@ use glam::Vec2; use hashbrown::HashMap; use nohash_hasher::BuildNoHashHasher; use tinyset::{Fits64, Set64}; -use crate::{event::{EventQueue, UiEvent}, rectangle::Rect}; +use crate::{event::{EventQueue, UiEvent}, rect::Rect}; /// Represents a mouse button. /// diff --git a/hui/src/lib.rs b/hui/src/lib.rs index 5f0506a..db862d6 100644 --- a/hui/src/lib.rs +++ b/hui/src/lib.rs @@ -12,7 +12,7 @@ mod instance; mod macros; pub mod layout; -pub mod rectangle; +pub mod rect; pub mod background; pub mod element; pub mod event; diff --git a/hui/src/measure.rs b/hui/src/measure.rs index 6f8ebbb..a131c75 100644 --- a/hui/src/measure.rs +++ b/hui/src/measure.rs @@ -1,7 +1,7 @@ //! element measurement, hints and responses use glam::Vec2; -use crate::rectangle::Rect; +use crate::rect::Rect; // #[non_exhaustive] #[derive(Default)] diff --git a/hui/src/rectangle.rs b/hui/src/rect.rs similarity index 100% rename from hui/src/rectangle.rs rename to hui/src/rect.rs diff --git a/hui/src/rectangle/color.rs b/hui/src/rect/color.rs similarity index 100% rename from hui/src/rectangle/color.rs rename to hui/src/rect/color.rs diff --git a/hui/src/rectangle/corners.rs b/hui/src/rect/corners.rs similarity index 100% rename from hui/src/rectangle/corners.rs rename to hui/src/rect/corners.rs diff --git a/hui/src/rectangle/rect.rs b/hui/src/rect/rect.rs similarity index 100% rename from hui/src/rectangle/rect.rs rename to hui/src/rect/rect.rs diff --git a/hui/src/rectangle/sides.rs b/hui/src/rect/sides.rs similarity index 100% rename from hui/src/rectangle/sides.rs rename to hui/src/rect/sides.rs