Skip to content
This repository has been archived by the owner on Jul 24, 2023. It is now read-only.

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
* develop:
  added CHANGELOG
  ready for patch release 🎉
  fixed multiple window bug. closes #10
  fixed calendar position on multiple monitors. closes #9
  • Loading branch information
mzdr committed Sep 8, 2016
2 parents 57579cf + 3a89d4a commit dc0dbc1
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 2 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# [1.0.1]
###### 2016-09-09

A tiny patch release which eliminates two bugs. 🐞

###### Fixed
- Calendar window position being offset on multiple monitors
- Preferences and about window being opened multiple times

# 1.0.0
###### 2016-09-04

First public release! 🎉

[1.0.1]: https://github.com/mzdr/timestamp/compare/1.0.0...1.0.1
7 changes: 7 additions & 0 deletions app/about.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ class About
*/
show()
{
// Don't create multiple windows, focus on last created one instead
if (this._window && this._window.isDestroyed() === false) {
this._window.show();

return;
}

// Create window instance
this._window = new Electron.BrowserWindow({
resizable: false,
Expand Down
7 changes: 6 additions & 1 deletion app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,13 @@ class App
// Show calendar when clicking on tray icon
this.tray.onClick(() => {
const bounds = this.tray.getBounds();
const currentMousePosition = Electron.screen.getCursorScreenPoint();
const currentDisplay = Electron.screen.getDisplayNearestPoint(currentMousePosition);

this.calendar.setPosition(bounds.x + bounds.width / 2, 0);
this.calendar.setPosition(
bounds.x + bounds.width / 2,
currentDisplay.workArea.y
);

if (this.calendar.isVisible()) {
this.calendar.hide();
Expand Down
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "timestamp",
"productName": "Timestamp",
"description": "A better macOS menu bar clock with a customizable date/time display and a calendar.",
"version": "1.0.0",
"version": "1.0.1",
"author": "Sebastian Prein <hi@sebastianprein.com>",
"copyright": "© 2016 Sebastian Prein",
"homepage": "https://github.com/mzdr/timestamp",
Expand Down
7 changes: 7 additions & 0 deletions app/preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ class Preferences
*/
show()
{
// Don't create multiple windows, focus on last created one instead
if (this._window && this._window.isDestroyed() === false) {
this._window.show();

return;
}

// Create window instance
this._window = new Electron.BrowserWindow({
resizable: false,
Expand Down

0 comments on commit dc0dbc1

Please sign in to comment.