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

Commit dc0dbc1

Browse files
committed
Merge branch 'develop'
* develop: added CHANGELOG ready for patch release πŸŽ‰ fixed multiple window bug. closes #10 fixed calendar position on multiple monitors. closes #9
2 parents 57579cf + 3a89d4a commit dc0dbc1

File tree

5 files changed

+36
-2
lines changed

5 files changed

+36
-2
lines changed

β€ŽCHANGELOG.mdβ€Ž

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# [1.0.1]
2+
###### 2016-09-09
3+
4+
A tiny patch release which eliminates two bugs. 🐞
5+
6+
###### Fixed
7+
- Calendar window position being offset on multiple monitors
8+
- Preferences and about window being opened multiple times
9+
10+
# 1.0.0
11+
###### 2016-09-04
12+
13+
First public release! πŸŽ‰
14+
15+
[1.0.1]: https://github.com/mzdr/timestamp/compare/1.0.0...1.0.1

β€Žapp/about.jsβ€Ž

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ class About
2323
*/
2424
show()
2525
{
26+
// Don't create multiple windows, focus on last created one instead
27+
if (this._window && this._window.isDestroyed() === false) {
28+
this._window.show();
29+
30+
return;
31+
}
32+
2633
// Create window instance
2734
this._window = new Electron.BrowserWindow({
2835
resizable: false,

β€Žapp/app.jsβ€Ž

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,13 @@ class App
7070
// Show calendar when clicking on tray icon
7171
this.tray.onClick(() => {
7272
const bounds = this.tray.getBounds();
73+
const currentMousePosition = Electron.screen.getCursorScreenPoint();
74+
const currentDisplay = Electron.screen.getDisplayNearestPoint(currentMousePosition);
7375

74-
this.calendar.setPosition(bounds.x + bounds.width / 2, 0);
76+
this.calendar.setPosition(
77+
bounds.x + bounds.width / 2,
78+
currentDisplay.workArea.y
79+
);
7580

7681
if (this.calendar.isVisible()) {
7782
this.calendar.hide();

β€Žapp/package.jsonβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "timestamp",
33
"productName": "Timestamp",
44
"description": "A better macOS menu bar clock with a customizable date/time display and a calendar.",
5-
"version": "1.0.0",
5+
"version": "1.0.1",
66
"author": "Sebastian Prein <hi@sebastianprein.com>",
77
"copyright": "Β© 2016 Sebastian Prein",
88
"homepage": "https://github.com/mzdr/timestamp",

β€Žapp/preferences.jsβ€Ž

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ class Preferences
4646
*/
4747
show()
4848
{
49+
// Don't create multiple windows, focus on last created one instead
50+
if (this._window && this._window.isDestroyed() === false) {
51+
this._window.show();
52+
53+
return;
54+
}
55+
4956
// Create window instance
5057
this._window = new Electron.BrowserWindow({
5158
resizable: false,

0 commit comments

Comments
Β (0)