Open gyscos opened 5 years ago
Some modules refactor may come at the same time.
vec::Vec2
).view
module is a bit of an arbitrary mashup of various components, we may want to split it out.utils
modules may need to be split into other top-level modules - maybe layout::{lines, span}
and markup
.XY
,Rect
, Vec2
? Most of utils
?The most controvertial change here is the removal of the View
suffix from view names. To better understand the implications, here is the exact renaming it would include:
BoxView
-> views::Resized
DebugView
-> views::DebugConsole
EditView
-> views::Edit
EnableableView
-> views::Enableable
HideableView
-> views::Hideable
IdView
-> views::Named
LinearLayout
-> layouts::Linear
ListView
-> views::List
OnEventView
-> views::OnEvent
PaddedView
-> views::Padded
ScrollView
-> views::Scroll
SelectView
-> views::Select
ShadowView
-> views::Shadow
SizedView
-> views::LastSize
SliderView
-> views::Slider
StackView
-> views::Stack
TextView
-> views::Text
TrackedView
-> views::Tracked
ViewBox
-> views::Boxed
Haven't stripped the View
suffix yet, but the first phase of the renaming has been done:
BoxView
-> ResizedView
Boxable
-> Resizable
SizedView
-> LastSizeView
ViewBox
-> BoxedView
IdView
-> NamedView
Selector::Id
-> Selector::Name
Identifiable
-> Nameable
*_id
-> *_name
Old names are still exported, but deprecated (except for Boxable
and Identifiable
, trait alias are unstable and simple re-use are not deprecatable).
Naming is a notoriously hard problem, but we can probably do better than the current status quo.
View
in view names? Or should we try to haveviews::Edit
,views::Text
,layout::Linear
?views::SizedView
is confusing; should probably be calledSizeTrackedView
,SizeTracker
, orLastSizeView
.views::ViewBox
should probably beviews::BoxedView
views::BoxView
should probably beviews::SizedView
Some of the expansion traits would need to adapt as well.
It's not a lot of types to renames, but they are very commonly used.