[SCM] ktp-text-ui packaging branch, master, updated. debian/15.12.1-1-1918-gdf4b0ec
Maximiliano Curia
maxy at moszumanska.debian.org
Sat May 28 00:25:12 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=5246520
The following commit has been merged in the master branch:
commit 52465203a52eb584cde430e458b1f46076658fe9
Author: Martin Klapetek <mklapetek at kde.org>
Date: Wed Jan 14 19:25:10 2015 +0100
[app] Fix tab's context menu not appearing
Now it appears
---
app/chat-window.cpp | 8 +++++---
app/chat-window.h | 2 +-
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/app/chat-window.cpp b/app/chat-window.cpp
index 893df45..7bb87c0 100644
--- a/app/chat-window.cpp
+++ b/app/chat-window.cpp
@@ -129,6 +129,7 @@ ChatWindow::ChatWindow()
m_tabWidget->setMovable(true);
m_tabWidget->setDocumentMode(true);
m_tabWidget->setTabsClosable(true);
+ m_tabWidget->tabBar()->setContextMenuPolicy(Qt::CustomContextMenu);
m_tabWidget->tabBar()->hide();
m_tabWidget->setElideMode(Qt::ElideRight);
@@ -136,7 +137,7 @@ ChatWindow::ChatWindow()
connect(m_tabWidget, SIGNAL(currentChanged(int)), this, SLOT(onCurrentIndexChanged(int)));
connect(qobject_cast<QTabBar*>(m_tabWidget->tabBar()), SIGNAL(mouseMiddleClick(int)), this, SLOT(onTabMiddleClicked(int)));
- connect(qobject_cast<QTabBar*>(m_tabWidget->tabBar()), SIGNAL(contextMenu(int,QPoint)), SLOT(tabBarContextMenu(int,QPoint)));
+ connect(qobject_cast<QTabBar*>(m_tabWidget->tabBar()), SIGNAL(customContextMenuRequested(QPoint)), SLOT(tabBarContextMenu(QPoint)));
setCentralWidget(m_tabWidget);
@@ -161,8 +162,9 @@ ChatWindow::~ChatWindow()
Q_EMIT aboutToClose(this);
}
-void ChatWindow::tabBarContextMenu(int index, const QPoint& globalPos)
+void ChatWindow::tabBarContextMenu(const QPoint &globalPos)
{
+ int index = m_tabWidget->tabBar()->tabAt(globalPos);
QAction close(QIcon::fromTheme(QStringLiteral("tab-close")), i18n("Close"), this);
QAction dettach(QIcon::fromTheme(QStringLiteral("tab-detach")), i18n("Detach Tab"), this);
QAction moveLeft(QIcon::fromTheme(QStringLiteral("arrow-left")), i18n("Move Tab Left"), this);
@@ -181,7 +183,7 @@ void ChatWindow::tabBarContextMenu(int index, const QPoint& globalPos)
moveRight.setEnabled(false);
}
- QAction *result = qobject_cast<QAction*>(menu->exec(globalPos));
+ QAction *result = qobject_cast<QAction*>(menu->exec(m_tabWidget->tabBar()->mapToGlobal(globalPos)));
if(result == &close) {
destroyTab(index);
diff --git a/app/chat-window.h b/app/chat-window.h
index b0c8ae2..25eceb7 100644
--- a/app/chat-window.h
+++ b/app/chat-window.h
@@ -83,7 +83,7 @@ protected:
private Q_SLOTS:
- void tabBarContextMenu(int index, const QPoint & globalPos);
+ void tabBarContextMenu(const QPoint &globalPos);
void closeCurrentTab();
void onAudioCallTriggered(); /** start an audio call */
void onBlockContactTriggered(); /** Blocks contact */
--
ktp-text-ui packaging
More information about the pkg-kde-commits
mailing list