mirror of
https://github.com/zulip/zulip-desktop.git
synced 2025-11-05 22:43:17 +00:00
notify exit fullscreen shortcut on entering fullscreen mode #247
This commit is contained in:
@@ -107,6 +107,14 @@ function createMainWindow() {
|
|||||||
conf.set('maximize', true);
|
conf.set('maximize', true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
win.on('enter-full-screen', () => {
|
||||||
|
win.webContents.send('enter-fullscreen');
|
||||||
|
});
|
||||||
|
|
||||||
|
win.on('leave-full-screen', () => {
|
||||||
|
win.webContents.send('leave-fullscreen');
|
||||||
|
});
|
||||||
|
|
||||||
win.on('unmaximize', () => {
|
win.on('unmaximize', () => {
|
||||||
conf.set('maximize', false);
|
conf.set('maximize', false);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -280,3 +280,37 @@ webview:focus {
|
|||||||
.hidden {
|
.hidden {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Full screen Popup container */
|
||||||
|
.popup .popuptext {
|
||||||
|
visibility: hidden;
|
||||||
|
background-color: #555;
|
||||||
|
color: #fff;
|
||||||
|
text-align: center;
|
||||||
|
border-radius: 6px;
|
||||||
|
padding: 10px 0;
|
||||||
|
position: absolute;
|
||||||
|
z-index: 1;
|
||||||
|
width: 16%;
|
||||||
|
top: 15px;
|
||||||
|
height: 20px;
|
||||||
|
left: 43%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup .show {
|
||||||
|
visibility: visible;
|
||||||
|
animation: cssAnimation 0s ease-in 5s forwards;
|
||||||
|
animation-fill-mode: forwards;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes cssAnimation {
|
||||||
|
from {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
width: 0;
|
||||||
|
height: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -23,6 +23,10 @@ class ServerManagerView {
|
|||||||
this.$settingsTooltip = $actionsContainer.querySelector('#setting-tooltip');
|
this.$settingsTooltip = $actionsContainer.querySelector('#setting-tooltip');
|
||||||
this.$sidebar = document.getElementById('sidebar');
|
this.$sidebar = document.getElementById('sidebar');
|
||||||
|
|
||||||
|
this.$fullscreenPopup = document.getElementById('fullscreen-popup');
|
||||||
|
this.$fullscreenEscapeKey = process.platform === 'darwin' ? '^⌘F' : 'F11';
|
||||||
|
this.$fullscreenPopup.innerHTML = `Press ${this.$fullscreenEscapeKey} to exit full screen`;
|
||||||
|
|
||||||
this.activeTabIndex = -1;
|
this.activeTabIndex = -1;
|
||||||
this.tabs = [];
|
this.tabs = [];
|
||||||
this.functionalTabs = {};
|
this.functionalTabs = {};
|
||||||
@@ -255,17 +259,32 @@ class ServerManagerView {
|
|||||||
ipcRenderer.on('open-settings', (event, settingNav) => {
|
ipcRenderer.on('open-settings', (event, settingNav) => {
|
||||||
this.openSettings(settingNav);
|
this.openSettings(settingNav);
|
||||||
});
|
});
|
||||||
|
|
||||||
ipcRenderer.on('open-about', this.openAbout.bind(this));
|
ipcRenderer.on('open-about', this.openAbout.bind(this));
|
||||||
|
|
||||||
ipcRenderer.on('reload-viewer', this.reloadView.bind(this));
|
ipcRenderer.on('reload-viewer', this.reloadView.bind(this));
|
||||||
|
|
||||||
ipcRenderer.on('hard-reload', () => {
|
ipcRenderer.on('hard-reload', () => {
|
||||||
ipcRenderer.send('reload-full-app');
|
ipcRenderer.send('reload-full-app');
|
||||||
});
|
});
|
||||||
|
|
||||||
ipcRenderer.on('switch-server-tab', (event, index) => {
|
ipcRenderer.on('switch-server-tab', (event, index) => {
|
||||||
this.activateTab(index);
|
this.activateTab(index);
|
||||||
});
|
});
|
||||||
|
|
||||||
ipcRenderer.on('toggle-sidebar', (event, show) => {
|
ipcRenderer.on('toggle-sidebar', (event, show) => {
|
||||||
this.toggleSidebar(show);
|
this.toggleSidebar(show);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
ipcRenderer.on('enter-fullscreen', () => {
|
||||||
|
this.$fullscreenPopup.classList.add('show');
|
||||||
|
this.$fullscreenPopup.classList.remove('hidden');
|
||||||
|
});
|
||||||
|
|
||||||
|
ipcRenderer.on('leave-fullscreen', () => {
|
||||||
|
this.$fullscreenPopup.classList.remove('show');
|
||||||
|
});
|
||||||
|
|
||||||
ipcRenderer.on('render-taskbar-icon', (event, messageCount) => {
|
ipcRenderer.on('render-taskbar-icon', (event, messageCount) => {
|
||||||
// Create a canvas from unread messagecounts
|
// Create a canvas from unread messagecounts
|
||||||
function createOverlayIcon(messageCount) {
|
function createOverlayIcon(messageCount) {
|
||||||
|
|||||||
@@ -1,17 +1,22 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en" class="responsive desktop">
|
<html lang="en" class="responsive desktop">
|
||||||
<head>
|
|
||||||
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
<meta name="viewport" content="width=device-width">
|
<meta name="viewport" content="width=device-width">
|
||||||
<title>Zulip</title>
|
<title>Zulip</title>
|
||||||
<link rel="stylesheet" href="css/main.css" type="text/css" media="screen">
|
<link rel="stylesheet" href="css/main.css" type="text/css" media="screen">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
|
||||||
|
<body>
|
||||||
<div id="content">
|
<div id="content">
|
||||||
|
<div class="popup">
|
||||||
|
<span class="popuptext hidden" id="fullscreen-popup"></span>
|
||||||
|
</div>
|
||||||
<div id="sidebar">
|
<div id="sidebar">
|
||||||
<div id="view-controls-container">
|
<div id="view-controls-container">
|
||||||
<div id="tabs-container"></div>
|
<div id="tabs-container"></div>
|
||||||
<div id ="add-tab" class="tab functional-tab">
|
<div id="add-tab" class="tab functional-tab">
|
||||||
<div class="server-tab" id="add-action">
|
<div class="server-tab" id="add-action">
|
||||||
<i class="material-icons">add</i>
|
<i class="material-icons">add</i>
|
||||||
</div>
|
</div>
|
||||||
@@ -32,6 +37,7 @@
|
|||||||
<div id="webviews-container"></div>
|
<div id="webviews-container"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
<script src="js/main.js"></script>
|
<script src="js/main.js"></script>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
Reference in New Issue
Block a user