1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 01:22:10 +01:00

[TabBar] Don't show tab previews while dragging tabs

This commit is contained in:
nowrep 2014-02-13 15:42:25 +01:00
parent 3ec9e0b893
commit 6a4a41a5d9
3 changed files with 14 additions and 3 deletions

View File

@ -42,7 +42,6 @@ ComboTabBar::ComboTabBar(QWidget* parent)
, m_mainTabBar(0)
, m_pinnedTabBar(0)
, m_mainBarOverFlowed(false)
, m_dragOffset(0)
, m_usesScrollButtons(false)
{
m_mainTabBar = new TabBarHelper(this);
@ -665,6 +664,11 @@ void ComboTabBar::setUsesScrollButtons(bool useButtons)
m_mainTabBarWidget->setUsesScrollButtons(useButtons);
}
bool ComboTabBar::isDragInProgress() const
{
return m_mainTabBar->isDragInProgress() || m_pinnedTabBar->isDragInProgress();
}
void ComboTabBar::addMainBarWidget(QWidget* widget, Qt::Alignment align, int stretch, Qt::Alignment layoutAlignment)
{
if (align == Qt::AlignRight) {
@ -889,6 +893,11 @@ bool TabBarHelper::isDisplayedOnViewPort(int globalLeft, int globalRight)
return isVisible;
}
bool TabBarHelper::isDragInProgress() const
{
return m_dragInProgress;
}
void TabBarHelper::enableBluredBackground(bool enable)
{
if (enable != m_bluredBackground) {

View File

@ -128,6 +128,7 @@ public:
bool usesScrollButtons() const;
void setUsesScrollButtons(bool useButtons);
bool isDragInProgress() const;
void addMainBarWidget(QWidget* widget, Qt::Alignment align, int stretch = 0, Qt::Alignment layoutAlignment = 0);
public slots:
@ -176,7 +177,6 @@ private:
QString m_closeButtonsToolTip;
bool m_mainBarOverFlowed;
int m_dragOffset;
bool m_usesScrollButtons;
signals:
@ -206,7 +206,9 @@ public:
void setScrollArea(QScrollArea* scrollArea);
void useFastTabSizeHint(bool enabled);
bool isDisplayedOnViewPort(int globalLeft, int globalRight);
bool isDragInProgress() const;
void enableBluredBackground(bool enable);
public slots:

View File

@ -654,7 +654,7 @@ bool TabBar::event(QEvent* event)
{
switch (event->type()) {
case QEvent::ToolTip:
if (!m_showTabPreviews) {
if (!m_showTabPreviews && !isDragInProgress()) {
QHelpEvent* ev = static_cast<QHelpEvent*>(event);
int index = tabAt(ev->pos());