mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-19 16:31:21 +00:00
The mouse wheel now works on Dolphin's tabs (to switch tabs), like just about every other KDE app.
svn path=/trunk/KDE/kdebase/apps/; revision=918498
This commit is contained in:
parent
444310cff0
commit
6a0898178c
|
@ -266,6 +266,18 @@ void DolphinMainWindow::slotSelectionChanged(const KFileItemList& selection)
|
|||
emit selectionChanged(selection);
|
||||
}
|
||||
|
||||
void DolphinMainWindow::slotWheelMoved(int wheeldelta)
|
||||
{
|
||||
if (wheeldelta > 0)
|
||||
{
|
||||
//Non-negative, wheel is going forwards, so the tab goes backwards (focuses left)
|
||||
activatePrevTab();
|
||||
} else
|
||||
{
|
||||
activateNextTab();
|
||||
}
|
||||
}
|
||||
|
||||
void DolphinMainWindow::slotRequestItemInfo(const KFileItem& item)
|
||||
{
|
||||
emit requestItemInfo(item);
|
||||
|
@ -896,6 +908,9 @@ void DolphinMainWindow::init()
|
|||
this, SLOT(openNewTab()));
|
||||
connect(m_tabBar, SIGNAL(testCanDecode(const QDragMoveEvent*, bool&)),
|
||||
this, SLOT(slotTestCanDecode(const QDragMoveEvent*, bool&)));
|
||||
connect(m_tabBar, SIGNAL(wheelDelta(int)),
|
||||
this, SLOT(slotWheelMoved(int)));
|
||||
|
||||
m_tabBar->blockSignals(true); // signals get unblocked after at least 2 tabs are open
|
||||
|
||||
QWidget* centralWidget = new QWidget(this);
|
||||
|
|
|
@ -282,6 +282,13 @@ private slots:
|
|||
*/
|
||||
void slotSelectionChanged(const KFileItemList& selection);
|
||||
|
||||
/**
|
||||
* Wheel event, receives it's degree of movement (int).
|
||||
* we look to see if it's negative (backwards) or positive (forwards).
|
||||
* Enables changing of tabs via mouse wheel.
|
||||
*/
|
||||
void slotWheelMoved(int wheeldelta);
|
||||
|
||||
/** Emits the signal requestItemInfo(). */
|
||||
void slotRequestItemInfo(const KFileItem&);
|
||||
|
||||
|
@ -342,6 +349,7 @@ private slots:
|
|||
*/
|
||||
void closeTab(int index);
|
||||
|
||||
|
||||
/**
|
||||
* Opens a context menu for the tab with the index \a index
|
||||
* on the position \a pos.
|
||||
|
|
Loading…
Reference in a new issue