Skip to content

Commit

Permalink
Merge pull request #110 from martinfekete10/v1.6.5
Browse files Browse the repository at this point in the history
v1.6.5
  • Loading branch information
martinfekete10 authored Sep 26, 2024
2 parents b636168 + fcb8bdd commit ea0477a
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 66 deletions.
8 changes: 5 additions & 3 deletions Tuneful/ViewModels/StatusBarItemManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,17 @@ class StatusBarItemManager: ObservableObject {
// MARK: - Private

private func getStatusBarTrackInfo(track: Track, playerAppIsRunning: Bool, isPlaying: Bool) -> String {
let activePlayback = isPlaying && playerAppIsRunning

if self.showStatusBarTrackInfo == .never {
return ""
}

if self.showStatusBarTrackInfo == .whenPlaying && !isPlaying {
if self.showStatusBarTrackInfo == .whenPlaying && !activePlayback {
return ""
}

if !playerAppIsRunning {
if !playerAppIsRunning && !activePlayback {
return "Open \(connectedApp.rawValue)"
}

Expand Down Expand Up @@ -91,7 +93,7 @@ class StatusBarItemManager: ObservableObject {
}

private func getImage(albumArt: NSImage, playerAppIsRunning: Bool, isPlaying: Bool) -> AnyView {
if isPlaying && showEqWhenPlayingMusic {
if isPlaying && showEqWhenPlayingMusic && playerAppIsRunning {
if #available(macOS 13.0, *), statusBarIcon == .albumArt {
return AnyView(
Rectangle()
Expand Down
2 changes: 1 addition & 1 deletion Tuneful/Views/AudioSpectrumView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class AudioSpectrum: NSView {
barLayer.position = CGPoint(x: xPosition + barWidth / 2, y: totalHeight / 2)
barLayer.fillColor = NSColor.white.cgColor

let path = NSBezierPath(roundedRect: CGRect(x: 0, y: CGFloat.random(in: 0.5 ... 3.5), width: barWidth, height: totalHeight),
let path = NSBezierPath(roundedRect: CGRect(x: 0, y: 0, width: barWidth, height: totalHeight),
xRadius: barWidth / 2,
yRadius: barWidth / 2)
let cgPath = CGMutablePath()
Expand Down
2 changes: 1 addition & 1 deletion Tuneful/Views/Settings/KeyboardShortcutSettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import KeyboardShortcuts

struct KeyboardShortcutsSettingsView: View {
var body: some View {
Settings.Container(contentWidth: 400) {
Settings.Container(contentWidth: 350) {
Settings.Section(title: "") {
VStack(alignment: .center, content: {
Form {
Expand Down
4 changes: 2 additions & 2 deletions Tuneful/Views/Settings/MenuBarSettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ struct MenuBarSettingsView: View {
self.showMenuBarPlaybackControls = showMenuBarPlaybackControlsAppStorage
self.hideMenuBarItemWhenNotPlaying = hideMenuBarItemWhenNotPlayingAppStorage
self.scrollingTrackInfo = scrollingTrackInfoAppStorage
self.showEqWhenPlayingMusic = scrollingTrackInfoAppStorage
self.showEqWhenPlayingMusic = showEqWhenPlayingMusicAppStorage
}

var body: some View {
VStack {
Settings.Container(contentWidth: 400) {
Settings.Container(contentWidth: 450) {

Settings.Section(label: {
Text("Menu bar icon")
Expand Down
87 changes: 42 additions & 45 deletions Tuneful/Views/Settings/PopoverSettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,57 +31,54 @@ struct PopoverSettingsView: View {
}

var body: some View {
VStack {
Settings.Container(contentWidth: 400) {

Settings.Section(label: {
Text("Enable popover")
}) {
Toggle(isOn: $popoverIsEnabled) {
Text("")
}
.onChange(of: popoverIsEnabled) { _ in
self.popoverIsEnabledAppStorage = popoverIsEnabled
}
.toggleStyle(.switch)
Settings.Container(contentWidth: 350) {
Settings.Section(label: {
Text("Enable popover")
}) {
Toggle(isOn: $popoverIsEnabled) {
Text("")
}

Settings.Section(label: {
Text("Popover style")
.foregroundStyle(self.popoverIsEnabled ? .primary : .tertiary)
}) {
Picker(selection: $popoverType, label: Text("")) {
ForEach(PopoverType.allCases, id: \.self) { value in
Text(value.localizedName).tag(value)
}
}
.pickerStyle(.segmented)
.frame(width: 200)
.onChange(of: popoverType) { _ in
self.popoverTypeAppStorage = popoverType
NSApplication.shared.sendAction(#selector(AppDelegate.setupPopover), to: nil, from: nil)
}
.disabled(!popoverIsEnabled)
.onChange(of: popoverIsEnabled) { _ in
self.popoverIsEnabledAppStorage = popoverIsEnabled
}

Settings.Section(label: {
Text("Popover background")
.foregroundStyle(self.popoverIsEnabled ? .primary : .tertiary)
}) {
Picker("", selection: $popoverBackground) {
ForEach(BackgroundType.allCases, id: \.self) { value in
Text(value.localizedName).tag(value)
}
.toggleStyle(.switch)
}

Settings.Section(label: {
Text("Popover style")
.foregroundStyle(self.popoverIsEnabled ? .primary : .tertiary)
}) {
Picker(selection: $popoverType, label: Text("")) {
ForEach(PopoverType.allCases, id: \.self) { value in
Text(value.localizedName).tag(value)
}
.onChange(of: popoverBackground) { _ in
self.popoverBackgroundAppStorage = popoverBackground
}
.pickerStyle(.segmented)
.frame(width: 200)
.onChange(of: popoverType) { _ in
self.popoverTypeAppStorage = popoverType
NSApplication.shared.sendAction(#selector(AppDelegate.setupPopover), to: nil, from: nil)
}
.disabled(!popoverIsEnabled)
}

Settings.Section(label: {
Text("Popover background")
.foregroundStyle(self.popoverIsEnabled ? .primary : .tertiary)
}) {
Picker("", selection: $popoverBackground) {
ForEach(BackgroundType.allCases, id: \.self) { value in
Text(value.localizedName).tag(value)
}
.pickerStyle(.segmented)
.frame(width: 200)
.disabled(!popoverIsEnabled)
}

.onChange(of: popoverBackground) { _ in
self.popoverBackgroundAppStorage = popoverBackground
}
.pickerStyle(.segmented)
.frame(width: 200)
.disabled(!popoverIsEnabled)
}

}
}
}
Expand Down
30 changes: 16 additions & 14 deletions docs/Support/appcast.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@
<rss xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" version="2.0">
<channel>
<title>Tuneful</title>
<item>
<title>1.6.5</title>
<pubDate>Thu, 26 Sep 2024 18:08:19 +0000</pubDate>
<link>https://github.com/martinfekete10/Tuneful/releases</link>
<sparkle:version>1.6.5</sparkle:version>
<sparkle:shortVersionString>1.6.5</sparkle:shortVersionString>
<description><![CDATA[<h1>Bug fixes and minor improvements</h1>
<ul>
<li>Fixed a bug where menu bar info wasn't currently updated when music player was killed</li>
<li>Fixed a bug where equaliser animation preference wasn't correctly udpated on the settings window</li>
<li>Made a small improvement to equaliser animation</li>
<li>Settings window spacing is a bit improved</li>
</ul>]]></description>
<sparkle:minimumSystemVersion>12.0</sparkle:minimumSystemVersion>
<enclosure url="https://github.com/martinfekete10/Tuneful/releases/download/v1.6.5/Tuneful.dmg" length="9157102" type="application/octet-stream" sparkle:edSignature="g2nzz5cs6BtWJeF4zlVBTz/kW9rmEoCl3nwbtkEeGBQmPhINRJi4hVfE6r5mAB2FVfZnTZaYCcajKp1IqF/kBA=="/>
</item>
<item>
<title>1.6.4</title>
<pubDate>Wed, 25 Sep 2024 19:15:53 +0000</pubDate>
Expand All @@ -28,20 +44,6 @@
<sparkle:minimumSystemVersion>12.0</sparkle:minimumSystemVersion>
<enclosure url="https://github.com/martinfekete10/Tuneful/releases/download/v1.6.2/Tuneful.dmg" length="9115328" type="application/octet-stream" sparkle:edSignature="6Sk4c+2TVEyx3Md8ClNM654q59CI6bDf6JhRMoYrnSVYKxah37Bt6AYo4SkrN/llwtMek6GjomfPCKeTrqxnDQ=="/>
</item>
<item>
<title>1.6.1</title>
<pubDate>Tue, 18 Jun 2024 19:03:29 +0000</pubDate>
<link>https://github.com/martinfekete10/Tuneful/releases</link>
<sparkle:version>1.6.1</sparkle:version>
<sparkle:shortVersionString>1.6.1</sparkle:shortVersionString>
<description><![CDATA[<h1>Option to disable scrolling menu bar text</h1>
<ul>
<li>Added new option to disable scrolling menu bar text as it may be distracting</li>
<li>Fixed bug when the text was scrolling even if the width of menu bar item was large enough</li>
</ul>]]></description>
<sparkle:minimumSystemVersion>12.0</sparkle:minimumSystemVersion>
<enclosure url="https://github.com/martinfekete10/Tuneful/releases/download/v1.6.1/Tuneful.dmg" length="9152493" type="application/octet-stream" sparkle:edSignature="jT1nHd8Hpv2GmMyUYhBB8DmGG0XcBL7/HAFXdNSVl/jm/Sox1CGtiOwGXHrvbuvNOjpA/dJsHouE6EEgDN3HBQ=="/>
</item>
<item>
<title>0.9.6</title>
<pubDate>Sun, 10 Dec 2023 18:26:48 +0000</pubDate>
Expand Down
Binary file modified docs/images/menu-bar-settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions release_notes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# 1.6.5 - Bug fixes and minor improvements

- Fixed a bug where menu bar info wasn't currently updated when music player was killed
- Fixed a bug where equaliser animation preference wasn't correctly udpated on the settings window
- Made a small improvement to equaliser animation
- Settings window spacing is a bit improved

# 1.6.4 - Colored menu bar equaliser

- Menu bar equaliser animation is now colored based on album art
Expand Down

0 comments on commit ea0477a

Please sign in to comment.