mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 01:20:25 +00:00
LibWeb: Add helper function for creating auto GridTrackSizes
Makes it more convenient to create auto GridTrackSizes. I think having an auto GridTrackSize be defined by an auto Length value kind of confusing, and this at least helps when creating one.
This commit is contained in:
parent
ad221164d5
commit
9681eb89a6
Notes:
sideshowbarker
2024-07-17 07:12:07 +09:00
Author: https://github.com/martinfalisse Commit: https://github.com/SerenityOS/serenity/commit/9681eb89a6 Pull-request: https://github.com/SerenityOS/serenity/pull/15155 Reviewed-by: https://github.com/MacDue
2 changed files with 7 additions and 0 deletions
|
@ -30,6 +30,11 @@ GridTrackSize::GridTrackSize(float flexible_length)
|
|||
{
|
||||
}
|
||||
|
||||
GridTrackSize GridTrackSize::make_auto()
|
||||
{
|
||||
return GridTrackSize(CSS::Length::make_auto());
|
||||
}
|
||||
|
||||
String GridTrackSize::to_string() const
|
||||
{
|
||||
switch (m_type) {
|
||||
|
|
|
@ -26,6 +26,8 @@ public:
|
|||
GridTrackSize(Percentage);
|
||||
GridTrackSize(float);
|
||||
|
||||
static GridTrackSize make_auto();
|
||||
|
||||
Type type() const { return m_type; }
|
||||
|
||||
bool is_length() const { return m_type == Type::Length; }
|
||||
|
|
Loading…
Reference in a new issue