A fix I did for the focus line being drawn outside item boundaries resulted in the item selection rectangle being "cut off" by the focus line. The selection rectangle is enough of an indication anyway.
Details
- Reviewers
hpereiradacosta fvogt - Group Reviewers
Plasma - Commits
- R31:89b916039387: Don't draw focus line on selected list item
Before
After
Focus line still shown when the item is not selected:
Especially noticeable in KInfoCenter where there's a tree list and only the label is underlined but not the icon, resulting in an uneven "cut".
Diff Detail
- Repository
- R31 Breeze
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
kstyle/breezestyle.cpp | ||
---|---|---|
3082 | Not sure which one is the most efficient: |
kstyle/breezestyle.cpp | ||
---|---|---|
3082 | From what I can tell the difference is negligible. qobject_cast goes through QMetaObject::cast which then calls inherits internally, so I'd say inherits is the better choice. I didn't benchmark, though. I just followed what the rest of the code around it was doing (inherits) |
kstyle/breezestyle.cpp | ||
---|---|---|
3082 | Code uses both actually (usually qobject_cast for "public" classes, from Qt, and inherits for "private" classes, or kde). |
kstyle/breezestyle.cpp | ||
---|---|---|
3082 | Of course inherits(QString) is slower than qobject_cast<>. The only reason to use inherits() is when you do not link to the library that the class defines. |
kstyle/breezestyle.cpp | ||
---|---|---|
3082 | Also order to make the fastest test come first. if ((state & State_Selected) && qobject_cast<QAbstractItemView *>(widget)) |