summaryrefslogtreecommitdiff
path: root/src/gui/window.cpp
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2009-03-09 01:23:14 -0600
committerIra Rice <irarice@gmail.com>2009-03-09 01:23:14 -0600
commit40883938ceb60b0999f9b693dadbe2239e83f139 (patch)
tree594edf50f129f6e6a09b8f139495fdc4bf587684 /src/gui/window.cpp
parent5fa3f62d0d6d9cbffeef0f6a2497aae023dbadcf (diff)
downloadmana-client-40883938ceb60b0999f9b693dadbe2239e83f139.tar.gz
mana-client-40883938ceb60b0999f9b693dadbe2239e83f139.tar.bz2
mana-client-40883938ceb60b0999f9b693dadbe2239e83f139.tar.xz
mana-client-40883938ceb60b0999f9b693dadbe2239e83f139.zip
Got rid of an ugly and unified interface breaking cancel button in favor
of adding overridable close functionality to the Window class. Now, if you need a close button, but need to do something different, or in addition to the Window close functionality, you can override it and do that action. Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/gui/window.cpp')
-rw-r--r--src/gui/window.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/window.cpp b/src/gui/window.cpp
index 0869368d..2b422f86 100644
--- a/src/gui/window.cpp
+++ b/src/gui/window.cpp
@@ -328,7 +328,7 @@ void Window::mousePressed(gcn::MouseEvent &event)
if (closeButtonRect.isPointInRect(x, y))
{
- setVisible(false);
+ close();
}
}
@@ -337,6 +337,11 @@ void Window::mousePressed(gcn::MouseEvent &event)
}
}
+void Window::close()
+{
+ setVisible(false);
+}
+
void Window::mouseReleased(gcn::MouseEvent &event)
{
if (mGrip && mouseResize)