Skip to content

Commit

Permalink
Make fonts and icons appear correct when 'dark status bar' mode
Browse files Browse the repository at this point in the history
  • Loading branch information
whomwah committed Jan 19, 2016
1 parent 13e7270 commit 849cb25
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions app/_views/nowplaying_view.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ def update_data!

def draw_title_box
NSTextField.new.tap do |v|
v.setFont(NSFont.systemFontOfSize(12.0))
v.setEditable(false)
v.setBezeled(false)
v.setDrawsBackground(false)
Expand All @@ -130,12 +131,12 @@ def draw_title_box
NSLayoutPriorityDefaultLow,
forOrientation:NSLayoutConstraintOrientationHorizontal
)
v.cell.setBackgroundStyle(NSBackgroundStyleRaised)
end
end

def draw_artist_box
NSTextField.new.tap do |v|
v.setFont(NSFont.systemFontOfSize(10.0))
v.setEditable(false)
v.setBezeled(false)
v.setDrawsBackground(false)
Expand All @@ -145,12 +146,12 @@ def draw_artist_box
NSLayoutPriorityDefaultLow,
forOrientation:NSLayoutConstraintOrientationHorizontal
)
v.cell.setBackgroundStyle(NSBackgroundStyleRaised)
end
end

def draw_album_box
NSTextField.new.tap do |v|
v.setFont(NSFont.systemFontOfSize(9.0))
v.setEditable(false)
v.setBezeled(false)
v.setDrawsBackground(false)
Expand All @@ -160,7 +161,6 @@ def draw_album_box
NSLayoutPriorityDefaultLow,
forOrientation:NSLayoutConstraintOrientationHorizontal
)
v.cell.setBackgroundStyle(NSBackgroundStyleRaised)
end
end

Expand All @@ -170,6 +170,7 @@ def draw_image_box

def draw_addedby_box
NSTextField.new.tap do |v|
v.setFont(NSFont.systemFontOfSize(8.0))
v.setEditable(false)
v.setBezeled(false)
v.setDrawsBackground(false)
Expand All @@ -179,7 +180,6 @@ def draw_addedby_box
NSLayoutPriorityDefaultLow,
forOrientation:NSLayoutConstraintOrientationHorizontal
)
v.cell.setBackgroundStyle(NSBackgroundStyleRaised)
end
end

Expand All @@ -188,8 +188,6 @@ def update_title
paragraph.setLineBreakMode(NSLineBreakByTruncatingTail)

txt = track.title.attrd({
'NSFont' => NSFont.systemFontOfSize(12.0),
'NSColor' => NSColor.blackColor,
'NSParagraphStyle' => paragraph
}) unless track.title.nil?
@title.setAttributedStringValue(txt)
Expand All @@ -201,8 +199,6 @@ def update_artist
paragraph.setLineBreakMode(NSLineBreakByTruncatingTail)

txt = track.artist.attrd({
'NSFont' => NSFont.systemFontOfSize(10.0),
'NSColor' => NSColor.blackColor,
'NSParagraphStyle' => paragraph
}) unless track.artist.nil?
@artist.setAttributedStringValue(txt)
Expand All @@ -215,8 +211,6 @@ def update_album
paragraph.setLineBreakMode(NSLineBreakByTruncatingTail)

txt = track.album.attrd({
'NSFont' => NSFont.systemFontOfSize(9.0),
'NSColor' => NSColor.blackColor,
'NSParagraphStyle' => paragraph
}) unless track.album.nil?
@album.setAttributedStringValue(txt)
Expand All @@ -229,8 +223,6 @@ def update_addedby
paragraph.setLineBreakMode(NSLineBreakByTruncatingTail)

txt = "#{CHOSEN_BY_TXT} #{track.added_by}".attrd({
'NSFont' => NSFont.systemFontOfSize(8.0),
'NSColor' => NSColor.blackColor,
'NSParagraphStyle' => paragraph
}) unless track.added_by.nil?
@addedby.setAttributedStringValue(txt)
Expand Down

0 comments on commit 849cb25

Please sign in to comment.