[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [calligra/kexi-frameworks7-staniek] kexi/main: Kexi: Only display context menu for the main tab bar 
From:       Jaroslaw Staniek <staniek () kde ! org>
Date:       2015-06-30 20:24:30
Message-ID: E1ZA250-0006Ps-BE () scm ! kde ! org
[Download RAW message or body]

Git commit 76e94b8c2d92fa7115b52dfc5f01c0eccd47fe08 by Jaroslaw Staniek.
Committed on 30/06/2015 at 20:16.
Pushed by staniek into branch 'kexi-frameworks7-staniek'.

Kexi: Only display context menu for the main tab bar if it's inside of the tabbar

M  +7    -1    kexi/main/KexiMainWindow.cpp

http://commits.kde.org/calligra/76e94b8c2d92fa7115b52dfc5f01c0eccd47fe08

diff --git a/kexi/main/KexiMainWindow.cpp b/kexi/main/KexiMainWindow.cpp
index e5d54b3..8677109 100644
--- a/kexi/main/KexiMainWindow.cpp
+++ b/kexi/main/KexiMainWindow.cpp
@@ -240,7 +240,13 @@ void KexiMainWindowTabWidget::mousePressEvent(QMouseEvent \
                *event)
     //! @todo KEXI3 test KexiMainWindowTabWidget's contextMenu event port from \
KTabWidget  if (event->button() == Qt::RightButton) {
         int tab = tabBar()->tabAt(event->pos());
-        showContextMenuForTab(tab, tabBar()->mapToGlobal(event->pos()));
+        const QPoint realPos(tabBar()->mapToGlobal(event->pos()));
+        if (QRect(tabBar()->mapToGlobal(QPoint(0,0)),
+              tabBar()->mapToGlobal(QPoint(tabBar()->width()-1, \
tabBar()->height()-1))).contains(realPos)) +        {
+            showContextMenuForTab(tab, tabBar()->mapToGlobal(event->pos()));
+            return;
+        }
     }
     QTabWidget::mousePressEvent(event);
 }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic