Skip to content

Commit

Permalink
MediaPlayer: playlist uses system colors.
Browse files Browse the repository at this point in the history
* Partialy fix #10840.
  • Loading branch information
janus2 committed May 6, 2015
1 parent d54a4f4 commit 7a2aced
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
23 changes: 14 additions & 9 deletions src/apps/mediaplayer/playlist/ListViews.cpp
Expand Up @@ -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();
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
13 changes: 8 additions & 5 deletions src/apps/mediaplayer/playlist/PlaylistListView.cpp
Expand Up @@ -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:
Expand Down

0 comments on commit 7a2aced

Please sign in to comment.