Skip to content
Commit cdf79566 authored by Anton Anikin's avatar Anton Anikin
Browse files

Fix progress bar color

Summary:
The patch fixes progress bar color which now is always `QPalette::Highlight`. This leads to invisible bar contents for selected view items when we use `QStyleOptionProgressBar` inside item delegates. New version fixes this issue with setting `QPalette::Window` color if current state has `QStyle::State_Selected` flag.

Old version:
{F780631}
{F780630}

New version:
with `QPalette::Window`
{F780638}
with `QPalette::HighlightedText`
{F2673473}
with `QPalette::Window`
{F780637}
with `QPalette::HighlightedText`
{F2673474}

Delegate code should set correct state:

```
void MyDelegate::paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const
{
    // ...
    QStyleOptionProgressBar progressBarOption;
    progressBarOption.state = option.state;
   // ...
}
```

Test Plan: Tested on linux system (Arch x86_64) with Qt 5.7.0

Reviewers: #breeze, hpereiradacosta

Reviewed By: hpereiradacosta

Subscribers: plasma-devel, andreaska

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D3697
parent 9aa6c2c0
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment