summaryrefslogtreecommitdiff
path: root/src/gui/widgets/window.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-03-22 15:38:51 +0300
committerAndrei Karas <akaras@inbox.ru>2014-03-22 15:38:51 +0300
commit7b07b0a09fd9799a7aca09c0dcd97a53547b0fa1 (patch)
treeca8ecc25a420c93944db3b9444acc1f68931efd5 /src/gui/widgets/window.cpp
parentba931a717cb5a2549ecdaa1f924dbbf5f896a21b (diff)
downloadmv-7b07b0a09fd9799a7aca09c0dcd97a53547b0fa1.tar.gz
mv-7b07b0a09fd9799a7aca09c0dcd97a53547b0fa1.tar.bz2
mv-7b07b0a09fd9799a7aca09c0dcd97a53547b0fa1.tar.xz
mv-7b07b0a09fd9799a7aca09c0dcd97a53547b0fa1.zip
Add context menu into windows.
Diffstat (limited to 'src/gui/widgets/window.cpp')
-rw-r--r--src/gui/widgets/window.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp
index 8d457e599..4f8bc88b3 100644
--- a/src/gui/widgets/window.cpp
+++ b/src/gui/widgets/window.cpp
@@ -641,6 +641,7 @@ void Window::setStickyButton(const bool flag)
void Window::setSticky(const bool sticky)
{
mSticky = sticky;
+ mRedraw = true;
}
void Window::setStickyButtonLock(const bool lock)
@@ -704,6 +705,9 @@ void Window::scheduleDelete()
void Window::mousePressed(MouseEvent &event)
{
+ if (event.isConsumed())
+ return;
+
if (event.getSource() == this)
{
if (getParent())
@@ -714,7 +718,8 @@ void Window::mousePressed(MouseEvent &event)
mMoved = event.getY() <= static_cast<int>(mTitleBarHeight);
}
- if (event.getButton() == MouseEvent::LEFT)
+ const unsigned int button = event.getButton();
+ if (button == MouseEvent::LEFT)
{
const int x = event.getX();
const int y = event.getY();
@@ -735,7 +740,6 @@ void Window::mousePressed(MouseEvent &event)
setSticky(!isSticky());
mouseResize = 0;
mMoved = 0;
- mRedraw = true;
event.consume();
return;
}
@@ -749,6 +753,14 @@ void Window::mousePressed(MouseEvent &event)
else
mMoved = false;
}
+ else if (button == MouseEvent::RIGHT)
+ {
+ if (viewport)
+ {
+ event.consume();
+ viewport->showWindowPopup(this);
+ }
+ }
}
void Window::close()