summaryrefslogtreecommitdiff
path: root/src/gui/widgets/window.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/window.cpp')
-rw-r--r--src/gui/widgets/window.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp
index 7680600ff..a975f2db1 100644
--- a/src/gui/widgets/window.cpp
+++ b/src/gui/widgets/window.cpp
@@ -26,6 +26,7 @@
#include "configuration.h"
#include "graphicsvertexes.h"
#include "logger.h"
+#include "sound.h"
#include "gui/gui.h"
#include "gui/palette.h"
@@ -79,6 +80,7 @@ Window::Window(const std::string &caption, const bool modal,
mGripPadding(2),
mResizeHandles(-1),
mRedraw(true),
+ mPlayVisibleSound(false),
mCaptionFont(getFont())
{
logger->log("Window::Window(\"%s\")", caption.c_str());
@@ -504,6 +506,8 @@ void Window::setVisible(bool visible, bool forceSticky)
gcn::Window::setVisible((!forceSticky && isSticky()) || visible);
if (visible)
{
+ if (mPlayVisibleSound)
+ sound.playGuiSound(SOUND_SHOW_WINDOW);
if (gui)
{
gcn::MouseEvent *event = reinterpret_cast<gcn::MouseEvent*>(
@@ -521,6 +525,11 @@ void Window::setVisible(bool visible, bool forceSticky)
}
}
}
+ else
+ {
+ if (mPlayVisibleSound)
+ sound.playGuiSound(SOUND_HIDE_WINDOW);
+ }
}
void Window::scheduleDelete()