GUI: Open settings window centered above mainwindow (#4880)
On multiscreen setup or big monitor it is confusing if settings window opens far away. With that it will be centered. Co-authored-by: Manuel Stein <manuel.stein@gmx.net>
This commit is contained in:
parent
8d3d51314e
commit
7095e070eb
1 changed files with 9 additions and 2 deletions
11
main.js
11
main.js
|
@ -693,9 +693,16 @@ function showSettingsWindow() {
|
|||
addDarkOverlay();
|
||||
|
||||
const size = mainWindow.getSize();
|
||||
// center settings window over main window
|
||||
const settingwidth = Math.min(500, size[0]);
|
||||
const settingheight = Math.max(size[1] - 100, MIN_HEIGHT);
|
||||
const mainPos = mainWindow.getPosition();
|
||||
const mainSize = mainWindow.getSize();
|
||||
const options = {
|
||||
width: Math.min(500, size[0]),
|
||||
height: Math.max(size[1] - 100, MIN_HEIGHT),
|
||||
x: Math.round(mainPos[0] + mainSize[0] / 2 - settingwidth / 2),
|
||||
y: Math.round(mainPos[1] + mainSize[1] / 2 - settingheight / 2),
|
||||
width: settingwidth,
|
||||
height: settingheight,
|
||||
frame: false,
|
||||
resizable: false,
|
||||
title: locale.messages.signalDesktopPreferences.message,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue