Browse Source

Scroll Wheel Support!

pull/92/head
Abhishek 5 years ago
parent
commit
ab392c2f07
  1. 4
      Clocker/Onboarding/OnboardingParentViewController.swift
  2. 2
      Clocker/Overall App/Logger.swift
  3. 4
      Clocker/Panel/Notes Popover/NotesPopover.swift
  4. 9
      Clocker/Panel/PanelController.swift
  5. 2
      Clocker/Panel/ParentPanelController.swift
  6. 4
      Clocker/Panel/UI/TimezoneCellView.swift
  7. 2
      Clocker/Preferences/General/PreferencesViewController.swift

4
Clocker/Onboarding/OnboardingParentViewController.swift

@ -297,8 +297,8 @@ class OnboardingParentViewController: NSViewController {
UserDefaults.standard.set(shouldStart ? 1 : 0, forKey: CLStartAtLogin) UserDefaults.standard.set(shouldStart ? 1 : 0, forKey: CLStartAtLogin)
startupManager.toggleLogin(shouldStart) startupManager.toggleLogin(shouldStart)
shouldStart ? shouldStart ?
Logger.log(object: [:], for: "Enable Launch at Login while Onboarding") : Logger.log(object: nil, for: "Enable Launch at Login while Onboarding") :
Logger.log(object: [:], for: "Disable Launch at Login while Onboarding") Logger.log(object: nil, for: "Disable Launch at Login while Onboarding")
} }
func logExitPoint() { func logExitPoint() {

2
Clocker/Overall App/Logger.swift

@ -6,7 +6,7 @@ import os.log
import os.signpost import os.signpost
class Logger: NSObject { class Logger: NSObject {
class func log(object: [String: Any], for key: NSString) { class func log(object: [String: Any]?, for key: NSString) {
Answers.logCustomEvent(withName: key as String, Answers.logCustomEvent(withName: key as String,
customAttributes: object) customAttributes: object)
} }

4
Clocker/Panel/Notes Popover/NotesPopover.swift

@ -216,7 +216,7 @@ class NotesPopover: NSViewController {
if setReminderCheckbox.state == .on { if setReminderCheckbox.state == .on {
setReminderAlarm() setReminderAlarm()
Logger.log(object: [:], for: "Reminder Set") Logger.log(object: nil, for: "Reminder Set")
} }
refreshMainTableView() refreshMainTableView()
@ -249,7 +249,7 @@ class NotesPopover: NSViewController {
} }
NSWorkspace.shared.launchApplication("Reminders") NSWorkspace.shared.launchApplication("Reminders")
} else if eventDescriptor == nil { } else if eventDescriptor == nil {
Logger.log(object: [:], for: "Event Description is unexpectedly nil") Logger.log(object: nil, for: "Event Description is unexpectedly nil")
NSWorkspace.shared.launchApplication("Reminders") NSWorkspace.shared.launchApplication("Reminders")
} else { } else {
Logger.log(object: ["Successfully Executed Apple Script": "YES"], for: "Successfully Executed Apple Script") Logger.log(object: ["Successfully Executed Apple Script": "YES"], for: "Successfully Executed Apple Script")

9
Clocker/Panel/PanelController.swift

@ -356,6 +356,15 @@ class PanelController: ParentPanelController {
func refreshBackgroundView() { func refreshBackgroundView() {
backgroundView.setNeedsDisplay(backgroundView.bounds) backgroundView.setNeedsDisplay(backgroundView.bounds)
} }
override func scrollWheel(with event: NSEvent) {
if event.phase == NSEvent.Phase.ended {
Logger.log(object: nil, for: "Scroll Event Ended")
}
futureSlider.doubleValue += Double(event.scrollingDeltaX)
sliderMoved(futureSlider!)
}
} }
extension PanelController: NSWindowDelegate { extension PanelController: NSWindowDelegate {

2
Clocker/Panel/ParentPanelController.swift

@ -501,7 +501,7 @@ class ParentPanelController: NSWindowController {
object: nil) object: nil)
// Now log! // Now log!
Logger.log(object: [:], for: "Deleted Timezone Through Swipe") Logger.log(object: nil, for: "Deleted Timezone Through Swipe")
} }
private lazy var menubarTitleHandler = MenubarHandler() private lazy var menubarTitleHandler = MenubarHandler()

4
Clocker/Panel/UI/TimezoneCellView.swift

@ -151,7 +151,7 @@ class TimezoneCellView: NSTableCellView {
andButton: sender) andButton: sender)
} }
Logger.log(object: [:], for: "Open Extra Options") Logger.log(object: nil, for: "Open Extra Options")
} }
override func mouseDown(with _: NSEvent) { override func mouseDown(with _: NSEvent) {
@ -161,6 +161,6 @@ class TimezoneCellView: NSTableCellView {
override func rightMouseDown(with event: NSEvent) { override func rightMouseDown(with event: NSEvent) {
super.rightMouseDown(with: event) super.rightMouseDown(with: event)
showExtraOptions(extraOptions) showExtraOptions(extraOptions)
Logger.log(object: [:], for: "Right Click Open Options") Logger.log(object: nil, for: "Right Click Open Options")
} }
} }

2
Clocker/Preferences/General/PreferencesViewController.swift

@ -576,7 +576,7 @@ extension PreferencesViewController {
return return
} }
if error == nil, let json = response, let timezone = strongSelf .decodeTimezone(from: json) { if error == nil, let json = response, let timezone = strongSelf.decodeTimezone(from: json) {
if strongSelf.availableTimezoneTableView.selectedRow >= 0 { if strongSelf.availableTimezoneTableView.selectedRow >= 0 {
strongSelf.installTimezone(timezone) strongSelf.installTimezone(timezone)
} }

Loading…
Cancel
Save