File tree 8 files changed +55
-3
lines changed
8 files changed +55
-3
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,7 @@ export interface RendererMessage {
83
83
"update-realm-icon" : ( serverURL : string , iconURL : string ) => void ;
84
84
"update-realm-name" : ( serveRURL : string , realmName : string ) => void ;
85
85
"webview-reload" : ( ) => void ;
86
+ "exit-settings" : ( ) => void ;
86
87
zoomActualSize : ( ) => void ;
87
88
zoomIn : ( ) => void ;
88
89
zoomOut : ( ) => void ;
Original file line number Diff line number Diff line change @@ -86,6 +86,17 @@ td:nth-child(odd) {
86
86
text-rendering : optimizeLegibility;
87
87
}
88
88
89
+ .exit-sign {
90
+ float : right;
91
+ position : relative;
92
+ top : 1px ;
93
+ margin-left : 3px ;
94
+ font-size : 2rem ;
95
+ line-height : 1 ;
96
+ font-weight : 600 ;
97
+ cursor : pointer;
98
+ }
99
+
89
100
# content {
90
101
display : flex;
91
102
height : 100% ;
Original file line number Diff line number Diff line change @@ -927,6 +927,22 @@ class ServerManagerView {
927
927
} ) ;
928
928
}
929
929
930
+ ipcRenderer . on ( "exit-settings" , ( ) => {
931
+ let lastActiveServerTabIndex = - 1 ;
932
+
933
+ for ( const tab of this . tabs ) {
934
+ if ( tab . props . role === "server" ) {
935
+ lastActiveServerTabIndex = tab . props . tabIndex ;
936
+ }
937
+ }
938
+
939
+ console . log ( typeof this . tabs [ lastActiveServerTabIndex ] ) ;
940
+ if ( lastActiveServerTabIndex >= 0 ) {
941
+ console . log ( "Tab to be focussed" ) ;
942
+ this . tabs [ lastActiveServerTabIndex ] . webview . focus ( ) ;
943
+ }
944
+ } ) ;
945
+
930
946
ipcRenderer . on (
931
947
"permission-request" ,
932
948
(
Original file line number Diff line number Diff line change @@ -81,3 +81,10 @@ export function generateSelectHTML(
81
81
export function reloadApp ( ) : void {
82
82
ipcRenderer . send ( "forward-message" , "reload-viewer" ) ;
83
83
}
84
+
85
+ export function exitSettings ( ) : void {
86
+ const exitButton = document . querySelector ( ".exit-sign" ) ! ;
87
+ exitButton . addEventListener ( "click" , async ( ) => {
88
+ ipcRenderer . send ( "forward-message" , "exit-settings" ) ;
89
+ } ) ;
90
+ }
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import * as t from "../../../../common/translation-util";
3
3
import { ipcRenderer } from "../../typed-ipc-renderer" ;
4
4
import * as DomainUtil from "../../utils/domain-util" ;
5
5
6
- import { reloadApp } from "./base-section" ;
6
+ import { exitSettings , reloadApp } from "./base-section" ;
7
7
import { initFindAccounts } from "./find-accounts" ;
8
8
import { initServerInfoForm } from "./server-info-form" ;
9
9
@@ -17,6 +17,7 @@ export function initConnectedOrgSection(props: ConnectedOrgSectionProps): void {
17
17
const servers = DomainUtil . getDomains ( ) ;
18
18
props . $root . innerHTML = html `
19
19
< div class ="settings-pane " id ="server-settings-pane ">
20
+ < span class ="exit-sign "> ×</ span >
20
21
< div class ="page-title "> ${ t . __ ( "Connected organizations" ) } </ div >
21
22
< div class ="title " id ="existing-servers ">
22
23
${ t . __ ( "All the connected orgnizations will appear here." ) }
@@ -32,6 +33,8 @@ export function initConnectedOrgSection(props: ConnectedOrgSectionProps): void {
32
33
</ div >
33
34
` . html ;
34
35
36
+ exitSettings ( ) ;
37
+
35
38
const $serverInfoContainer = document . querySelector (
36
39
"#server-info-container" ,
37
40
) ! ;
Original file line number Diff line number Diff line change @@ -14,7 +14,11 @@ import * as t from "../../../../common/translation-util";
14
14
import supportedLocales from "../../../../translations/supported-locales.json" ;
15
15
import { ipcRenderer } from "../../typed-ipc-renderer" ;
16
16
17
- import { generateSelectHTML , generateSettingOption } from "./base-section" ;
17
+ import {
18
+ exitSettings ,
19
+ generateSelectHTML ,
20
+ generateSettingOption ,
21
+ } from "./base-section" ;
18
22
19
23
const { app, dialog, session} = remote ;
20
24
const currentBrowserWindow = remote . getCurrentWindow ( ) ;
@@ -26,6 +30,7 @@ interface GeneralSectionProps {
26
30
export function initGeneralSection ( props : GeneralSectionProps ) : void {
27
31
props . $root . innerHTML = html `
28
32
< div class ="settings-pane ">
33
+ < span class ="exit-sign "> ×</ span >
29
34
< div class ="title "> ${ t . __ ( "Appearance" ) } </ div >
30
35
< div id ="appearance-option-settings " class ="settings-card ">
31
36
< div class ="setting-row " id ="tray-option ">
@@ -211,6 +216,7 @@ export function initGeneralSection(props: GeneralSectionProps): void {
211
216
</ div >
212
217
` . html ;
213
218
219
+ exitSettings ( ) ;
214
220
updateTrayOption ( ) ;
215
221
updateBadgeOption ( ) ;
216
222
updateSilentOption ( ) ;
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import {html} from "../../../../common/html";
3
3
import * as t from "../../../../common/translation-util" ;
4
4
import { ipcRenderer } from "../../typed-ipc-renderer" ;
5
5
6
- import { generateSettingOption } from "./base-section" ;
6
+ import { exitSettings , generateSettingOption } from "./base-section" ;
7
7
8
8
interface NetworkSectionProps {
9
9
$root : Element ;
@@ -12,6 +12,7 @@ interface NetworkSectionProps {
12
12
export function initNetworkSection ( props : NetworkSectionProps ) : void {
13
13
props . $root . innerHTML = html `
14
14
< div class ="settings-pane ">
15
+ < span class ="exit-sign "> ×</ span >
15
16
< div class ="title "> ${ t . __ ( "Proxy" ) } </ div >
16
17
< div id ="appearance-option-settings " class ="settings-card ">
17
18
< div class ="setting-row " id ="use-system-settings ">
@@ -55,6 +56,8 @@ export function initNetworkSection(props: NetworkSectionProps): void {
55
56
</ div >
56
57
` . html ;
57
58
59
+ exitSettings ( ) ;
60
+
58
61
const $proxyPAC : HTMLInputElement = document . querySelector (
59
62
"#proxy-pac-option .setting-input-value" ,
60
63
) ! ;
Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ import {html} from "../../../../common/html";
2
2
import * as t from "../../../../common/translation-util" ;
3
3
import * as LinkUtil from "../../utils/link-util" ;
4
4
5
+ import { exitSettings } from "./base-section" ;
6
+
5
7
interface ShortcutsSectionProps {
6
8
$root : Element ;
7
9
}
@@ -12,6 +14,7 @@ export function initShortcutsSection(props: ShortcutsSectionProps): void {
12
14
13
15
props . $root . innerHTML = html `
14
16
< div class ="settings-pane ">
17
+ < span class ="exit-sign "> ×</ span >
15
18
< div class ="settings-card tip ">
16
19
< p >
17
20
< b > < i class ="material-icons md-14 "> settings</ i > ${ t . __ ( "Tip" ) } : </ b
@@ -222,6 +225,8 @@ export function initShortcutsSection(props: ShortcutsSectionProps): void {
222
225
</ div >
223
226
` . html ;
224
227
228
+ exitSettings ( ) ;
229
+
225
230
const link = "https://zulip.com/help/keyboard-shortcuts" ;
226
231
const externalCreateNewOrgElement =
227
232
document . querySelector ( "#open-hotkeys-link" ) ! ;
You can’t perform that action at this time.
0 commit comments