mirror of
				https://github.com/zulip/zulip-desktop.git
				synced 2025-11-03 21:43:18 +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);
 | 
			
		||||
	});
 | 
			
		||||
 | 
			
		||||
	win.on('enter-full-screen', () => {
 | 
			
		||||
		win.webContents.send('enter-fullscreen');
 | 
			
		||||
	});
 | 
			
		||||
 | 
			
		||||
	win.on('leave-full-screen', () => {
 | 
			
		||||
		win.webContents.send('leave-fullscreen');
 | 
			
		||||
	});
 | 
			
		||||
 | 
			
		||||
	win.on('unmaximize', () => {
 | 
			
		||||
		conf.set('maximize', false);
 | 
			
		||||
	});
 | 
			
		||||
 
 | 
			
		||||
@@ -280,3 +280,37 @@ webview:focus {
 | 
			
		||||
.hidden {
 | 
			
		||||
    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.$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.tabs = [];
 | 
			
		||||
		this.functionalTabs = {};
 | 
			
		||||
@@ -255,17 +259,32 @@ class ServerManagerView {
 | 
			
		||||
		ipcRenderer.on('open-settings', (event, settingNav) => {
 | 
			
		||||
			this.openSettings(settingNav);
 | 
			
		||||
		});
 | 
			
		||||
 | 
			
		||||
		ipcRenderer.on('open-about', this.openAbout.bind(this));
 | 
			
		||||
 | 
			
		||||
		ipcRenderer.on('reload-viewer', this.reloadView.bind(this));
 | 
			
		||||
 | 
			
		||||
		ipcRenderer.on('hard-reload', () => {
 | 
			
		||||
			ipcRenderer.send('reload-full-app');
 | 
			
		||||
		});
 | 
			
		||||
 | 
			
		||||
		ipcRenderer.on('switch-server-tab', (event, index) => {
 | 
			
		||||
			this.activateTab(index);
 | 
			
		||||
		});
 | 
			
		||||
 | 
			
		||||
		ipcRenderer.on('toggle-sidebar', (event, 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) => {
 | 
			
		||||
			// Create a canvas from unread messagecounts
 | 
			
		||||
			function createOverlayIcon(messageCount) {
 | 
			
		||||
 
 | 
			
		||||
@@ -1,17 +1,22 @@
 | 
			
		||||
<!DOCTYPE html>
 | 
			
		||||
<html lang="en" class="responsive desktop">
 | 
			
		||||
  <head>
 | 
			
		||||
 | 
			
		||||
<head>
 | 
			
		||||
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 | 
			
		||||
  <meta name="viewport" content="width=device-width">
 | 
			
		||||
  <title>Zulip</title>
 | 
			
		||||
  <link rel="stylesheet" href="css/main.css" type="text/css" media="screen">
 | 
			
		||||
  </head>
 | 
			
		||||
  <body>
 | 
			
		||||
</head>
 | 
			
		||||
 | 
			
		||||
<body>
 | 
			
		||||
  <div id="content">
 | 
			
		||||
    <div class="popup">
 | 
			
		||||
      <span class="popuptext hidden" id="fullscreen-popup"></span>
 | 
			
		||||
  </div>
 | 
			
		||||
  <div id="sidebar">
 | 
			
		||||
    <div id="view-controls-container">
 | 
			
		||||
      <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">
 | 
			
		||||
          <i class="material-icons">add</i>
 | 
			
		||||
        </div>
 | 
			
		||||
@@ -32,6 +37,7 @@
 | 
			
		||||
    <div id="webviews-container"></div>
 | 
			
		||||
  </div>
 | 
			
		||||
  </div>
 | 
			
		||||
  </body>
 | 
			
		||||
  <script src="js/main.js"></script>
 | 
			
		||||
</body>
 | 
			
		||||
<script src="js/main.js"></script>
 | 
			
		||||
 | 
			
		||||
</html>
 | 
			
		||||
		Reference in New Issue
	
	Block a user