MediaPlayer: playlist uses system colors.

* Partialy fix #10840.
This commit is contained in:
Janus 2015-05-06 18:59:24 +02:00
parent d54a4f43cc
commit 7a2aced4bf
2 changed files with 22 additions and 14 deletions

View File

@ -58,7 +58,10 @@ SimpleItem::Draw(BView *owner, BRect frame, uint32 flags)
{ {
DrawBackground(owner, frame, flags); DrawBackground(owner, frame, flags);
// label // label
owner->SetHighColor( 0, 0, 0, 255 ); if (IsSelected())
owner->SetHighColor(ui_color(B_LIST_SELECTED_ITEM_TEXT_COLOR));
else
owner->SetHighColor(ui_color(B_LIST_ITEM_TEXT_COLOR));
font_height fh; font_height fh;
owner->GetFontHeight( &fh ); owner->GetFontHeight( &fh );
const char* text = Text(); const char* text = Text();
@ -86,14 +89,16 @@ SimpleItem::DrawBackground(BView *owner, BRect frame, uint32 flags)
frame.InsetBy(1.0, 1.0); frame.InsetBy(1.0, 1.0);
} }
// figure out bg-color // figure out bg-color
rgb_color color = (rgb_color){ 255, 255, 255, 255 }; rgb_color color = ui_color(B_LIST_BACKGROUND_COLOR);
if (IsSelected())
color = ui_color(B_LIST_SELECTED_BACKGROUND_COLOR);
if ( flags & FLAGS_TINTED_LINE ) if ( flags & FLAGS_TINTED_LINE )
color = tint_color( color, 1.06 ); color = tint_color(color, 1.06);
// background // background
if ( IsSelected() ) owner->SetLowColor(color);
color = tint_color( color, B_DARKEN_2_TINT ); owner->FillRect(frame, B_SOLID_LOW);
owner->SetLowColor( color );
owner->FillRect( frame, B_SOLID_LOW );
} }
// DragSortableListView class // DragSortableListView class
@ -170,11 +175,11 @@ DragSortableListView::Draw( BRect updateRect )
} }
updateRect.top = r.bottom + 1.0; updateRect.top = r.bottom + 1.0;
if (updateRect.IsValid()) { if (updateRect.IsValid()) {
SetLowColor(255, 255, 255, 255); SetLowColor(ui_color(B_LIST_BACKGROUND_COLOR));
FillRect(updateRect, B_SOLID_LOW); FillRect(updateRect, B_SOLID_LOW);
} }
} else { } else {
SetLowColor(255, 255, 255, 255); SetLowColor(ui_color(B_LIST_BACKGROUND_COLOR));
FillRect(updateRect, B_SOLID_LOW); FillRect(updateRect, B_SOLID_LOW);
} }
// drop anticipation indication // drop anticipation indication

View File

@ -103,17 +103,20 @@ void
PlaylistListView::Item::Draw(BView* owner, BRect frame, const font_height& fh, PlaylistListView::Item::Draw(BView* owner, BRect frame, const font_height& fh,
bool tintedLine, uint32 mode, bool active, uint32 playbackState) bool tintedLine, uint32 mode, bool active, uint32 playbackState)
{ {
rgb_color color = (rgb_color){ 255, 255, 255, 255 }; rgb_color color = ui_color(B_LIST_BACKGROUND_COLOR);
if (IsSelected())
color = ui_color(B_LIST_SELECTED_BACKGROUND_COLOR);
if (tintedLine) if (tintedLine)
color = tint_color(color, 1.04); color = tint_color(color, 1.04);
// background // background
if (IsSelected())
color = tint_color(color, B_DARKEN_2_TINT);
owner->SetLowColor(color); owner->SetLowColor(color);
owner->FillRect(frame, B_SOLID_LOW); owner->FillRect(frame, B_SOLID_LOW);
// label // label
rgb_color black = (rgb_color){ 0, 0, 0, 255 }; if (IsSelected())
owner->SetHighColor(black); owner->SetHighColor(ui_color(B_LIST_SELECTED_ITEM_TEXT_COLOR));
else
owner->SetHighColor(ui_color(B_LIST_ITEM_TEXT_COLOR));
const char* text = Text(); const char* text = Text();
switch (mode) { switch (mode) {
case DISPLAY_NAME: case DISPLAY_NAME: