diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-07-24 09:04:57 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-07-24 09:04:57 +0200 |
commit | 90ea4918d6c8b011710be2c4a1d7756a07cd45c3 (patch) | |
tree | 9853834f9ff790dad908594b9b35b4cfe1d6ff77 /Servers/WindowServer/WSWindowFrame.cpp | |
parent | a635e62e6a99dbd732ea2fda1422d9179512e0f6 (diff) | |
download | serenity-90ea4918d6c8b011710be2c4a1d7756a07cd45c3.zip |
WindowServer: Convert Vector<OwnPtr> to NonnullOwnPtrVector.
Diffstat (limited to 'Servers/WindowServer/WSWindowFrame.cpp')
-rw-r--r-- | Servers/WindowServer/WSWindowFrame.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Servers/WindowServer/WSWindowFrame.cpp b/Servers/WindowServer/WSWindowFrame.cpp index 340ebebd32..ac46b67231 100644 --- a/Servers/WindowServer/WSWindowFrame.cpp +++ b/Servers/WindowServer/WSWindowFrame.cpp @@ -194,7 +194,7 @@ void WSWindowFrame::paint(Painter& painter) painter.draw_line(titlebar_rect.bottom_left().translated(0, 1), titlebar_rect.bottom_right().translated(0, 1), Color::WarmGray); - auto leftmost_button_rect = m_buttons.is_empty() ? Rect() : m_buttons.last()->relative_rect(); + auto leftmost_button_rect = m_buttons.is_empty() ? Rect() : m_buttons.last().relative_rect(); painter.fill_rect_with_gradient(titlebar_rect, border_color, border_color2); for (int i = 2; i <= titlebar_inner_rect.height() - 2; i += 2) { @@ -208,7 +208,7 @@ void WSWindowFrame::paint(Painter& painter) painter.blit(titlebar_icon_rect.location(), window.icon(), window.icon().rect()); for (auto& button : m_buttons) { - button->paint(painter); + button.paint(painter); } } @@ -248,12 +248,12 @@ void WSWindowFrame::notify_window_rect_changed(const Rect& old_rect, const Rect& int window_button_width = 15; int window_button_height = 15; int x = title_bar_text_rect().right() + 1; - ; + for (auto& button : m_buttons) { x -= window_button_width; Rect rect { x, 0, window_button_width, window_button_height }; rect.center_vertically_within(title_bar_text_rect()); - button->set_relative_rect(rect); + button.set_relative_rect(rect); } auto& wm = WSWindowManager::the(); @@ -288,8 +288,8 @@ void WSWindowFrame::on_mouse_event(const WSMouseEvent& event) wm.move_to_front_and_make_active(m_window); for (auto& button : m_buttons) { - if (button->relative_rect().contains(event.position())) - return button->on_mouse_event(event.translated(-button->relative_rect().location())); + if (button.relative_rect().contains(event.position())) + return button.on_mouse_event(event.translated(-button.relative_rect().location())); } if (event.type() == WSEvent::MouseDown && event.button() == MouseButton::Left) wm.start_window_drag(m_window, event.translated(rect().location())); |