1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 18:56:34 +01:00

TabBar: Disable greying out not restored tabs

It doesn't really work with some themes and there doesn't seem
to be easy way to make the text always clearly visible.
This commit is contained in:
David Rosca 2018-01-08 11:07:01 +01:00
parent 7adda247dc
commit 6a48f4d862
3 changed files with 0 additions and 32 deletions

View File

@ -381,20 +381,6 @@ void TabBar::currentTabChanged(int index)
m_tabWidget->currentTabChanged(index); m_tabWidget->currentTabChanged(index);
} }
void TabBar::overrideTabTextColor(int index, QColor color)
{
if (!m_originalTabTextColor.isValid()) {
m_originalTabTextColor = tabTextColor(index);
}
setTabTextColor(index, color);
}
void TabBar::restoreTabTextColor(int index)
{
setTabTextColor(index, m_originalTabTextColor);
}
void TabBar::setTabText(int index, const QString &text) void TabBar::setTabText(int index, const QString &text)
{ {
QString tabText = text; QString tabText = text;

View File

@ -38,9 +38,6 @@ public:
void setVisible(bool visible); void setVisible(bool visible);
void setForceHidden(bool hidden); void setForceHidden(bool hidden);
void overrideTabTextColor(int index, QColor color);
void restoreTabTextColor(int index);
void setTabText(int index, const QString &text); void setTabText(int index, const QString &text);
void wheelEvent(QWheelEvent* event); void wheelEvent(QWheelEvent* event);
@ -88,7 +85,6 @@ private:
mutable int m_normalTabWidth; mutable int m_normalTabWidth;
mutable int m_activeTabWidth; mutable int m_activeTabWidth;
QColor m_originalTabTextColor;
QPoint m_dragStartPosition; QPoint m_dragStartPosition;
bool m_forceHidden; bool m_forceHidden;

View File

@ -380,19 +380,6 @@ void WebTab::restoreTab(const WebTab::SavedTab &tab)
m_tabBar->setTabText(index, tab.title); m_tabBar->setTabText(index, tab.title);
m_locationBar->showUrl(tab.url); m_locationBar->showUrl(tab.url);
m_tabIcon->updateIcon(); m_tabIcon->updateIcon();
if (!tab.url.isEmpty()) {
QColor col = m_tabBar->palette().text().color();
QColor newCol = col.lighter(250);
// It won't work for black color because (V) = 0
// It won't also work for white, as white won't get any lighter
if (col == Qt::black || col == Qt::white) {
newCol = Qt::gray;
}
m_tabBar->overrideTabTextColor(index, newCol);
}
} }
else { else {
// This is called only on restore session and restoring tabs immediately // This is called only on restore session and restoring tabs immediately
@ -471,7 +458,6 @@ void WebTab::slotRestore()
} }
p_restoreTab(m_savedTab); p_restoreTab(m_savedTab);
m_tabBar->restoreTabTextColor(tabIndex());
m_savedTab.clear(); m_savedTab.clear();
} }