mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-04-21 21:52:03 +02:00
fix: open shortcuts window on correct screen
corrections: - open on the same display, - center to the parent window, - has dimensions not more than the parent window Change-Id: I2315d62fef6d830b6957770807ace462fbb77901 Gitlab: #774
This commit is contained in:
parent
682721b7a7
commit
49aadea7ba
3 changed files with 11 additions and 8 deletions
|
@ -606,7 +606,7 @@ Rectangle {
|
|||
sequence: "F10"
|
||||
context: Qt.ApplicationShortcut
|
||||
onActivated: {
|
||||
KeyboardShortcutTableCreation.createKeyboardShortcutTableWindowObject()
|
||||
KeyboardShortcutTableCreation.createKeyboardShortcutTableWindowObject(appWindow)
|
||||
KeyboardShortcutTableCreation.showKeyboardShortcutTableWindow()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -241,7 +241,7 @@ Rectangle {
|
|||
toolTipText: JamiStrings.keyboardShortcuts
|
||||
|
||||
onClicked: {
|
||||
KeyboardShortcutTableCreation.createKeyboardShortcutTableWindowObject()
|
||||
KeyboardShortcutTableCreation.createKeyboardShortcutTableWindowObject(appWindow)
|
||||
KeyboardShortcutTableCreation.showKeyboardShortcutTableWindow()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,12 +19,14 @@
|
|||
// Global select screen window component, object variable for creation.
|
||||
var keyboardShortcutTableWindowComponent
|
||||
var keyboardShortcutTableWindowObject
|
||||
var mainWindow
|
||||
|
||||
function createKeyboardShortcutTableWindowObject() {
|
||||
function createKeyboardShortcutTableWindowObject(appWindow) {
|
||||
if (keyboardShortcutTableWindowObject)
|
||||
return
|
||||
keyboardShortcutTableWindowComponent = Qt.createComponent(
|
||||
"../components/KeyboardShortcutTable.qml")
|
||||
mainWindow = appWindow
|
||||
if (keyboardShortcutTableWindowComponent.status === Component.Ready)
|
||||
finishCreation()
|
||||
else if (keyboardShortcutTableWindowComponent.status === Component.Error)
|
||||
|
@ -45,12 +47,13 @@ function finishCreation() {
|
|||
|
||||
function showKeyboardShortcutTableWindow() {
|
||||
keyboardShortcutTableWindowObject.show()
|
||||
var centerX = mainWindow.x + mainWindow.width / 2
|
||||
var centerY = mainWindow.y + mainWindow.height / 2
|
||||
|
||||
var screen = keyboardShortcutTableWindowObject.screen
|
||||
keyboardShortcutTableWindowObject.x = screen.virtualX +
|
||||
(screen.width - keyboardShortcutTableWindowObject.width) / 2
|
||||
keyboardShortcutTableWindowObject.y = screen.virtualY +
|
||||
(screen.height - keyboardShortcutTableWindowObject.height) / 2
|
||||
keyboardShortcutTableWindowObject.width = 0.75 * appWindow.width
|
||||
keyboardShortcutTableWindowObject.height = 0.75 * appWindow.height
|
||||
keyboardShortcutTableWindowObject.x = centerX - keyboardShortcutTableWindowObject.width / 2
|
||||
keyboardShortcutTableWindowObject.y = centerY - keyboardShortcutTableWindowObject.height / 2
|
||||
}
|
||||
|
||||
// Destroy and reset selectScreenWindowObject when window is closed.
|
||||
|
|
Loading…
Add table
Reference in a new issue