mirror of
https://github.com/monero-project/monero-gui
synced 2024-12-23 02:52:58 +01:00
Added 'Windows.js' for dialogs/windows
This commit is contained in:
parent
7d8d477a19
commit
acefb96520
34
js/Windows.js
Normal file
34
js/Windows.js
Normal file
@ -0,0 +1,34 @@
|
||||
var flagsCustomDecorations = (Qt.FramelessWindowHint | Qt.WindowSystemMenuHint | Qt.Window | Qt.WindowMinimizeButtonHint);
|
||||
var flags = (Qt.WindowSystemMenuHint | Qt.Window | Qt.WindowMinimizeButtonHint | Qt.WindowCloseButtonHint | Qt.WindowTitleHint | Qt.WindowMaximizeButtonHint);
|
||||
|
||||
/**
|
||||
* Toggles window decorations
|
||||
* @param {bool} custom - toggle decorations
|
||||
*/
|
||||
function setCustomWindowDecorations(custom) {
|
||||
// save x,y positions, because we need to hide/show the window
|
||||
var x = appWindow.x
|
||||
var y = appWindow.y
|
||||
if (x < 0) x = 0
|
||||
if (y < 0) y = 0
|
||||
|
||||
// Update persistentSettings
|
||||
persistentSettings.customDecorations = custom;
|
||||
|
||||
titleBar.visible = custom;
|
||||
daemonConsolePopup.titleBar.visible = custom;
|
||||
|
||||
if (custom) {
|
||||
appWindow.flags = flagsCustomDecorations;
|
||||
daemonConsolePopup.flags = flagsCustomDecorations;
|
||||
} else {
|
||||
appWindow.flags = flags;
|
||||
daemonConsolePopup.flags = flags;
|
||||
}
|
||||
|
||||
// Reset window
|
||||
appWindow.hide()
|
||||
appWindow.x = x
|
||||
appWindow.y = y
|
||||
appWindow.show()
|
||||
}
|
Loading…
Reference in New Issue
Block a user