mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 09:32:12 +01:00
[ComboTabBar] Correctly set height of pinned tabbar
Both tabbars will now have the same height. This commit fixes incorrect drawing of line under pinned tabs when moving tabs with Oxygen theme. Also removed unused maxVisiblePinnedTabs property
This commit is contained in:
parent
3d2f2ff8fb
commit
47496501eb
|
@ -41,7 +41,6 @@ ComboTabBar::ComboTabBar(QWidget* parent)
|
|||
: QWidget(parent)
|
||||
, m_mainTabBar(0)
|
||||
, m_pinnedTabBar(0)
|
||||
, m_maxVisiblePinnedTab(0)
|
||||
, m_mainBarOverFlowed(false)
|
||||
, m_dragOffset(0)
|
||||
, m_usesScrollButtons(false)
|
||||
|
@ -457,12 +456,6 @@ bool ComboTabBar::isPinned(int index) const
|
|||
return index >= 0 && index < pinnedTabsCount();
|
||||
}
|
||||
|
||||
void ComboTabBar::setMaxVisiblePinnedTab(int max)
|
||||
{
|
||||
m_maxVisiblePinnedTab = max;
|
||||
setMinimumWidths();
|
||||
}
|
||||
|
||||
void ComboTabBar::setObjectName(const QString &name)
|
||||
{
|
||||
m_mainTabBar->setObjectName(name);
|
||||
|
@ -505,6 +498,11 @@ void ComboTabBar::setUpLayout()
|
|||
m_pinnedTabBarWidget->setUpLayout();
|
||||
|
||||
setMinimumWidths();
|
||||
|
||||
if (isVisible()) {
|
||||
// ComboTabBar is now visible, we can sync heights of both tabbars
|
||||
m_pinnedTabBar->setFixedHeight(m_mainTabBar->height());
|
||||
}
|
||||
}
|
||||
|
||||
void ComboTabBar::insertCloseButton(int index)
|
||||
|
@ -744,11 +742,6 @@ void ComboTabBar::setMinimumWidths()
|
|||
|
||||
int pinnedTabBarWidth = pinnedTabsCount() * comboTabBarPixelMetric(PinnedTabWidth);
|
||||
m_pinnedTabBar->setMinimumWidth(pinnedTabBarWidth);
|
||||
|
||||
if (m_maxVisiblePinnedTab > 0) {
|
||||
pinnedTabBarWidth = qMin(pinnedTabBarWidth, m_maxVisiblePinnedTab * comboTabBarPixelMetric(PinnedTabWidth));
|
||||
}
|
||||
|
||||
m_pinnedTabBarWidget->setMaximumWidth(pinnedTabBarWidth);
|
||||
|
||||
int mainTabBarWidth = comboTabBarPixelMetric(NormalTabMinimumWidth) * (m_mainTabBar->count() - 1) +
|
||||
|
|
|
@ -171,7 +171,6 @@ private:
|
|||
TabBarScrollWidget* m_mainTabBarWidget;
|
||||
TabBarScrollWidget* m_pinnedTabBarWidget;
|
||||
|
||||
int m_maxVisiblePinnedTab;
|
||||
QString m_closeButtonsToolTip;
|
||||
bool m_mainBarOverFlowed;
|
||||
int m_dragOffset;
|
||||
|
|
|
@ -78,7 +78,6 @@ TabBar::TabBar(QupZilla* mainClass, TabWidget* tabWidget)
|
|||
// ComboTabBar features
|
||||
setUsesScrollButtons(true);
|
||||
setCloseButtonsToolTip(QupZilla::tr("Close Tab"));
|
||||
setMaxVisiblePinnedTab(0);
|
||||
connect(this, SIGNAL(overFlowChanged(bool)), this, SLOT(overFlowChange(bool)));
|
||||
connect(this, SIGNAL(scrollBarValueChanged(int)), this, SLOT(hideTabPreview()));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user