|
@@ -18,6 +18,7 @@
|
|
|
#include <LibGUI/Forward.h>
|
|
|
#include <LibGUI/GML/AST.h>
|
|
|
#include <LibGUI/Margins.h>
|
|
|
+#include <LibGUI/UIDimensions.h>
|
|
|
#include <LibGfx/Color.h>
|
|
|
#include <LibGfx/Forward.h>
|
|
|
#include <LibGfx/Orientation.h>
|
|
@@ -80,40 +81,43 @@ public:
|
|
|
return layout;
|
|
|
}
|
|
|
|
|
|
- Gfx::IntSize min_size() const { return m_min_size; }
|
|
|
- void set_min_size(Gfx::IntSize const&);
|
|
|
- void set_min_size(int width, int height) { set_min_size({ width, height }); }
|
|
|
+ UISize min_size() const { return m_min_size; }
|
|
|
+ void set_min_size(UISize const&);
|
|
|
+ void set_min_size(UIDimension width, UIDimension height) { set_min_size({ width, height }); }
|
|
|
|
|
|
- int min_width() const { return m_min_size.width(); }
|
|
|
- int min_height() const { return m_min_size.height(); }
|
|
|
- void set_min_width(int width) { set_min_size(width, min_height()); }
|
|
|
- void set_min_height(int height) { set_min_size(min_width(), height); }
|
|
|
+ UIDimension min_width() const { return m_min_size.width(); }
|
|
|
+ UIDimension min_height() const { return m_min_size.height(); }
|
|
|
+ void set_min_width(UIDimension width) { set_min_size(width, min_height()); }
|
|
|
+ void set_min_height(UIDimension height) { set_min_size(min_width(), height); }
|
|
|
|
|
|
- Gfx::IntSize max_size() const { return m_max_size; }
|
|
|
- void set_max_size(Gfx::IntSize const&);
|
|
|
- void set_max_size(int width, int height) { set_max_size({ width, height }); }
|
|
|
+ UISize max_size() const { return m_max_size; }
|
|
|
+ void set_max_size(UISize const&);
|
|
|
+ void set_max_size(UIDimension width, UIDimension height) { set_max_size({ width, height }); }
|
|
|
|
|
|
- int max_width() const { return m_max_size.width(); }
|
|
|
- int max_height() const { return m_max_size.height(); }
|
|
|
- void set_max_width(int width) { set_max_size(width, max_height()); }
|
|
|
- void set_max_height(int height) { set_max_size(max_width(), height); }
|
|
|
+ UIDimension max_width() const { return m_max_size.width(); }
|
|
|
+ UIDimension max_height() const { return m_max_size.height(); }
|
|
|
+ void set_max_width(UIDimension width) { set_max_size(width, max_height()); }
|
|
|
+ void set_max_height(UIDimension height) { set_max_size(max_width(), height); }
|
|
|
|
|
|
- void set_fixed_size(Gfx::IntSize const& size)
|
|
|
+ void set_fixed_size(UISize const& size)
|
|
|
{
|
|
|
+ VERIFY(size.has_only_int_values());
|
|
|
set_min_size(size);
|
|
|
set_max_size(size);
|
|
|
}
|
|
|
|
|
|
- void set_fixed_size(int width, int height) { set_fixed_size({ width, height }); }
|
|
|
+ void set_fixed_size(UIDimension width, UIDimension height) { set_fixed_size({ width, height }); }
|
|
|
|
|
|
- void set_fixed_width(int width)
|
|
|
+ void set_fixed_width(UIDimension width)
|
|
|
{
|
|
|
+ VERIFY(width.is_int());
|
|
|
set_min_width(width);
|
|
|
set_max_width(width);
|
|
|
}
|
|
|
|
|
|
- void set_fixed_height(int height)
|
|
|
+ void set_fixed_height(UIDimension height)
|
|
|
{
|
|
|
+ VERIFY(height.is_int());
|
|
|
set_min_height(height);
|
|
|
set_max_height(height);
|
|
|
}
|
|
@@ -377,8 +381,8 @@ private:
|
|
|
NonnullRefPtr<Gfx::Font> m_font;
|
|
|
String m_tooltip;
|
|
|
|
|
|
- Gfx::IntSize m_min_size { -1, -1 };
|
|
|
- Gfx::IntSize m_max_size { -1, -1 };
|
|
|
+ UISize m_min_size { SpecialDimension::Shrink };
|
|
|
+ UISize m_max_size { SpecialDimension::Grow };
|
|
|
Margins m_grabbable_margins;
|
|
|
|
|
|
bool m_fill_with_background_color { false };
|