[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: extragear/utils/yakuake
From: Eike Hein <hein () kde ! org>
Date: 2010-04-18 22:37:05
Message-ID: 20100418223705.60ACEAC89D () svn ! kde ! org
[Download RAW message or body]
SVN commit 1116239 by hein:
Make tabs draggable and closeable my middle-mouse. Patch by Timur Antipin, thanks!
M +3 -0 ChangeLog
M +8 -5 app/tabbar.cpp
--- trunk/extragear/utils/yakuake/ChangeLog #1116238:1116239
@@ -10,6 +10,9 @@
notification is now used for announcing that Yakuake was started success-
fully, rather than the passive popup in the top-left desktop corner used
with older versions of the KDE platform.
+* Middle-clicking a tab closes it now, consistent with many other KDE apps.
+* Tabs can now also be dragged using middle-mouse, again for consistency
+ with many other KDE apps.
Changes in 2.9.6:
--- trunk/extragear/utils/yakuake/app/tabbar.cpp #1116238:1116239
@@ -445,10 +445,10 @@
if (index == -1) return;
- if (event->button() == Qt::LeftButton)
+ if (event->button() == Qt::LeftButton || event->button() == Qt::MidButton)
{
m_startPos = event->pos();
- if (index != m_tabs.indexOf(m_selectedSessionId))
+ if (index != m_tabs.indexOf(m_selectedSessionId) || event->button() == \
Qt::MidButton) {
m_mousePressed = true;
m_mousePressedIndex = index;
@@ -466,10 +466,13 @@
int index = tabAt(event->x());
- if (event->button() == Qt::LeftButton && index != \
m_tabs.indexOf(m_selectedSessionId)) + if (m_mousePressed && m_mousePressedIndex \
== index) {
- if (m_mousePressed && m_mousePressedIndex == index)
+ if (event->button() == Qt::LeftButton && index != \
m_tabs.indexOf(m_selectedSessionId)) emit tabSelected(m_tabs.at(index));
+
+ if (event->button() == Qt::MidButton)
+ emit tabClosed(m_tabs.at(index));
}
m_mousePressed = false;
@@ -479,7 +482,7 @@
void TabBar::mouseMoveEvent(QMouseEvent* event)
{
- if (!m_startPos.isNull() && (event->buttons() & Qt::LeftButton))
+ if (!m_startPos.isNull() && ((event->buttons() & Qt::LeftButton) || \
(event->buttons() & Qt::MidButton))) {
int distance = (event->pos() - m_startPos).manhattanLength();
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic