Printers: avoid redraw glitches in the listview.
Fixes #11917. Signed-off-by: Augustin Cavalier <[email protected]>
This commit is contained in:
@@ -272,14 +272,12 @@ JobItem::DrawItem(BView *owner, BRect, bool complete)
|
||||
BRect bounds = list->ItemFrame(list->IndexOf(this));
|
||||
|
||||
rgb_color color = owner->ViewColor();
|
||||
rgb_color oldViewColor = color;
|
||||
rgb_color oldLowColor = owner->LowColor();
|
||||
rgb_color oldHighColor = owner->HighColor();
|
||||
|
||||
if (IsSelected())
|
||||
color = tint_color(color, B_HIGHLIGHT_BACKGROUND_TINT);
|
||||
|
||||
owner->SetViewColor(color);
|
||||
owner->SetHighColor(color);
|
||||
owner->SetLowColor(color);
|
||||
|
||||
@@ -321,6 +319,5 @@ JobItem::DrawItem(BView *owner, BRect, bool complete)
|
||||
owner->DrawString(fSize.String(), fSize.Length(), sizePt);
|
||||
|
||||
owner->SetDrawingMode(mode);
|
||||
owner->SetViewColor(oldViewColor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -384,14 +384,12 @@ PrinterItem::DrawItem(BView *owner, BRect /*bounds*/, bool complete)
|
||||
BRect bounds = list->ItemFrame(list->IndexOf(this));
|
||||
|
||||
rgb_color color = owner->ViewColor();
|
||||
rgb_color oldViewColor = color;
|
||||
rgb_color oldLowColor = owner->LowColor();
|
||||
rgb_color oldHighColor = owner->HighColor();
|
||||
|
||||
if (IsSelected())
|
||||
color = tint_color(color, B_HIGHLIGHT_BACKGROUND_TINT);
|
||||
|
||||
owner->SetViewColor(color);
|
||||
owner->SetLowColor(color);
|
||||
owner->SetHighColor(color);
|
||||
|
||||
@@ -473,7 +471,6 @@ PrinterItem::DrawItem(BView *owner, BRect /*bounds*/, bool complete)
|
||||
owner->DrawString(s.String(), s.Length(), commentPt);
|
||||
|
||||
owner->SetDrawingMode(mode);
|
||||
owner->SetViewColor(oldViewColor);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user