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);
// 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;
owner->GetFontHeight( &fh );
const char* text = Text();
@ -86,14 +89,16 @@ SimpleItem::DrawBackground(BView *owner, BRect frame, uint32 flags)
frame.InsetBy(1.0, 1.0);
}
// 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 )
color = tint_color( color, 1.06 );
color = tint_color(color, 1.06);
// background
if ( IsSelected() )
color = tint_color( color, B_DARKEN_2_TINT );
owner->SetLowColor( color );
owner->FillRect( frame, B_SOLID_LOW );
owner->SetLowColor(color);
owner->FillRect(frame, B_SOLID_LOW);
}
// DragSortableListView class
@ -170,11 +175,11 @@ DragSortableListView::Draw( BRect updateRect )
}
updateRect.top = r.bottom + 1.0;
if (updateRect.IsValid()) {
SetLowColor(255, 255, 255, 255);
SetLowColor(ui_color(B_LIST_BACKGROUND_COLOR));
FillRect(updateRect, B_SOLID_LOW);
}
} else {
SetLowColor(255, 255, 255, 255);
SetLowColor(ui_color(B_LIST_BACKGROUND_COLOR));
FillRect(updateRect, B_SOLID_LOW);
}
// drop anticipation indication

View File

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