Revert "Work-around unfocused item vew colours with Kantum"
This reverts commit 526c662dff.
This commit is contained in:
@@ -136,14 +136,6 @@ public:
|
||||
cg = QPalette::Inactive;
|
||||
}
|
||||
|
||||
#ifdef Q_OS_LINUX
|
||||
if (QPalette::Inactive==cg && option.state & QStyle::State_Enabled && parent() && qobject_cast<QWidget *>(parent())) {
|
||||
QWidget *pw=static_cast<QWidget *>(parent());
|
||||
if (pw->topLevelWidget() && pw->topLevelWidget()->isActiveWindow()) {
|
||||
cg = QPalette::Normal;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
QStyleOptionViewItem opt(option);
|
||||
opt.showDecorationSelected = true;
|
||||
QStyle *style = opt.widget ? opt.widget->style() : QApplication::style();
|
||||
|
||||
@@ -323,15 +323,7 @@ void GroupedViewDelegate::paint(QPainter *painter, const QStyleOptionViewItem &o
|
||||
#ifdef Q_OS_WIN
|
||||
QColor textColor(option.palette.color(QPalette::Text));
|
||||
#else
|
||||
|
||||
bool active = option.state&QStyle::State_Active;
|
||||
#ifdef Q_OS_LINUX
|
||||
if (!active && view && view->topLevelWidget() && view->topLevelWidget()->isActiveWindow()) {
|
||||
active=true;
|
||||
}
|
||||
#endif
|
||||
|
||||
QColor textColor(option.palette.color(active ? QPalette::Active : QPalette::Inactive, option.state&QStyle::State_Selected ? QPalette::HighlightedText : QPalette::Text));
|
||||
QColor textColor(option.palette.color(option.state&QStyle::State_Selected ? QPalette::HighlightedText : QPalette::Text));
|
||||
#endif
|
||||
QTextOption textOpt(Qt::AlignVCenter);
|
||||
QRect r(option.rect.adjusted(constBorder+4, constBorder, -(constBorder+4), -constBorder));
|
||||
|
||||
@@ -179,11 +179,6 @@ public:
|
||||
bool gtk=mouseOver && GtkStyle::isActive();
|
||||
bool selected=option.state&QStyle::State_Selected;
|
||||
bool active=option.state&QStyle::State_Active;
|
||||
#ifdef Q_OS_LINUX
|
||||
if (!active && itemView() && itemView()->topLevelWidget() && itemView()->topLevelWidget()->isActiveWindow()) {
|
||||
active=true;
|
||||
}
|
||||
#endif
|
||||
bool drawBgnd=true;
|
||||
bool iconMode = view && QListView::IconMode==view->viewMode();
|
||||
QStyleOptionViewItem opt(option);
|
||||
@@ -441,11 +436,6 @@ public:
|
||||
bool rtl = QApplication::isRightToLeft();
|
||||
bool selected=option.state&QStyle::State_Selected;
|
||||
bool active=option.state&QStyle::State_Active;
|
||||
#ifdef Q_OS_LINUX
|
||||
if (!active && itemView() && itemView()->topLevelWidget() && itemView()->topLevelWidget()->isActiveWindow()) {
|
||||
active=true;
|
||||
}
|
||||
#endif
|
||||
bool mouseOver=underMouse && option.state&QStyle::State_MouseOver;
|
||||
#ifdef Q_OS_WIN
|
||||
QColor textColor(option.palette.color(active ? QPalette::Active : QPalette::Inactive, QPalette::Text));
|
||||
|
||||
Reference in New Issue
Block a user