1
mirror of https://github.com/monero-project/monero-gui synced 2024-12-02 07:41:23 +01:00
monero-gui/js/Windows.js

32 lines
939 B
JavaScript
Raw Normal View History

2019-03-07 15:16:10 +01:00
var flagsCustomDecorations = (Qt.FramelessWindowHint | Qt.CustomizeWindowHint | Qt.WindowSystemMenuHint | Qt.Window);
2019-04-25 23:41:17 +02:00
var flags = (Qt.WindowSystemMenuHint | Qt.Window | Qt.WindowMinimizeButtonHint | Qt.WindowCloseButtonHint | Qt.WindowTitleHint | Qt.WindowMaximizeButtonHint | Qt.WindowFullscreenButtonHint);
2018-04-21 21:25:52 +02:00
/**
* 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
2018-07-18 18:26:34 +02:00
2018-04-21 21:25:52 +02:00
// Update persistentSettings
persistentSettings.customDecorations = custom;
titleBar.visible = custom;
if (custom) {
appWindow.flags = flagsCustomDecorations;
} else {
appWindow.flags = flags;
}
2018-07-18 18:26:34 +02:00
2018-04-21 21:25:52 +02:00
// Reset window
appWindow.hide()
appWindow.x = x
appWindow.y = y
appWindow.show()
}