mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 01:22:10 +01:00
Vertical tabs: Draw unloaded tabs with "Disabled" color palette
Summary: BUG: 405833 Reviewers: #falkon Subscribers: falkon Tags: #falkon Differential Revision: https://phabricator.kde.org/D21548
This commit is contained in:
parent
a8ac59dc55
commit
4b85dab3d7
|
@ -148,6 +148,7 @@ void TabTreeDelegate::paint(QPainter *painter, const QStyleOptionViewItem &optio
|
||||||
const bool expanded = m_view->isExpanded(index);
|
const bool expanded = m_view->isExpanded(index);
|
||||||
const bool children = m_view->model()->rowCount(index) > 0;
|
const bool children = m_view->model()->rowCount(index) > 0;
|
||||||
const int depth = indexDepth(index);
|
const int depth = indexDepth(index);
|
||||||
|
const bool isRestoredTab = index.data(TabModel::RestoredRole).toBool();
|
||||||
|
|
||||||
QStyleOptionViewItem opt = option;
|
QStyleOptionViewItem opt = option;
|
||||||
initStyleOption(&opt, index);
|
initStyleOption(&opt, index);
|
||||||
|
@ -162,6 +163,9 @@ void TabTreeDelegate::paint(QPainter *painter, const QStyleOptionViewItem &optio
|
||||||
const QPalette::ColorRole colorRole = opt.state & QStyle::State_Selected ? QPalette::HighlightedText : QPalette::Text;
|
const QPalette::ColorRole colorRole = opt.state & QStyle::State_Selected ? QPalette::HighlightedText : QPalette::Text;
|
||||||
|
|
||||||
QPalette::ColorGroup cg = opt.state & QStyle::State_Enabled ? QPalette::Normal : QPalette::Disabled;
|
QPalette::ColorGroup cg = opt.state & QStyle::State_Enabled ? QPalette::Normal : QPalette::Disabled;
|
||||||
|
if (!isRestoredTab) {
|
||||||
|
cg = QPalette::Disabled;
|
||||||
|
}
|
||||||
if (cg == QPalette::Normal && !(opt.state & QStyle::State_Active)) {
|
if (cg == QPalette::Normal && !(opt.state & QStyle::State_Active)) {
|
||||||
cg = QPalette::Inactive;
|
cg = QPalette::Inactive;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user