Browse Source

Merge branch 'master' of https://github.com/n0shake/Clocker

pull/113/head
Abhishek Banthia 3 years ago
parent
commit
3e396fd4df
  1. 6
      Clocker/ClockerUITests/ShortcutTests.swift
  2. 6
      Clocker/Panel/UI/TimezoneCellView.swift

6
Clocker/ClockerUITests/ShortcutTests.swift

@ -27,8 +27,8 @@ class ShortcutTests: XCTestCase {
let randomAlphabet = randomLetter() let randomAlphabet = randomLetter()
app.windows["Clocker"].buttons["ShortcutControl"].click() app.windows["Clocker"].otherElements["ShortcutControl"].click()
app.windows["Clocker"].buttons["ShortcutControl"].typeKey(randomAlphabet, modifierFlags: [.shift, .command]) app.windows["Clocker"].otherElements["ShortcutControl"].typeKey(randomAlphabet, modifierFlags: [.shift, .command])
// Close the window to really test // Close the window to really test
app.windows["Clocker"].buttons["_XCUI:CloseWindow"].click() app.windows["Clocker"].buttons["_XCUI:CloseWindow"].click()
@ -44,7 +44,7 @@ class ShortcutTests: XCTestCase {
// Reset the shortcut // Reset the shortcut
app.tables["mainTableView"].typeKey(",", modifierFlags: .command) app.tables["mainTableView"].typeKey(",", modifierFlags: .command)
app.windows["Clocker"].buttons["ShortcutControl"].click() app.windows["Clocker"].otherElements["ShortcutControl"].click()
app.windows["Clocker"].typeKey(XCUIKeyboardKey.delete, modifierFlags: []) app.windows["Clocker"].typeKey(XCUIKeyboardKey.delete, modifierFlags: [])
app.windows["Clocker"].typeKey(randomAlphabet, modifierFlags: [.shift, .command]) app.windows["Clocker"].typeKey(randomAlphabet, modifierFlags: [.shift, .command])
XCTAssertFalse(app.tables["mainTableView"].exists) XCTAssertFalse(app.tables["mainTableView"].exists)

6
Clocker/Panel/UI/TimezoneCellView.swift

@ -198,7 +198,8 @@ class TimezoneCellView: NSTableCellView {
Logger.log(object: nil, for: "Open Extra Options") Logger.log(object: nil, for: "Open Extra Options")
} }
override func mouseDown(with _: NSEvent) { override func mouseDown(with event: NSEvent) {
if (event.clickCount == 1) {
// Text is copied in the following format: Chicago - 1625185925 // Text is copied in the following format: Chicago - 1625185925
let clipboardCopy = "\(customName.stringValue) - \(time.stringValue)" let clipboardCopy = "\(customName.stringValue) - \(time.stringValue)"
let pasteboard = NSPasteboard.general let pasteboard = NSPasteboard.general
@ -208,6 +209,9 @@ class TimezoneCellView: NSTableCellView {
window?.contentView?.makeToast("Copied to Clipboard".localized()) window?.contentView?.makeToast("Copied to Clipboard".localized())
window?.endEditing(for: nil) window?.endEditing(for: nil)
} else if (event.clickCount == 2) {
//TODO: Favourite this timezone
}
} }
override func rightMouseDown(with event: NSEvent) { override func rightMouseDown(with event: NSEvent) {

Loading…
Cancel
Save