mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2025-01-24 05:22:06 +08:00
Improved tab bar scrolling (#678)
* Improved tab bar scrolling * Fix: tab bar scroll for mouse
This commit is contained in:
parent
f2378636e2
commit
1f21eb0200
@ -160,19 +160,9 @@ CDockAreaTabBar::~CDockAreaTabBar()
|
||||
//============================================================================
|
||||
void CDockAreaTabBar::wheelEvent(QWheelEvent* Event)
|
||||
{
|
||||
Event->accept();
|
||||
const int direction = Event->angleDelta().y();
|
||||
if (direction < 0)
|
||||
{
|
||||
horizontalScrollBar()->setValue(horizontalScrollBar()->value() + 20);
|
||||
}
|
||||
else
|
||||
{
|
||||
horizontalScrollBar()->setValue(horizontalScrollBar()->value() - 20);
|
||||
}
|
||||
QCoreApplication::sendEvent(horizontalScrollBar(), Event);
|
||||
}
|
||||
|
||||
|
||||
//============================================================================
|
||||
void CDockAreaTabBar::setCurrentIndex(int index)
|
||||
{
|
||||
@ -356,7 +346,7 @@ void CDockAreaTabBar::onCloseOtherTabsRequested()
|
||||
CDockWidget::DockWidgetDeleteOnClose) ? 1 : 0;
|
||||
closeTab(i);
|
||||
|
||||
// If the the dock widget blocks closing, i.e. if the flag
|
||||
// If the dock widget blocks closing, i.e. if the flag
|
||||
// CustomCloseHandling is set, and the dock widget is still open,
|
||||
// then we do not need to correct the index
|
||||
if (Tab->dockWidget()->isClosed())
|
||||
|
@ -67,7 +67,6 @@ private Q_SLOTS:
|
||||
protected:
|
||||
virtual void wheelEvent(QWheelEvent* Event) override;
|
||||
|
||||
|
||||
public:
|
||||
using Super = QScrollArea;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user