mirror of https://github.com/KLayout/klayout.git
Enhanced styling of expander icon in tree view
Now it's compatible with the different selection styles (some include the decoration, some don't)
This commit is contained in:
parent
e06224e00d
commit
fea965a321
|
|
@ -59,14 +59,14 @@ BackgroundAwareTreeStyle::drawPrimitive (QStyle::PrimitiveElement pe, const QSty
|
|||
cg = QPalette::Inactive;
|
||||
}
|
||||
}
|
||||
if (opt->state & State_Selected) {
|
||||
if ((opt->state & State_Selected) && styleHint(QStyle::SH_ItemView_ShowDecorationSelected, opt, w)) {
|
||||
c = opt->palette.color (cg, QPalette::HighlightedText);
|
||||
} else {
|
||||
c = opt->palette.color (cg, QPalette::Text);
|
||||
}
|
||||
if (! (opt->state & State_MouseOver)) {
|
||||
if (c.green () < 128) {
|
||||
c = QColor ((c.red () * 3 + 255) / 4, (c.green () * 3 + 255) / 4, (c.blue () * 3 + 255) / 4);
|
||||
c = QColor ((c.red () * 2 + 255) / 3, (c.green () * 2 + 255) / 3, (c.blue () * 2 + 255) / 3);
|
||||
} else {
|
||||
c = QColor ((c.red () * 8) / 9, (c.green () * 8) / 9, (c.blue () * 8) / 9);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue