[TabBar] Make sure adding new background tab make it visible in tabbar

remotes/origin/falkon
nowrep 12 years ago
parent 9fda55d86d
commit 9a6bb0444d
  1. 7
      src/lib/tools/combotabbar.cpp
  2. 19
      src/lib/tools/combotabbar.h
  3. 5
      src/lib/webview/tabwidget.cpp

@ -707,6 +707,11 @@ void ComboTabBar::tabRemoved(int index)
Q_UNUSED(index)
}
TabBarHelper* ComboTabBar::mainTabBar() const
{
return m_mainTabBar;
}
TabBarHelper* ComboTabBar::localTabBar(int index) const
{
if (index < 0 || index >= pinnedTabsCount()) {
@ -1289,7 +1294,7 @@ void TabBarScrollWidget::overFlowChanged(bool overflowed)
m_leftScrollButton->setVisible(overflowed && m_usesScrollButtons);
m_rightScrollButton->setVisible(overflowed && m_usesScrollButtons);
// a workaround for UI issue of buttons on very fast resizing
// Workaround for UI issue of buttons on very fast resizing
if (m_rightContainer->isVisible()) {
m_rightContainer->hide();
m_rightContainer->show();

@ -136,6 +136,13 @@ public slots:
void ensureVisible(int index = -1, int xmargin = -1);
void setCurrentIndex(int index);
signals:
void overFlowChanged(bool overFlow);
void currentChanged(int index);
void tabCloseRequested(int index);
void tabMoved(int from, int to);
void scrollBarValueChanged(int value);
private slots:
void setMinimumWidths();
void slotCurrentChanged(int index);
@ -147,6 +154,7 @@ private slots:
protected:
int mainTabBarWidth() const;
int pinTabBarWidth() const;
void wheelEvent(QWheelEvent* event);
void showEvent(QShowEvent* event);
void enterEvent(QEvent* event);
@ -160,10 +168,10 @@ protected:
virtual void tabRemoved(int index);
private:
TabBarHelper* mainTabBar() const;
TabBarHelper* localTabBar(int index = -1) const;
int toLocalIndex(int globalIndex) const;
inline TabBarHelper* mainTabBar() { return m_mainTabBar; }
int toLocalIndex(int globalIndex) const;
void updatePinnedTabBarVisibility();
QHBoxLayout* m_mainLayout;
@ -177,13 +185,6 @@ private:
QString m_closeButtonsToolTip;
bool m_mainBarOverFlowed;
bool m_usesScrollButtons;
signals:
void overFlowChanged(bool overFlow);
void currentChanged(int index);
void tabCloseRequested(int index);
void tabMoved(int from, int to);
void scrollBarValueChanged(int value);
};
class QUPZILLA_EXPORT TabBarHelper : public QTabBar

@ -410,6 +410,11 @@ int TabWidget::addView(QNetworkRequest req, const QString &title, const Qz::NewT
}
}
// Make sure user notice opening new background tabs
if (!(openFlags & Qz::NT_SelectedTab)) {
m_tabBar->ensureVisible(index);
}
setUpdatesEnabled(true);
emit changed();

Loading…
Cancel
Save