Browse Source

Conform UpcomingEventStatusItemView to StatusItemViewConforming.

pull/113/head
Abhishek 3 years ago
parent
commit
34aba40bc7
  1. 21
      Clocker/Preferences/Menu Bar/UpcomingEventStatusItemView.swift

21
Clocker/Preferences/Menu Bar/UpcomingEventStatusItemView.swift

@ -71,9 +71,15 @@ class UpcomingEventStatusItemView: NSView {
}
private func initialSetup() {
nextEventField.attributedStringValue = NSAttributedString(string: "Next Event", attributes: textFontAttributes)
nextEventField.attributedStringValue = NSAttributedString(string: dataObject.event.title, attributes: textFontAttributes)
etaField.attributedStringValue = NSAttributedString(string: dataObject.metadataForMeeting(), attributes: timeAttributes)
}
@available(OSX 10.14, *)
override func viewDidChangeEffectiveAppearance() {
super.viewDidChangeEffectiveAppearance()
statusItemViewSetNeedsDisplay()
}
func updateWithNextEventInfo(_ metadata: String) {
nextEventField.attributedStringValue = NSAttributedString(string: "Next Event", attributes: textFontAttributes)
@ -89,3 +95,16 @@ class UpcomingEventStatusItemView: NSView {
mainDelegate.togglePanel(event)
}
}
extension UpcomingEventStatusItemView: StatusItemViewConforming {
func statusItemViewSetNeedsDisplay() {
nextEventField.attributedStringValue = NSAttributedString(string: dataObject.event.title, attributes: textFontAttributes)
etaField.attributedStringValue = NSAttributedString(string: dataObject.metadataForMeeting(), attributes: timeAttributes)
}
func statusItemViewIdentifier() -> String {
return "upcoming_event_view"
}
}

Loading…
Cancel
Save