https://bugs.kde.org/show_bug.cgi?id=436803

David Edmundson <k...@davidedmundson.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED
      Latest Commit|                            |https://invent.kde.org/plas
                   |                            |ma/plasma-systemmonitor/com
                   |                            |mit/05ca503aa63e579d1b5d774
                   |                            |e90d945d8e0433993

--- Comment #6 from David Edmundson <k...@davidedmundson.co.uk> ---
Git commit 05ca503aa63e579d1b5d774e90d945d8e0433993 by David Edmundson.
Committed on 17/05/2021 at 10:02.
Pushed by davidedmundson into branch 'master'.

Fix flickering in table view

We have a list of delegates:

Whenever we get a layoutChange signal (from a re-order), table view
recycles all of them. Every binding, text and value changes.

Our backgrounds have two rectangles:

    One does a white or grey line:
```
color: (row % 2 == 0) ? Kirigami.Theme.backgroundColor :
Kirigami.Theme.alternateBackgroundColor
```

    One draws the highlight:
```
        color: Kirigami.Theme.backgroundColor
        Kirigami.Theme.inherit: false
        Kirigami.Theme.colorSet: Kirigami.Theme.Selection
        opacity: selected ? 1: 0
```

That's all well and good, but we don't want the text to be black on
blue, so there's some code here that handles this in the parent item of
the cell background.

```
        Kirigami.Theme.colorSet: background.selected ?
Kirigami.Theme.Selection : Kirigami.Theme.View
        Kirigami.Theme.inherit: false
```

A noticable quirk there is that our background to draw the white and
grey alternating rows actually draws a blue background because it
inherits the selected colourSet from our parent Kirigami.Theme. That is
marked as being "Selection" not "View"

Why does that cause a problem?

After a reshuffle what happens is:

 - All bindings update, Qt does everything perfectly

 - The colours in the real highlight update on time

- The colours in the background are delayed because they come from the
parent ColorSet

- Kirigami theme propagation has some "event compression" before
propagating to children. IMHO this is a Kirigami bug.

- The old selected item which is now some random item renders a blue
highlight where it should be rendering the white or grey background.

This patch moves logic for the selection colour into rectangle for
drawing the main background, whic also means we explicitly set a
Kirigami.ColorSet there.

This also helps differentiate highlighted + vs highlighted + mouse over
which brings it more in line with the desktop.

M  +5    -2    src/table/CellBackground.qml

https://invent.kde.org/plasma/plasma-systemmonitor/commit/05ca503aa63e579d1b5d774e90d945d8e0433993

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to