mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:17:35 +00:00
LibGfx: Unpublish Gfx::Size from the global namespace
This commit is contained in:
parent
9b87843af1
commit
f8b00aa290
29 changed files with 41 additions and 43 deletions
|
@ -48,7 +48,7 @@ void BoxLayout::run(Widget& widget)
|
|||
if (m_entries.is_empty())
|
||||
return;
|
||||
|
||||
Size available_size = widget.size();
|
||||
Gfx::Size available_size = widget.size();
|
||||
int number_of_entries_with_fixed_size = 0;
|
||||
|
||||
int number_of_visible_entries = 0;
|
||||
|
@ -91,7 +91,7 @@ void BoxLayout::run(Widget& widget)
|
|||
if (should_log)
|
||||
dbgprintf("BoxLayout: available_size=%s, fixed=%d, fill=%d\n", available_size.to_string().characters(), number_of_entries_with_fixed_size, number_of_entries_with_automatic_size);
|
||||
|
||||
Size automatic_size;
|
||||
Gfx::Size automatic_size;
|
||||
|
||||
if (number_of_entries_with_automatic_size) {
|
||||
if (m_orientation == Orientation::Horizontal) {
|
||||
|
|
|
@ -113,7 +113,7 @@ void ComboBox::open()
|
|||
auto item_text = model()->data(index).to_string();
|
||||
longest_item_width = max(longest_item_width, m_list_view->font().width(item_text));
|
||||
}
|
||||
Size size {
|
||||
Gfx::Size size {
|
||||
max(width(), longest_item_width + m_list_view->width_occupied_by_vertical_scrollbar() + m_list_view->frame_thickness() * 2 + m_list_view->horizontal_padding()),
|
||||
model()->row_count() * m_list_view->item_height() + m_list_view->frame_thickness() * 2
|
||||
};
|
||||
|
|
|
@ -47,7 +47,7 @@ DragOperation::Outcome DragOperation::exec()
|
|||
ASSERT(!m_event_loop);
|
||||
|
||||
int bitmap_id = -1;
|
||||
Size bitmap_size;
|
||||
Gfx::Size bitmap_size;
|
||||
RefPtr<Gfx::Bitmap> shared_bitmap;
|
||||
if (m_bitmap) {
|
||||
shared_bitmap = m_bitmap->to_shareable_bitmap();
|
||||
|
|
|
@ -173,7 +173,7 @@ public:
|
|||
}
|
||||
|
||||
const Vector<Gfx::Rect, 32>& rects() const { return m_rects; }
|
||||
Size window_size() const { return m_window_size; }
|
||||
Gfx::Size window_size() const { return m_window_size; }
|
||||
|
||||
private:
|
||||
Vector<Gfx::Rect, 32> m_rects;
|
||||
|
@ -182,7 +182,7 @@ private:
|
|||
|
||||
class PaintEvent final : public Event {
|
||||
public:
|
||||
explicit PaintEvent(const Gfx::Rect& rect, const Gfx::Size& window_size = Size())
|
||||
explicit PaintEvent(const Gfx::Rect& rect, const Gfx::Size& window_size = {})
|
||||
: Event(Event::Paint)
|
||||
, m_rect(rect)
|
||||
, m_window_size(window_size)
|
||||
|
@ -190,7 +190,7 @@ public:
|
|||
}
|
||||
|
||||
Gfx::Rect rect() const { return m_rect; }
|
||||
Size window_size() const { return m_window_size; }
|
||||
Gfx::Size window_size() const { return m_window_size; }
|
||||
|
||||
private:
|
||||
Gfx::Rect m_rect;
|
||||
|
|
|
@ -45,7 +45,7 @@ public:
|
|||
int horizontal_padding() const { return m_horizontal_padding; }
|
||||
|
||||
void scroll_into_view(const ModelIndex&, Orientation);
|
||||
Size effective_item_size() const { return m_effective_item_size; }
|
||||
Gfx::Size effective_item_size() const { return m_effective_item_size; }
|
||||
|
||||
int model_column() const { return m_model_column; }
|
||||
void set_model_column(int column) { m_model_column = column; }
|
||||
|
|
|
@ -124,7 +124,7 @@ int Menu::realize_menu()
|
|||
int icon_buffer_id = -1;
|
||||
if (action.icon()) {
|
||||
ASSERT(action.icon()->format() == Gfx::Bitmap::Format::RGBA32);
|
||||
ASSERT(action.icon()->size() == Size(16, 16));
|
||||
ASSERT(action.icon()->size() == Gfx::Size(16, 16));
|
||||
if (action.icon()->shared_buffer_id() == -1) {
|
||||
auto shared_buffer = SharedBuffer::create_with_size(action.icon()->size_in_bytes());
|
||||
ASSERT(shared_buffer);
|
||||
|
|
|
@ -45,7 +45,7 @@ RadioButton::~RadioButton()
|
|||
{
|
||||
}
|
||||
|
||||
Size RadioButton::circle_size()
|
||||
Gfx::Size RadioButton::circle_size()
|
||||
{
|
||||
return { 12, 12 };
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ private:
|
|||
|
||||
template<typename Callback>
|
||||
void for_each_in_group(Callback);
|
||||
static Size circle_size();
|
||||
static Gfx::Size circle_size();
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ void ScrollableWidget::resize_event(ResizeEvent& event)
|
|||
update_scrollbar_ranges();
|
||||
}
|
||||
|
||||
Size ScrollableWidget::available_size() const
|
||||
Gfx::Size ScrollableWidget::available_size() const
|
||||
{
|
||||
int available_width = frame_inner_rect().width() - m_size_occupied_by_fixed_elements.width() - width_occupied_by_vertical_scrollbar();
|
||||
int available_height = frame_inner_rect().height() - m_size_occupied_by_fixed_elements.height() - height_occupied_by_horizontal_scrollbar();
|
||||
|
|
|
@ -37,7 +37,7 @@ class ScrollableWidget : public Frame {
|
|||
public:
|
||||
virtual ~ScrollableWidget() override;
|
||||
|
||||
Size content_size() const { return m_content_size; }
|
||||
Gfx::Size content_size() const { return m_content_size; }
|
||||
int content_width() const { return m_content_size.width(); }
|
||||
int content_height() const { return m_content_size.height(); }
|
||||
|
||||
|
@ -51,7 +51,7 @@ public:
|
|||
void set_scrollbars_enabled(bool);
|
||||
bool is_scrollbars_enabled() const { return m_scrollbars_enabled; }
|
||||
|
||||
Size available_size() const;
|
||||
Gfx::Size available_size() const;
|
||||
|
||||
ScrollBar& vertical_scrollbar() { return *m_vertical_scrollbar; }
|
||||
const ScrollBar& vertical_scrollbar() const { return *m_vertical_scrollbar; }
|
||||
|
|
|
@ -189,7 +189,7 @@ public:
|
|||
return { m_value.as_point.x, m_value.as_point.y };
|
||||
}
|
||||
|
||||
Size as_size() const
|
||||
Gfx::Size as_size() const
|
||||
{
|
||||
return { m_value.as_size.width, m_value.as_size.height };
|
||||
}
|
||||
|
|
|
@ -124,7 +124,7 @@ public:
|
|||
void set_size_policy(SizePolicy horizontal_policy, SizePolicy vertical_policy);
|
||||
void set_size_policy(Orientation, SizePolicy);
|
||||
|
||||
Size preferred_size() const { return m_preferred_size; }
|
||||
Gfx::Size preferred_size() const { return m_preferred_size; }
|
||||
void set_preferred_size(const Gfx::Size&);
|
||||
void set_preferred_size(int width, int height) { set_preferred_size({ width, height }); }
|
||||
|
||||
|
@ -156,7 +156,7 @@ public:
|
|||
int length(Orientation orientation) const { return orientation == Orientation::Vertical ? height() : width(); }
|
||||
|
||||
Gfx::Rect rect() const { return { 0, 0, width(), height() }; }
|
||||
Size size() const { return m_relative_rect.size(); }
|
||||
Gfx::Size size() const { return m_relative_rect.size(); }
|
||||
|
||||
void update();
|
||||
void update(const Gfx::Rect&);
|
||||
|
|
|
@ -102,7 +102,7 @@ public:
|
|||
int height() const { return rect().height(); }
|
||||
|
||||
Gfx::Rect rect() const;
|
||||
Size size() const { return rect().size(); }
|
||||
Gfx::Size size() const { return rect().size(); }
|
||||
void set_rect(const Gfx::Rect&);
|
||||
void set_rect(int x, int y, int width, int height) { set_rect({ x, y, width, height }); }
|
||||
|
||||
|
@ -152,9 +152,9 @@ public:
|
|||
Gfx::Bitmap* front_bitmap() { return m_front_bitmap.ptr(); }
|
||||
Gfx::Bitmap* back_bitmap() { return m_back_bitmap.ptr(); }
|
||||
|
||||
Size size_increment() const { return m_size_increment; }
|
||||
Gfx::Size size_increment() const { return m_size_increment; }
|
||||
void set_size_increment(const Gfx::Size& increment) { m_size_increment = increment; }
|
||||
Size base_size() const { return m_base_size; }
|
||||
Gfx::Size base_size() const { return m_base_size; }
|
||||
void set_base_size(const Gfx::Size& size) { m_base_size = size; }
|
||||
|
||||
void set_override_cursor(StandardCursor);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue