[haiku-commits] haiku: hrev49145 - src/apps/mediaplayer/playlist

  • From: janus2@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 6 May 2015 19:00:44 +0200 (CEST)

hrev49145 adds 1 changeset to branch 'master'
old head: d54a4f43ccb59bb0b9d5cc980e9cb7b2dab5a322
new head: 7a2aced4bf90077da27c88763d9fdd1bcce0ac84
overview:
http://cgit.haiku-os.org/haiku/log/?qt=range&q=7a2aced4bf90+%5Ed54a4f43ccb5

----------------------------------------------------------------------------

7a2aced4bf90: MediaPlayer: playlist uses system colors.

* Partialy fix #10840.

[ Janus <janus2@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision: hrev49145
Commit: 7a2aced4bf90077da27c88763d9fdd1bcce0ac84
URL: http://cgit.haiku-os.org/haiku/commit/?id=7a2aced4bf90
Author: Janus <janus2@xxxxxxxxx>
Date: Wed May 6 16:59:24 2015 UTC

Ticket: https://dev.haiku-os.org/ticket/10840

----------------------------------------------------------------------------

2 files changed, 22 insertions(+), 14 deletions(-)
src/apps/mediaplayer/playlist/ListViews.cpp | 23 ++++++++++++--------
.../mediaplayer/playlist/PlaylistListView.cpp | 13 ++++++-----

----------------------------------------------------------------------------

diff --git a/src/apps/mediaplayer/playlist/ListViews.cpp
b/src/apps/mediaplayer/playlist/ListViews.cpp
index 032ffea..514022d 100644
--- a/src/apps/mediaplayer/playlist/ListViews.cpp
+++ b/src/apps/mediaplayer/playlist/ListViews.cpp
@@ -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
diff --git a/src/apps/mediaplayer/playlist/PlaylistListView.cpp
b/src/apps/mediaplayer/playlist/PlaylistListView.cpp
index 940b5a2..ba55181 100644
--- a/src/apps/mediaplayer/playlist/PlaylistListView.cpp
+++ b/src/apps/mediaplayer/playlist/PlaylistListView.cpp
@@ -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:


Other related posts:

  • » [haiku-commits] haiku: hrev49145 - src/apps/mediaplayer/playlist - janus2