mirror of
				https://github.com/zulip/zulip-desktop.git
				synced 2025-10-31 12:03:39 +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); | ||||
| 	}); | ||||
|   | ||||
| @@ -279,4 +279,38 @@ 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,37 +1,43 @@ | ||||
| <!DOCTYPE html> | ||||
| <html lang="en" class="responsive desktop"> | ||||
|   <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> | ||||
|     <div id="content"> | ||||
|       <div id="sidebar"> | ||||
|         <div id="view-controls-container"> | ||||
|           <div id="tabs-container"></div> | ||||
|           <div id ="add-tab" class="tab functional-tab"> | ||||
|             <div class="server-tab" id="add-action"> | ||||
|               <i class="material-icons">add</i> | ||||
|             </div> | ||||
|           </div> | ||||
|  | ||||
| <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> | ||||
|   <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 class="server-tab" id="add-action"> | ||||
|           <i class="material-icons">add</i> | ||||
|         </div> | ||||
|         <div id="actions-container"> | ||||
|           <div class="action-button" id="reload-action"> | ||||
|             <i class="material-icons md-48">refresh</i> | ||||
|             <span id="reload-tooltip" style="display:none">Reload</span> | ||||
|           </div> | ||||
|           <div class="action-button" id="settings-action"> | ||||
|             <i class="material-icons md-48">settings</i> | ||||
|             <span id="setting-tooltip" style="display:none">Settings</span> | ||||
|           </div> | ||||
|         </div> | ||||
|       </div> | ||||
|       <div id="main-container"> | ||||
|         <div id="webviews-container"></div> | ||||
|       </div> | ||||
|     </div> | ||||
|   </body> | ||||
|   <script src="js/main.js"></script> | ||||
| </html> | ||||
|     <div id="actions-container"> | ||||
|       <div class="action-button" id="reload-action"> | ||||
|         <i class="material-icons md-48">refresh</i> | ||||
|         <span id="reload-tooltip" style="display:none">Reload</span> | ||||
|       </div> | ||||
|       <div class="action-button" id="settings-action"> | ||||
|         <i class="material-icons md-48">settings</i> | ||||
|         <span id="setting-tooltip" style="display:none">Settings</span> | ||||
|       </div> | ||||
|     </div> | ||||
|   </div> | ||||
|   <div id="main-container"> | ||||
|     <div id="webviews-container"></div> | ||||
|   </div> | ||||
|   </div> | ||||
| </body> | ||||
| <script src="js/main.js"></script> | ||||
|  | ||||
| </html> | ||||
		Reference in New Issue
	
	Block a user