Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions electron/app/js/prompt/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
<div id="appName" class="textLine main">...</div>
<div id="version" class="textLine">...</div>
<div id="copyright" class="textLine">...</div>
<div id="buttons">
<button type="submit" id="ok">...</button>
</div>
</form>
</div>
<script src="about.js"></script>
Expand Down
8 changes: 1 addition & 7 deletions electron/app/js/prompt/about.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,14 @@ function promptRegister() {
return promptError(error);
}

const okButton = document.querySelector('#ok');

okButton.addEventListener('keyup', event => {
document.addEventListener('keyup', event => {
if (event.key === 'Escape') {
promptCancel();
}
});

document.querySelector('#form').addEventListener('submit', promptSubmit);

okButton.focus();

window.api.i18n.ready.then(() => {
const versionText = window.api.i18n.t('dialog-about-version', {
version: promptOptions.applicationVersion,
Expand All @@ -55,8 +51,6 @@ function promptRegister() {
document.querySelector('#version').textContent = versionText;
document.querySelector('#copyright').textContent = promptOptions.copyright;

okButton.textContent = window.api.i18n.t('dialog-button-ok');

const height = document.querySelector('body').offsetHeight;
window.api.ipc.sendSync('prompt-size:' + promptId, height);
});
Expand Down
10 changes: 8 additions & 2 deletions electron/app/js/promptUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ async function getCredentialPassphrase(parentWindow) {
alwaysOnTop: false,
useContentSize: true,
modal: Boolean(parentWindow),
autoHideMenuBar: true,
menuBarVisible: false,
webPreferences: {
nodeIntegration: false,
Expand All @@ -42,7 +43,9 @@ async function getCredentialPassphrase(parentWindow) {
},
});

// hide app menu for various platforms
promptWindow.setMenu(null);
promptWindow.removeMenu();
promptWindow.setMenuBarVisibility(false);

const getOptionsListener = event => {
Expand Down Expand Up @@ -110,7 +113,7 @@ async function showAboutDialog(wktApp, parentWindow) {
const preloadFile = path.join(__dirname, 'prompt', 'preload.js');

const WIDTH = 400;
const HEIGHT = 234; // renderer will send IPC to adjust this
const HEIGHT = 186; // renderer will send IPC to adjust this
const MIN_HEIGHT = 120; // needs to be smaller than content height

return new Promise((resolve, reject) => {
Expand All @@ -128,7 +131,8 @@ async function showAboutDialog(wktApp, parentWindow) {
skipTaskbar: true,
alwaysOnTop: false,
useContentSize: true,
modal: Boolean(parentWindow),
modal: Boolean(parentWindow), // false causes problems with app menu appearing
autoHideMenuBar: true,
menuBarVisible: false,
webPreferences: {
nodeIntegration: false,
Expand All @@ -139,7 +143,9 @@ async function showAboutDialog(wktApp, parentWindow) {
},
});

// hide app menu for various platforms
promptWindow.setMenu(null);
promptWindow.removeMenu();
promptWindow.setMenuBarVisibility(false);

const getOptionsListener = event => {
Expand Down