Skip to content

Commit

Permalink
floating window fixed for macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
RoderickQiu committed Jul 4, 2020
1 parent b9126b7 commit 8dbbfde
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
8 changes: 8 additions & 0 deletions floating.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<a id="stopper" href="javascript:stopper()" class="text-muted">
<i class="iconfont icon-pause"></i>
</a>
<div id="stopper-spacing"><br /><br /></div>
</div>
<div class="extreme-small" id="floating-recover">
<a href="javascript:recover()" class="text-muted text-left">
Expand Down Expand Up @@ -67,6 +68,13 @@
</div><!-- for things with 'work' mark, when it's resting, the color should be changed -->
<div id="floating-bottom-bar">&nbsp;</div>
<script>
if (process.platform == "darwin") {
$("#floating-recover").css("display", "none");
$("#floating-close").css("display", "none");
} else {
$("#stopper-spacing").css("display", "none");
}

function hover() {
$("#floating-unhover").css("opacity", "0");
}
Expand Down
2 changes: 1 addition & 1 deletion locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,6 @@
"focus-notify-resting": "resting",
"focus-notify-body": "focus mode will be on",
"recover": "Exit the mini mode",
"mini-mode": "Enter the mini mode",
"mini-mode": "Mini mode",
"min-left": "min left"
}
2 changes: 1 addition & 1 deletion locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,6 @@
"focus-notify-resting": "休息",
"focus-notify-body": "时开启全屏专心模式,到时将无法退出",
"recover": "退出MINI模式",
"mini-mode": "进入MINI模式",
"mini-mode": "MINI模式",
"min-left": "分钟剩余"
}
2 changes: 1 addition & 1 deletion locales/zh-TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,6 @@
"focus-notify-resting": "休息",
"focus-notify-body": "時開啓全屏專心模式,到時將無法退出",
"recover": "退出MINI模式",
"mini-mode": "進入MINI模式",
"mini-mode": "MINI模式",
"min-left": "分鍾剩余"
}
8 changes: 5 additions & 3 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,9 @@ function traySolution(isFullScreen) {
}, {
label: i18n.__('show-or-hide'), click: function () { showOrHide() }
}, {
label: i18n.__('mini-mode'), click: function () {
label: i18n.__('mini-mode'),
enabled: isTimerWin,
click: function () {
if (win != null) win.webContents.send("floating-message", "enter");
}
}, {
Expand All @@ -687,7 +689,7 @@ function traySolution(isFullScreen) {
if (tray != null) {
tray.removeAllListeners('click');
tray.on('click', function () {
if (fullScreenProtection == false) {
if (fullScreenProtection == false && process.platform == "win32") {
showOrHide();
}
});//tray
Expand Down Expand Up @@ -1525,7 +1527,7 @@ function floating() {
frame: false,
show: false,
center: false,
titleBarStyle: "hidden",
titleBarStyle: "customButtonsOnHover",
webPreferences: { nodeIntegration: true },
skipTaskbar: true
});
Expand Down

0 comments on commit 8dbbfde

Please sign in to comment.