summaryrefslogtreecommitdiff
path: root/Servers/WindowServer/WSWindowFrame.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-04-05 21:53:45 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-04-05 21:53:45 +0200
commit0fc3ccaa5281c4e895cb0d0d96bfe25360bcea32 (patch)
tree3d7b669a9e692a65184c00df9aa93a2c927ba154 /Servers/WindowServer/WSWindowFrame.cpp
parent0d60c56b514dcc6b10e994e247253ea9fe81a1a0 (diff)
downloadserenity-0fc3ccaa5281c4e895cb0d0d96bfe25360bcea32.zip
WindowServer: Make WSButton behave more like a normal button.
Previously it would just close the window on MouseDown. Now we do the normal thing where we require a MouseUp inside the button rect before committing.
Diffstat (limited to 'Servers/WindowServer/WSWindowFrame.cpp')
-rw-r--r--Servers/WindowServer/WSWindowFrame.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/Servers/WindowServer/WSWindowFrame.cpp b/Servers/WindowServer/WSWindowFrame.cpp
index b0109f42f6..ec08641d8d 100644
--- a/Servers/WindowServer/WSWindowFrame.cpp
+++ b/Servers/WindowServer/WSWindowFrame.cpp
@@ -32,7 +32,7 @@ WSWindowFrame::WSWindowFrame(WSWindow& window)
if (!s_close_button_bitmap)
s_close_button_bitmap = &CharacterBitmap::create_from_ascii(s_close_button_bitmap_data, s_close_button_bitmap_width, s_close_button_bitmap_height).leak_ref();
- m_buttons.append(make<WSButton>(*s_close_button_bitmap, [this] {
+ m_buttons.append(make<WSButton>(*this, *s_close_button_bitmap, [this] {
m_window.on_message(WSMessage(WSMessage::WindowCloseRequest));
}));
}
@@ -181,6 +181,11 @@ Rect WSWindowFrame::rect() const
return frame_rect_for_window_type(m_window.type(), m_window.rect());
}
+void WSWindowFrame::invalidate_title_bar()
+{
+ WSWindowManager::the().invalidate(title_bar_rect().translated(rect().location()));
+}
+
void WSWindowFrame::notify_window_rect_changed(const Rect& old_rect, const Rect& new_rect)
{
int window_button_width = 15;