From 849cb2580aaef752779c39ce8881cc8a34142a99 Mon Sep 17 00:00:00 2001 From: Duncan Robertson Date: Tue, 19 Jan 2016 11:03:09 +0000 Subject: [PATCH] Make fonts and icons appear correct when 'dark status bar' mode --- app/_views/nowplaying_view.rb | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/app/_views/nowplaying_view.rb b/app/_views/nowplaying_view.rb index 41bfdc4..7bef0db 100644 --- a/app/_views/nowplaying_view.rb +++ b/app/_views/nowplaying_view.rb @@ -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) @@ -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) @@ -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) @@ -160,7 +161,6 @@ def draw_album_box NSLayoutPriorityDefaultLow, forOrientation:NSLayoutConstraintOrientationHorizontal ) - v.cell.setBackgroundStyle(NSBackgroundStyleRaised) end end @@ -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) @@ -179,7 +180,6 @@ def draw_addedby_box NSLayoutPriorityDefaultLow, forOrientation:NSLayoutConstraintOrientationHorizontal ) - v.cell.setBackgroundStyle(NSBackgroundStyleRaised) end end @@ -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) @@ -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) @@ -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) @@ -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)